Skip to content

Commit

Permalink
enhance(bundle-size): give names to all automatic chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA committed Sep 6, 2024
1 parent db2f3dc commit 22c6a74
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,11 @@ function config(webpackEnv) {
level: "none",
},
optimization: {
chunkIds: isEnvProduction ? "natural" : "named",
moduleIds: isEnvProduction ? "natural" : "named",
splitChunks: {
name: (_, chunks, cacheGroupKey) => {
return `${cacheGroupKey === "defaultVendors" ? "vendor" : cacheGroupKey}-${chunks.map(({ name }) => name).join("~")}`;
},
},
minimize: isEnvProduction,
minimizer: [
// This is only used in production mode
Expand Down

0 comments on commit 22c6a74

Please sign in to comment.