I'm trying to migrate from Webpack 3 to 4, and that requires me to change from using CommonsChunkPlugin to splitChunks. But I'm struggling to maintain the same behaviour.
My Webpack 3 code:
webpack.config.js
entry: {
vendor: ['jquery', 'timeago.js', 'jquery-accessible-autocomplete-list-aria/jquery-accessible-autocomplete-list-aria', 'jquery-ujs'],
application: ['./javascripts/application.js', './stylesheets/application.scss'],
},
and
plugins: [
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity,
}),
I think Webpack call this Explicit Vendor Chunk.
What Webpack 4 code should I write to produce the same behaviour as above?
I tried removing
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: Infinity,
}),
but it doesn't just work.
I tried following https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693 but it doesn't produce the same behaviour too.