Migrating 2 CommonsChunksPlugin to Webpack 4's splitChunks

119 Views Asked by At

I have these settings in a Webpack 2.x config file and I'm migrating to Webpack 4. I know CommonsChunkPlugin is deprecated and I should use optimization.splitChunks, but I couldn't find anywhere in the docs on how to convert two CommonsChunkPlugin instances.

new webpack.optimize.CommonsChunkPlugin({
        name: 'common',
        minChunks: Infinity
    }),
new webpack.optimize.CommonsChunkPlugin({
    name: 'vendor',
    chunks: ["vendor", "app"],
    minChunks: 2
}),

How can I get the same results from the above settings with optimization.splitChunks?

0

There are 0 best solutions below