Stefan Natter
1 min readNov 5, 2017

--

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.

--

--

Stefan Natter
Stefan Natter

Written by Stefan Natter

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

No responses yet