Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
chore: bundle-seperation for node_modules (#7035)
Browse files Browse the repository at this point in the history
  • Loading branch information
habib-deriv authored Feb 13, 2024
1 parent 3bf8a82 commit 9bc43e6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,14 +429,19 @@ exports.onCreateWebpackConfig = ({ stage, actions, loaders, getConfig }, { ...op
splitChunks: {
chunks: 'all',
cacheGroups: {
default: false,
vendors: false,
// Merge all js, ts, and tsx files into one bundle
all: {
test: /\.(js|ts|tsx)$/,
name: 'bundle',
chunks: 'all',
},
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'all',
priority: -10,
},
bundle: {
test: /\.(js|ts|tsx)$/,
name: 'bundle',
chunks: 'all',
priority: -20,
enforce: true,
},
},
},
mangleExports: 'size',
Expand Down

0 comments on commit 9bc43e6

Please sign in to comment.