@@ -289,6 +289,10 @@ export type RuleSetConditionsAbsolute = RuleSetConditionAbsolute[];
289289 * A loader request.
290290 */
291291export type RuleSetLoader = string ;
292+ /**
293+ * Falsy value.
294+ */
295+ export type Falsy = false | 0 | "" | null ;
292296/**
293297 * Options passed to a loader.
294298 */
@@ -325,14 +329,14 @@ export type ResolveAlias =
325329 * A list of descriptions of loaders applied.
326330 */
327331export type RuleSetUse =
328- | RuleSetUseItem [ ]
332+ | ( Falsy | RuleSetUseItem ) [ ]
329333 | ( ( data : {
330334 resource : string ;
331335 realResource : string ;
332336 resourceQuery : string ;
333337 issuer : string ;
334338 compiler : string ;
335- } ) => RuleSetUseItem [ ] )
339+ } ) => ( Falsy | RuleSetUseItem ) [ ] )
336340 | RuleSetUseItem ;
337341/**
338342 * A description of an applied loader.
@@ -352,12 +356,12 @@ export type RuleSetUseItem =
352356 */
353357 options ?: RuleSetLoaderOptions ;
354358 }
355- | ( ( data : object ) => RuleSetUseItem | RuleSetUseItem [ ] )
359+ | ( ( data : object ) => RuleSetUseItem | ( Falsy | RuleSetUseItem ) [ ] )
356360 | RuleSetLoader ;
357361/**
358362 * A list of rules.
359363 */
360- export type RuleSetRules = ( "..." | RuleSetRule ) [ ] ;
364+ export type RuleSetRules = ( "..." | ( false | 0 | "" | null ) | RuleSetRule ) [ ] ;
361365/**
362366 * Specify options for each generator.
363367 */
@@ -596,7 +600,7 @@ export type Performance = false | PerformanceOptions;
596600/**
597601 * Add additional plugins to the compiler.
598602 */
599- export type Plugins = ( WebpackPluginInstance | WebpackPluginFunction ) [ ] ;
603+ export type Plugins = ( Falsy | WebpackPluginInstance | WebpackPluginFunction ) [ ] ;
600604/**
601605 * Capture timing information for each module.
602606 */
@@ -1392,7 +1396,7 @@ export interface RuleSetRule {
13921396 /**
13931397 * Only execute the first matching rule in this array.
13941398 */
1395- oneOf ?: RuleSetRule [ ] ;
1399+ oneOf ?: ( Falsy | RuleSetRule ) [ ] ;
13961400 /**
13971401 * Shortcut for use.options.
13981402 */
@@ -1695,7 +1699,7 @@ export interface Optimization {
16951699 /**
16961700 * Minimizer(s) to use for minimizing the output.
16971701 */
1698- minimizer ?: ( "..." | WebpackPluginInstance | WebpackPluginFunction ) [ ] ;
1702+ minimizer ?: ( "..." | Falsy | WebpackPluginInstance | WebpackPluginFunction ) [ ] ;
16991703 /**
17001704 * Define the algorithm to choose module ids (natural: numeric ids in order of usage, named: readable ids for better debugging, hashed: (deprecated) short hashes as ids for better long term caching, deterministic: numeric hash ids for better long term caching, size: numeric ids focused on minimal initial download size, false: no algorithm used, as custom one can be provided via plugin).
17011705 */
0 commit comments