Unverified Commit fcd1809f authored by Cong-Cong Pan's avatar Cong-Cong Pan Committed by GitHub
parent 4bee3817
...@@ -1188,7 +1188,7 @@ export default async function getBaseWebpackConfig( ...@@ -1188,7 +1188,7 @@ export default async function getBaseWebpackConfig(
chunks: isRspack chunks: isRspack
? // using a function here causes noticable slowdown ? // using a function here causes noticable slowdown
// in rspack // in rspack
/(?!polyfills|main|pages\/_app)/ /^(?!(polyfills|main|pages\/_app)$).*$/
: (chunk: any) => : (chunk: any) =>
!/^(polyfills|main|pages\/_app)$/.test(chunk.name), !/^(polyfills|main|pages\/_app)$/.test(chunk.name),
...@@ -1198,7 +1198,9 @@ export default async function getBaseWebpackConfig( ...@@ -1198,7 +1198,9 @@ export default async function getBaseWebpackConfig(
chunks: 'all' as const, chunks: 'all' as const,
name: 'framework', name: 'framework',
layer: RSPACK_DEFAULT_LAYERS_REGEX, layer: RSPACK_DEFAULT_LAYERS_REGEX,
test: /[/]node_modules[/](react|react-dom|next[/]dist[/]compiled[/](react|react-dom)(-experimental)?)[/]/, test: new RegExp(
`^(${topLevelFrameworkPaths.map((p) => `(${escapeStringRegexp(p)})`).join('|')})`
),
priority: 40, priority: 40,
enforce: true, enforce: 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