-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No documented replacement / upgrade path for htmlWebpackPluginAlterChunks
removed in 4.0.0
#1750
Comments
Commit 342867e has some explanation for this.
I am not familiar with how html-webpack-plugin works, however if I had to guess then its because this plugin no longer processes chunks. |
I am using this plugin and provided a custom sort order via const webpackConfig = {
...
entry: {
main: [
'babel-polyfill',
'./index.js',
],
splash: ['./web/splash/splash.js'],
},
...
plugins: [
...
new HtmlWebpackPlugin({
chunksSortMode: (chunkA, chunkB) => {
console.log('RORY_DEBUG sorting chunks:', {chunkA, chunkB});
if (chunkA === 'splash') {
return -1;
}
return chunkB - chunkA;
},
}),
...
],
...
optimization: {
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: 'vendors',
chunks: 'initial',
},
},
},
},
}; The result I see is this: Where the |
@OliverJEvans I'm not sure if it addresses your concerns, but I created a PR to address mine: #1774. Feel free to test it out and see if it helps you. |
Current behaviour 💣
In v4.0.0. removed a hook called
htmlWebpackPluginAlterChunks
but without any reasoning or documented replacement (342867e).I've picked up an old project and I'm rying to use this hook in a plugin pulled from a (now archived) Shopify Slate theme tool. However without any documented upgrade path I've hit a dead end.
I understand that its been missing for years now, but if theres any documentaiton or thoughts on how it can replaced, I'd be greatly appreciative.
Expected behaviour ☀️
To have a documented replacement for
htmlWebpackPluginAlterChunks
Reproduction Example 👾
https://github.com/Shopify/slate/blob/master/packages/slate-tools/tools/webpack/html-webpack-include-chunks.js
Environment 🖥
Node.js v16.15.0
darwin 21.5.0
8.5.5
The text was updated successfully, but these errors were encountered: