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

Commit 510704f

Browse files
kostasmanionismichael-ciniawsky
authored andcommitted
fix(index): stricter check for shouldExtract !== wasExtracted (#605)
1 parent 6a660f3 commit 510704f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ class ExtractTextPlugin {
149149
let meta = module[NS];
150150
if (meta && (!meta.options.id || meta.options.id === id)) {
151151
const wasExtracted = Array.isArray(meta.content);
152-
if (shouldExtract !== wasExtracted) {
152+
// A stricter `shouldExtract !== wasExtracted` check to guard against cases where a previously extracted
153+
// module would be extracted twice. Happens when a module is a dependency of an initial and a non-initial
154+
// chunk. See issue #604
155+
if (shouldExtract && !wasExtracted) {
153156
module[`${NS}/extract`] = shouldExtract; // eslint-disable-line no-path-concat
154157
compilation.rebuildModule(module, (err) => {
155158
if (err) {

0 commit comments

Comments
 (0)