Skip to content

Commit 79cf75a

Browse files
committed
update ExternalModule hash with optional flag
1 parent fcae4da commit 79cf75a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lib/ExternalModule.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class ExternalModule extends Module {
120120
updateHash(hash) {
121121
hash.update(this.type);
122122
hash.update(JSON.stringify(this.request));
123+
hash.update(JSON.stringify(this.optional));
123124
super.updateHash(hash);
124125
}
125126
}

test/ExternalModule.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ module.exports = some/request;`;
323323
hashedText += text;
324324
}
325325
};
326+
externalModule.optional = true;
326327
externalModule.updateHash(hash);
327328
});
328329
it("updates hash with request", function() {
@@ -331,5 +332,8 @@ module.exports = some/request;`;
331332
it("updates hash with type", function() {
332333
hashedText.should.containEql("some-type");
333334
});
335+
it("updates hash with optional flag", function() {
336+
hashedText.should.containEql("true");
337+
});
334338
});
335339
});

test/statsCases/external/expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Hash: 7861295d7291830ba01f
1+
Hash: e500321cbaac14df7284
22
Time: Xms
33
Asset Size Chunks Chunk Names
44
main.js 2.61 kB 0 [emitted] main

0 commit comments

Comments
 (0)