We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module.exports = { webpack: (config, options) => { if (!options.isServer && !options.dev) { config.optimization.splitChunks.cacheGroups.babel = { chunks: 'all', name: 'babel', test: /[\\/]node_modules[\\/](@babel|regenerator-runtime)[\\/]/ }; } return config; } );```
The text was updated successfully, but these errors were encountered:
Using the following config, I was able to reduce the parsed bundle size of a project from:
module.exports = { webpack: (config, options) => { if (!options.isServer && !options.dev) { config.optimization.splitChunks.cacheGroups = { babel: { chunks: 'all', name: 'babel', priority: 2, test: /[\\/]node_modules[\\/](@babel|regenerator-runtime)[\\/]/ }, common: { maxInitialRequests: 5, name: 'common' }, react: { chunks: 'all', name: 'react', priority: 2, test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/ }, vendor: { chunks: 'all', enforce: true, name: 'vendor', priority: 1, test: /node_modules/ } }; } return config; } };
This overwrites Next.js' config.optimization.splitChunks.cacheGroups instead of merging, but this works for the project I'm working on.
config.optimization.splitChunks.cacheGroups
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: