What is the current behavior?
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.
For webpack build log output see:
If the current behavior is a bug, please provide the steps to reproduce.
git clone https://github.com/edmorley/testcase-webpack-splitchunks-css.git
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: firstname.lastname@example.org