Webpack 4. SplitChunks重复

时间:2018-04-10 07:24:50

标签: javascript webpack

我使用Webpack 4并希望拆分两个入口点并避免重复。所以,我已经在两个块中做出反应和反应。

entry: {
    index: ['babel-polyfill', './app/app.jsx'],
    vendor: [
        'react',
        'react-dom'
    ]
}


splitChunks: {
            cacheGroups: {
                index: {
                    minChunks: 2,
                    priority: -20,
                    reuseExistingChunk: true
                },
                vendor: {
                    test: /[\\/]node_modules[\\/]/,
                    priority: -10
                }
            }
        }

0 个答案:

没有答案