Skip to content

Instantly share code, notes, and snippets.

@mladenp
Created November 8, 2016 10:20
Show Gist options
  • Save mladenp/ac7ce36c73eeca3cb596bef0ac9131b4 to your computer and use it in GitHub Desktop.
Save mladenp/ac7ce36c73eeca3cb596bef0ac9131b4 to your computer and use it in GitHub Desktop.
react - webpack hot reload dev server
var webpack = require('webpack');
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./src/index.js'
],
module: {
loaders: [{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'react-hot!babel'
}]
},
resolve: {
extensions: ['', '.js']
},
output: {
path: 'dist',
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
contentBase: './dist',
hot: true
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment