Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(index): stricter check for shouldExtract !== wasExtracted (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasmanionis authored and michael-ciniawsky committed Sep 13, 2017
1 parent 6a660f3 commit 510704f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ class ExtractTextPlugin {
let meta = module[NS];
if (meta && (!meta.options.id || meta.options.id === id)) {
const wasExtracted = Array.isArray(meta.content);
if (shouldExtract !== wasExtracted) {
// A stricter `shouldExtract !== wasExtracted` check to guard against cases where a previously extracted
// module would be extracted twice. Happens when a module is a dependency of an initial and a non-initial
// chunk. See issue #604
if (shouldExtract && !wasExtracted) {
module[`${NS}/extract`] = shouldExtract; // eslint-disable-line no-path-concat
compilation.rebuildModule(module, (err) => {
if (err) {
Expand Down

0 comments on commit 510704f

Please sign in to comment.