Skip to content

Commit 9efcc18

Browse files
Merge pull request #1142 from Financial-Times/fix-duplicate-vendors-bundle
fix: only set name to vendors for defaultVendors chunk
2 parents 73864c5 + 7d22024 commit 9efcc18

File tree

1 file changed

+11
-1
lines changed
  • packages/dotcom-build-code-splitting/src

1 file changed

+11
-1
lines changed

packages/dotcom-build-code-splitting/src/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ export class PageKitCodeSplittingPlugin {
1919
},
2020
splitChunks: {
2121
chunks: 'all',
22-
name: compiler.options.mode === 'development' ? 'vendors' : false
22+
cacheGroups: {
23+
defaultVendors: {
24+
// output a stable name for the defaultVendors chunk in development for testing purposes
25+
name: compiler.options.mode === 'development' ? 'vendors' : false,
26+
// setting the config here skips Webpack's defaults, so add them back
27+
idHint: 'vendors',
28+
reuseExistingChunk: true,
29+
test: /[\\/]node_modules[\\/]/i,
30+
priority: -10
31+
}
32+
}
2333
}
2434
}
2535
}

0 commit comments

Comments
 (0)