Commit 4ad5170b authored by Dan Abramov's avatar Dan Abramov Committed by GitHub
Browse files

Enable hot reloading for CSS (#42)

parent ff73f16b
Showing with 5 additions and 1 deletion
+5 -1
...@@ -20,6 +20,7 @@ module.exports = { ...@@ -20,6 +20,7 @@ module.exports = {
devtool: 'eval', devtool: 'eval',
entry: [ entry: [
require.resolve('webpack-dev-server/client') + '?http://localhost:3000', require.resolve('webpack-dev-server/client') + '?http://localhost:3000',
require.resolve('webpack/hot/dev-server'),
'./src/index.js' './src/index.js'
], ],
output: { output: {
...@@ -79,6 +80,8 @@ module.exports = { ...@@ -79,6 +80,8 @@ module.exports = {
inject: true, inject: true,
template: path.resolve(__dirname, relative, 'index.html'), template: path.resolve(__dirname, relative, 'index.html'),
}), }),
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"development"' }) new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"development"' }),
// Note: only CSS is currently hot reloaded
new webpack.HotModuleReplacementPlugin()
] ]
}; };
...@@ -29,6 +29,7 @@ if (process.argv[2] === '--smoke-test') { ...@@ -29,6 +29,7 @@ if (process.argv[2] === '--smoke-test') {
new WebpackDevServer(webpack(config, handleCompile), { new WebpackDevServer(webpack(config, handleCompile), {
publicPath: config.output.publicPath, publicPath: config.output.publicPath,
historyApiFallback: true, historyApiFallback: true,
hot: true, // Note: only CSS is currently hot reloaded
stats: { stats: {
hash: false, hash: false,
version: false, version: false,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment