From c846c9ff253591cddb6847384d35d1f5691b4043 Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Sat, 4 Jan 2020 19:09:25 -0800 Subject: [PATCH] Remove HMR config from production webpack configuration. --- generator/src/develop.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/generator/src/develop.js b/generator/src/develop.js index f369bfd7..4382e1d2 100644 --- a/generator/src/develop.js +++ b/generator/src/develop.js @@ -121,10 +121,6 @@ function webpackOptions( { debug, manifestConfig, routesWithRequests } ) { const common = { - entry: [ - require.resolve("webpack-hot-middleware/client"), - path.resolve(process.cwd(), "./index.js"), - ], mode: production ? "production" : "development", plugins: [ new AddFilesPlugin(routesWithRequests), @@ -273,6 +269,7 @@ function webpackOptions( }; if (production) { return merge(common, { + entry: "./index.js", optimization: { minimizer: [ new ClosurePlugin( @@ -322,6 +319,10 @@ function webpackOptions( }); } else { return merge(common, { + entry: [ + require.resolve("webpack-hot-middleware/client"), + "./index.js", + ], plugins: [ new webpack.NamedModulesPlugin(), // Prevents compilation errors causing the hot loader to lose state