Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e890f23

Browse files
committedMar 1, 2018
fix(entries): Don't add css entries twice
1 parent dc233b5 commit e890f23

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,14 @@ class HtmlWebpackPlugin {
453453
}
454454

455455
// Webpack outputs an array for each chunk when using sourcemaps
456-
// But we need only the entry file
456+
// But we need only the initial entry file in case it is a js file
457457
const entry = chunkFiles[0];
458-
assets.chunks[chunkName].size = chunk.size;
459-
assets.chunks[chunkName].entry = entry;
460-
assets.chunks[chunkName].hash = chunk.hash;
461-
assets.js.push(entry);
458+
if (/.js($|\?)/.test(entry)) {
459+
assets.chunks[chunkName].size = chunk.size;
460+
assets.chunks[chunkName].entry = entry;
461+
assets.chunks[chunkName].hash = chunk.hash;
462+
assets.js.push(entry);
463+
}
462464

463465
// Gather all css files
464466
const css = chunkFiles.filter(chunkFile => /.css($|\?)/.test(chunkFile));

0 commit comments

Comments
 (0)
Please sign in to comment.