1 | // we are using the default config of webpack, as it's good for most cases
|
2 | // see: https://webpack.js.org/plugins/split-chunks-plugin/
|
3 | // see: https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
|
4 |
|
5 | module.exports = {
|
6 | chunks: 'all',
|
7 | minSize: 30000,
|
8 | maxSize: 0,
|
9 | minChunks: 1,
|
10 | maxAsyncRequests: 5,
|
11 | maxInitialRequests: 3,
|
12 | automaticNameDelimiter: '~',
|
13 | name: true,
|
14 | cacheGroups: {
|
15 | vendors: {
|
16 | test: /[\\/]node_modules[\\/]/,
|
17 | priority: -10,
|
18 | },
|
19 | default: {
|
20 | minChunks: 2,
|
21 | priority: -20,
|
22 | reuseExistingChunk: true,
|
23 | },
|
24 | },
|
25 | };
|