You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor', 'manifest'] // Specify the common bundle's name.
})
and
Block 2:
new webpack.optimize.CommonsChunkPlugin({
name:'vendor',
minChunks: function (module) {
return module.context && module.context.indexOf('node_modules') !== -1; // Yes, my dependencies are in the `node_modules` directory only
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest'
}),
However, the results are different.
The 2nd code is further decreasing the size of bundle.js but increasing size of vendor.js as compared to 1st code.
What is the expected behavior?
Both should give same results as per the link, isn't it?
The code-splitting-libraries guide was removed in #1338 and replaced with a simpler code-splitting guide that doesn't use these examples. If there's a similar erroneous example in the caching guide or commons-chunk-plugin, please re-open or add a comment on #652.
Do you want to request a feature or report a bug?
Report confusion from documentation
What is the current behavior?
I'm following the link https://webpack.js.org/guides/code-splitting-libraries/
The link says that both of below are same in achieving results:
Block 1:
and
Block 2:
However, the results are different.
The 2nd code is further decreasing the size of
bundle.js
but increasing size ofvendor.js
as compared to 1st code.What is the expected behavior?
Both should give same results as per the link, isn't it?
All below are minified by ungzipped
Note: The above is with just with
Block 1:
Block 2:
Tested with 3 different repositories (2 react repos and 1 infernojs repo). Similar observations.
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Node: 4.8.0
Webpack: 2.5.1
OSX
This issue was moved from webpack/webpack#5057 by @sokra. Orginal issue was by @aseem2625.
The text was updated successfully, but these errors were encountered: