Skip to content

Instantly share code, notes, and snippets.

@gooderist
Last active November 27, 2015 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gooderist/31e9c2fd885307015bb9 to your computer and use it in GitHub Desktop.
Save gooderist/31e9c2fd885307015bb9 to your computer and use it in GitHub Desktop.
webpack + babel + react hot loader config file
'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