Commit 3263af51 authored by Alex Castle's avatar Alex Castle Committed by Joe Haddad

Update framework chunk test regex to not select nested dependencies (#9012)

* Update framework chunk test regex to not select nested dependencies

* Update webpack-config.ts
parent b2adfde9
...@@ -234,7 +234,10 @@ export default async function getBaseWebpackConfig( ...@@ -234,7 +234,10 @@ export default async function getBaseWebpackConfig(
// TODO(atcastle): Analyze if other cache groups should be set to 'all' as well // TODO(atcastle): Analyze if other cache groups should be set to 'all' as well
chunks: 'all', chunks: 'all',
name: 'framework', name: 'framework',
test: /[\\/]node_modules[\\/](react|react-dom|scheduler|prop-types)[\\/]/, // This regex ignores nested copies of framework libraries so they're
// bundled with their issuer.
// https://github.com/zeit/next.js/pull/9012
test: /(?<!node_modules.*)[\\/]node_modules[\\/](react|react-dom|scheduler|prop-types)[\\/]/,
priority: 40, priority: 40,
}, },
lib: { lib: {
......
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