From 8942d20b8c976ea9057bab2ba4974e3b522b9742 Mon Sep 17 00:00:00 2001 From: Bertrand Marron Date: Tue, 6 Feb 2018 10:08:53 +0100 Subject: [PATCH] Move react{-dom,} to the common chunk in production too (#3690) Without this, react-dom gets included in multiple pages. --- server/build/webpack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/build/webpack.js b/server/build/webpack.js index 3084a37f..d2b61ccb 100644 --- a/server/build/webpack.js +++ b/server/build/webpack.js @@ -250,11 +250,11 @@ export default async function getBaseWebpackConfig (dir, {dev = false, isServer // We need to move react-dom explicitly into common chunks. // Otherwise, if some other page or module uses it, it might // included in that bundle too. - if (dev && module.context && module.context.indexOf(`${sep}react${sep}`) >= 0) { + if (module.context && module.context.indexOf(`${sep}react${sep}`) >= 0) { return true } - if (dev && module.context && module.context.indexOf(`${sep}react-dom${sep}`) >= 0) { + if (module.context && module.context.indexOf(`${sep}react-dom${sep}`) >= 0) { return true }