rsnext/test/integration/conformance/next.config.js
Janicklas Ralph a17ace8eba
GranularChunks conformance check (#11710)
Adding a conformance plugin the make sure users don't undo the benefits of the granularChunks config.

The plugin makes sure that minSize, maxInitialRequests values aren't overridden. Also ensures the cacheGroups - vendors, framework, libs, common, shared are maintained.

The warning and error messages do not break the build with this change. They only display a message.

cc - @prateekbh, @atcastle
2020-05-20 06:40:23 +00:00

17 lines
324 B
JavaScript

module.exports = {
experimental: {
conformance: true,
},
webpack(cfg, { dev, isServer }) {
if (!dev && !isServer) {
cfg.optimization.splitChunks.cacheGroups.vendors = {
chunks: 'initial',
name: 'vendor',
test: 'vendor',
enforce: true,
}
}
return cfg
},
}