-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Description
Bug report
What is the current behavior?
The splitChunks feature (using chunks: 'all') doesn't take into account CSS extraction (via mini-css-extract-plugin) when deciding whether to create a new inital chunk. A new chunk can end up being created that is empty (other than the webpack functions) and under the default 30KB splitChunks.minSize threshold so shouldn't have been created.
eg:
dist/vendors~pageA~pageB.js
For webpack build log output see:
https://github.com/edmorley/testcase-webpack-splitchunks-css#actual
If the current behavior is a bug, please provide the steps to reproduce.
git clone https://github.com/edmorley/testcase-webpack-splitchunks-css.gityarn installyarn build
What is the expected behavior?
There is no dist/vendors~pageA~pageB.js chunk generated, since after the CSS is extracted, there should be no common JS code between the two pages.
Other relevant information:
webpack version: 4.8.3
Node.js version: 10.1.0
Operating System: Windows 10
Additional tools: mini-css-extract-plugin@0.4.0