skip over undefined properties in rules

see regression https://github.com/webpack/webpack/issues/8537#issuecomment-508451734
This commit is contained in:
Tobias Koppers 2019-07-12 12:19:51 +02:00
parent 0661230d07
commit 44f812b66a
3 changed files with 17 additions and 1 deletions

View File

@ -140,7 +140,9 @@ class RuleSetCompiler {
* @returns {CompiledRule} normalized and compiled rule for processing
*/
compileRule(path, rule, refs) {
const unhandledProperties = new Set(Object.keys(rule));
const unhandledProperties = new Set(
Object.keys(rule).filter(key => rule[key] !== undefined)
);
/** @type {CompiledRule} */
const compiledRule = {

View File

@ -0,0 +1 @@
it("compile fine", () => {});

View File

@ -0,0 +1,13 @@
module.exports = {
module: {
rules: [
{
test: undefined,
loader: undefined,
use: undefined,
options: undefined,
resource: undefined
}
]
}
};