assets-webpack-plugin: Backward incompatible change on the generated file in 3.9.0-3.9.1
I am using webpack 3.5, and was used to have a assets.json that look like this:
{
asset_1: {
js: "asset_1-hash.js",
css: "asset_1-hash.css"
},
...
commons: {
js: "commons-hash.js",
css: "commons-hash.css",
},
}
And now it looks like this
{
asset_1: {
js: [
"commons-hash.js",
"asset_1-hash.js"
],
css: [
"commons-hash.css",
"asset_1-hash.css"
]
},
}
Which is kind of a huge incompatible change. And I don’t see any info about this, nor warnings.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 15 (7 by maintainers)
@ztoben With 3.9.2 the situation is back to normal, Here is a redacted version of my webpack config:
Yes due to #109 for sure. In Webpack 4, you can let it split the entry js as it sees fit, and that automatically creates a commons chunk. Easy to use, just map across the js array, creating script tags.
I think the new behavior will have to be behind a flag. I’m not sure why the named commons chunk isn’t showing up either, I would expect it to be listed too.
@ztoben: Here’s a snapshot of a Webpack config that illustrated the problem: https://github.com/mapbox/batfish/blob/503064de33ebffa407bbdf5d20e44a8c71964ccd/test/__snapshots__/create-webpack-config-client.test.js.snap#L109-L231
I’m having the same problem, and can confirm that 3.8.4 works the same as before but 3.9.0+ breaks the output. So I’d definitely consider this a bug, not an enhancement.