Skip to content

Commit

Permalink
fix(entries): Don't add css entries twice
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Mar 1, 2018
1 parent dc233b5 commit e890f23
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,14 @@ class HtmlWebpackPlugin {
}

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

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

0 comments on commit e890f23

Please sign in to comment.