mirror of https://github.com/webpack/webpack.git
fix crash because for invalid type
This commit is contained in:
parent
b1a742225d
commit
f2ed7ca3e3
|
|
@ -580,13 +580,15 @@ class RuntimeTemplate {
|
||||||
}) {
|
}) {
|
||||||
if (runtimeCondition === undefined) return "true";
|
if (runtimeCondition === undefined) return "true";
|
||||||
if (typeof runtimeCondition === "boolean") return `${runtimeCondition}`;
|
if (typeof runtimeCondition === "boolean") return `${runtimeCondition}`;
|
||||||
|
/** @type {Set<string>} */
|
||||||
const positiveRuntimeIds = new Set();
|
const positiveRuntimeIds = new Set();
|
||||||
forEachRuntime(runtimeCondition, runtime =>
|
forEachRuntime(runtimeCondition, runtime =>
|
||||||
positiveRuntimeIds.add(chunkGraph.getRuntimeId(runtime))
|
positiveRuntimeIds.add(`${chunkGraph.getRuntimeId(runtime)}`)
|
||||||
);
|
);
|
||||||
|
/** @type {Set<string>} */
|
||||||
const negativeRuntimeIds = new Set();
|
const negativeRuntimeIds = new Set();
|
||||||
forEachRuntime(subtractRuntime(runtime, runtimeCondition), runtime =>
|
forEachRuntime(subtractRuntime(runtime, runtimeCondition), runtime =>
|
||||||
negativeRuntimeIds.add(chunkGraph.getRuntimeId(runtime))
|
negativeRuntimeIds.add(`${chunkGraph.getRuntimeId(runtime)}`)
|
||||||
);
|
);
|
||||||
runtimeRequirements.add(RuntimeGlobals.runtimeId);
|
runtimeRequirements.add(RuntimeGlobals.runtimeId);
|
||||||
return compileBooleanMatcher.fromLists(
|
return compileBooleanMatcher.fromLists(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
findBundle: function (i, options) {
|
findBundle: function (i, options) {
|
||||||
return ["shared.js", "a.js", "b.js", "c.js"];
|
return ["shared.js", "a.js", "b.js", "c1.js", "c2.js"];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ module.exports = {
|
||||||
entry: {
|
entry: {
|
||||||
a: "./a",
|
a: "./a",
|
||||||
b: "./b",
|
b: "./b",
|
||||||
c: "./c"
|
c1: "./c",
|
||||||
|
c2: "./c"
|
||||||
},
|
},
|
||||||
target: "web",
|
target: "web",
|
||||||
output: {
|
output: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue