Skip to content

Commit

Permalink
fix: splitchunks
Browse files Browse the repository at this point in the history
  • Loading branch information
hasan-deriv committed Jun 25, 2024
1 parent 1497d8d commit 03196b1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/cfd/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,34 @@ module.exports = function (env) {
moduleIds: 'named',
minimize: IS_RELEASE,
minimizer: MINIMIZERS,
splitChunks: {
automaticNameDelimiter: '~',
cacheGroups: {
default: {
minChunks: 2,
priority: -20,
reuseExistingChunk: true,
},
defaultVendors: {
idHint: 'vendors',
priority: -10,
test: /[\\/]node_modules[\\/]/,
},
assets: {
chunks: 'all',
name: 'assets',
test: /[\\/]Assets[\\/]/,
reuseExistingChunk: true,
idHint: 'assets',
},
},
chunks: 'all',
maxAsyncRequests: 30,
maxInitialRequests: 3,
minChunks: 1,
minSize: 102400,
minSizeReduction: 102400,
},
},
output: {
filename: 'cfd/js/[name].js',
Expand Down

0 comments on commit 03196b1

Please sign in to comment.