Skip to content

Commit 1b419fd

Browse files
committed
Adding Hot Module Replacement support
1 parent 8cb76dc commit 1b419fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/config-generator.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ class ConfigGenerator {
413413
const outputPath = this.webpackConfig.outputPath.replace(this.webpackConfig.getContext() + '/', '');
414414
plugins.push(new AssetsOutputDisplayPlugin(outputPath, friendlyErrorsPlugin));
415415

416+
if (this.webpackConfig.useDevServer()) {
417+
plugins.push(new webpack.HotModuleReplacementPlugin())
418+
}
419+
416420
return plugins;
417421
}
418422

@@ -463,6 +467,7 @@ class ConfigGenerator {
463467
// avoid CORS concerns trying to load things like fonts from the dev server
464468
headers: { 'Access-Control-Allow-Origin': '*' },
465469
// required by FriendlyErrorsWebpackPlugin
470+
hot: true,
466471
quiet: true,
467472
compress: true,
468473
historyApiFallback: true,

0 commit comments

Comments
 (0)