Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 7d8cee1

Browse files
clydinhansl
authored andcommitted
fix(@angular-devkit/build-angular): adjust chunk splitting options
This ensures that initial vendor modules are alway placed in the vendor bundle. And also increases the potential for splitting common modules out of async (lazy route) chunks. Mitigates angular/angular-cli#10294
1 parent 3bf5ec6 commit 7d8cee1

File tree

1 file changed

+2
-0
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs

1 file changed

+2
-0
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/browser.ts

+2
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ export function getBrowserConfig(wco: WebpackConfigOptions) {
9595
runtimeChunk: 'single',
9696
splitChunks: {
9797
chunks: buildOptions.commonChunk ? 'all' : 'initial',
98+
maxAsyncRequests: Infinity,
9899
cacheGroups: {
99100
vendors: false,
100101
vendor: buildOptions.vendorChunk && {
101102
name: 'vendor',
102103
chunks: 'initial',
104+
enforce: true,
103105
test: (module: any, chunks: Array<{ name: string }>) => {
104106
const moduleName = module.nameForCondition ? module.nameForCondition() : '';
105107
return /[\\/]node_modules[\\/]/.test(moduleName)

0 commit comments

Comments
 (0)