Skip to content

Commit

Permalink
fix(entries): do not ignore JS if there is also CSS
Browse files Browse the repository at this point in the history
broken by commit 0348d6b
  • Loading branch information
rodneyrehm authored and jantimon committed Mar 6, 2018
1 parent 5711f16 commit 020b714
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,13 @@ class HtmlWebpackPlugin {
}

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

// Gather all css files
Expand Down

0 comments on commit 020b714

Please sign in to comment.