We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent 5711f16 commit 020b714Copy full SHA for 020b714
index.js
@@ -453,13 +453,13 @@ class HtmlWebpackPlugin {
453
}
454
455
// Webpack outputs an array for each chunk when using sourcemaps
456
- // But we need only the initial entry file in case it is a js file
457
- const entry = chunkFiles[0];
458
- if (/.js($|\?)/.test(entry)) {
+ // or when one chunk hosts js and css simultaneously
+ const js = chunkFiles.find(chunkFile => /.js($|\?)/.test(chunkFile));
+ if (js) {
459
assets.chunks[chunkName].size = chunk.size;
460
- assets.chunks[chunkName].entry = entry;
+ assets.chunks[chunkName].entry = js;
461
assets.chunks[chunkName].hash = chunk.hash;
462
- assets.js.push(entry);
+ assets.js.push(js);
463
464
465
// Gather all css files
0 commit comments