diff --git a/declarations/WebpackOptions.d.ts b/declarations/WebpackOptions.d.ts index eed34e7b6c3..99fd7a7595a 100644 --- a/declarations/WebpackOptions.d.ts +++ b/declarations/WebpackOptions.d.ts @@ -558,6 +558,10 @@ export interface RuleSetRule { * Shortcut for use.query */ query?: RuleSetQuery; + /** + * Match rules with custom resource name + */ + realResource?: RuleSetConditionOrConditions; /** * Options for the resolver */ @@ -566,10 +570,6 @@ export interface RuleSetRule { * Match the resource path of the module */ resource?: RuleSetConditionOrConditionsAbsolute; - /** - * Match rules with custom resource name - */ - realResource?: RuleSetConditionOrConditions; /** * Match the resource query of the module */ diff --git a/schemas/WebpackOptions.json b/schemas/WebpackOptions.json index 4fdfa5bc417..bd2b243bd36 100644 --- a/schemas/WebpackOptions.json +++ b/schemas/WebpackOptions.json @@ -1511,6 +1511,14 @@ } ] }, + "realResource": { + "description": "Match rules with custom resource name", + "anyOf": [ + { + "$ref": "#/definitions/RuleSetConditionOrConditions" + } + ] + }, "resolve": { "description": "Options for the resolver", "type": "object", @@ -1528,14 +1536,6 @@ } ] }, - "realResource": { - "description": "Match rules with custom resource name", - "anyOf": [ - { - "$ref": "#/definitions/RuleSetConditionOrConditions" - } - ] - }, "resourceQuery": { "description": "Match the resource query of the module", "anyOf": [ diff --git a/test/Validation.test.js b/test/Validation.test.js index e82f8de54fa..420a98aa3a9 100644 --- a/test/Validation.test.js +++ b/test/Validation.test.js @@ -178,7 +178,7 @@ describe("Validation", () => { expect(msg).toMatchInlineSnapshot(` "Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema. - configuration.module.rules[0].oneOf[0] has an unknown property 'passer'. These properties are valid: - object { compiler?, enforce?, exclude?, include?, issuer?, loader?, loaders?, oneOf?, options?, parser?, query?, resolve?, resource?, resourceQuery?, rules?, sideEffects?, test?, type?, use? } + object { compiler?, enforce?, exclude?, include?, issuer?, loader?, loaders?, oneOf?, options?, parser?, query?, realResource?, resolve?, resource?, resourceQuery?, rules?, sideEffects?, test?, type?, use? } -> A rule" `) );