Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Last active February 2, 2022 07:14
Webpack config for splitting chunks
module.exports = {
webpack(config, { isServer }) {
if (!isServer) {
config.optimization.splitChunks.cacheGroups = {
...config.optimization.splitChunks.cacheGroups,
'@sentry': {
test: /[\\/]node_modules[\\/](@sentry)[\\/]/,
name: '@sentry',
priority: 10,
reuseExistingChunk: false,
},
};
}
return config;
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment