Skip to content

Commit 977bdb9

Browse files
authored
Merge pull request webpack#6750 from byzyk/fix/6726
fix: make excludeModules accept booleans
2 parents 3dabc43 + 0f65643 commit 977bdb9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/Stats.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class Stats {
106106
if (item && typeof item === "object" && typeof item.test === "function")
107107
return ident => item.test(ident);
108108
if (typeof item === "function") return item;
109+
if (typeof item === "boolean") return () => item;
109110
};
110111

111112
const compilation = this.compilation;
@@ -1175,7 +1176,7 @@ class Stats {
11751176
optimizationBailout: true,
11761177
errorDetails: true,
11771178
publicPath: true,
1178-
exclude: () => false,
1179+
exclude: false,
11791180
maxModules: Infinity
11801181
};
11811182
case "detailed":
@@ -1190,7 +1191,7 @@ class Stats {
11901191
optimizationBailout: true,
11911192
errorDetails: true,
11921193
publicPath: true,
1193-
exclude: () => false,
1194+
exclude: false,
11941195
maxModules: Infinity
11951196
};
11961197
case "minimal":

schemas/WebpackOptions.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,10 +1821,13 @@
18211821
]
18221822
},
18231823
"excludeModules": {
1824-
"description": "Suppress modules that match the specified filters. Filters can be Strings, RegExps or Functions",
1824+
"description": "Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions",
18251825
"anyOf": [
18261826
{
18271827
"$ref": "#/definitions/filter-types"
1828+
},
1829+
{
1830+
"type": "boolean"
18281831
}
18291832
]
18301833
},
@@ -1833,6 +1836,9 @@
18331836
"anyOf": [
18341837
{
18351838
"$ref": "#/definitions/filter-types"
1839+
},
1840+
{
1841+
"type": "boolean"
18361842
}
18371843
]
18381844
},

0 commit comments

Comments
 (0)