3

React CSS 样式的渲染时间晚于自定义 CSS 样式,后者在某种程度上依赖于minChunks.

new webpack.optimize.CommonsChunkPlugin({
    name: "common",
    minChunks: function(module, count) {
        return !couldThisGoToCommonBundle(module) && count >= 5;
    }
}),

new webpack.optimize.CommonsChunkPlugin({
    name: 'vendor',
    chunks: Object.keys(entryPoints).concat('common'),
    minChunks: function(module, count) {
        return couldThisGoToCommonBundle(module) && count >= 10;
    }
})

当我在供应商中更改计数 >= 5 时,自定义样式不会失真。

4

0 回答 0