Created
November 8, 2016 10:20
-
-
Save mladenp/ac7ce36c73eeca3cb596bef0ac9131b4 to your computer and use it in GitHub Desktop.
react - webpack hot reload dev server
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
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