Great article!

I have one question (after reading through some webpack docs). You suggest to bundle vendors with the following piece of code.

```
new webpack.optimize.CommonsChunkPlugin({
name: ‘vendor’,
minChunks: Infinity
}),

```

As seen here: https://webpack.js.org/plugins/commons-chunk-plugin/, there are other ways to do it too, right? Or am I missing someting or mixing something up?

```
new webpack.optimize.CommonsChunkPlugin({
name: ‘vendor’,
minChunks: function (module) {
return module.context && module.context.indexOf(“node_modules”) !== -1;
}
}),

```

What’s the way to go? :) Thanks.

Written by

I am a Software Engineer from Austria 🇦🇹. I write about JavaScript, TypeScript, ReactJS and NodeJS. 📧 Weekly NL Series: https://newsletter.natterstefan.me

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store