Last active
November 27, 2015 08:06
-
-
Save gooderist/31e9c2fd885307015bb9 to your computer and use it in GitHub Desktop.
webpack + babel + react hot loader config file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: [ | |
'webpack-dev-server/client?http://0.0.0.0:8080', // WDS host | |
'webpack/hot/only-dev-server', // not sure what this does | |
'./entry.js' | |
], | |
output: { | |
path: __dirname, | |
filename: 'bundle.js' | |
}, | |
module: { | |
loaders: [ | |
{ | |
test: /\.css$/, | |
loader: 'style!css' | |
}, | |
{ | |
test: /\.scss$/, | |
loader: 'style!css!sass' | |
}, | |
{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
loader: 'react-hot' | |
}, | |
{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
loader: 'babel-loader', | |
query: { | |
presets: ['es2015', 'react', 'stage-0'] | |
} | |
} | |
] | |
}, | |
plugins: [ | |
new webpack.HotModuleReplacementPlugin(), | |
new webpack.NoErrorsPlugin() // Remove this if using babel-eslint | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment