Skip to content

Commit 4ad5170

Browse files
authored
Enable hot reloading for CSS (#42)
1 parent ff73f16 commit 4ad5170

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config/webpack.config.dev.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = {
2020
devtool: 'eval',
2121
entry: [
2222
require.resolve('webpack-dev-server/client') + '?http://localhost:3000',
23+
require.resolve('webpack/hot/dev-server'),
2324
'./src/index.js'
2425
],
2526
output: {
@@ -79,6 +80,8 @@ module.exports = {
7980
inject: true,
8081
template: path.resolve(__dirname, relative, 'index.html'),
8182
}),
82-
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"development"' })
83+
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"development"' }),
84+
// Note: only CSS is currently hot reloaded
85+
new webpack.HotModuleReplacementPlugin()
8386
]
8487
};

scripts/start.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if (process.argv[2] === '--smoke-test') {
2929
new WebpackDevServer(webpack(config, handleCompile), {
3030
publicPath: config.output.publicPath,
3131
historyApiFallback: true,
32+
hot: true, // Note: only CSS is currently hot reloaded
3233
stats: {
3334
hash: false,
3435
version: false,

0 commit comments

Comments
 (0)