Commit 8942d20b authored by Bertrand Marron's avatar Bertrand Marron Committed by Arunoda Susiripala

Move react{-dom,} to the common chunk in production too (#3690)

Without this, react-dom gets included in multiple pages.
parent efed85e4
...@@ -250,11 +250,11 @@ export default async function getBaseWebpackConfig (dir, {dev = false, isServer ...@@ -250,11 +250,11 @@ export default async function getBaseWebpackConfig (dir, {dev = false, isServer
// We need to move react-dom explicitly into common chunks. // We need to move react-dom explicitly into common chunks.
// Otherwise, if some other page or module uses it, it might // Otherwise, if some other page or module uses it, it might
// included in that bundle too. // 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 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 return true
} }
......
Markdown is supported
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