diff --git a/types/index.d.ts b/types/index.d.ts index a0f7219..e887a67 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -206,8 +206,8 @@ declare namespace Config { packageMains: ChainedSet } - class Rule extends ChainedMap { - oneOfs: TypedChainedMap; + class Rule extends ChainedMap implements Orderable { + oneOfs: TypedChainedMap>; uses: TypedChainedMap; include: TypedChainedSet; exclude: TypedChainedSet; @@ -217,10 +217,13 @@ declare namespace Config { type(value: 'javascript/auto' | 'javascript/dynamic' | 'javascript/esm' | 'json' | 'webassembly/experimental'): this; enforce(value: 'pre' | 'post'): this; - use(name: string): Use; - oneOf(name: string): OneOf; + use(name: string): Use; + oneOf(name: string): Rule; pre(): this; post(): this; + before(name: string): this; + after(name: string): this; + resourceQuery(value: webpack.Condition | webpack.Condition[]): this; } class Optimization extends ChainedMap { @@ -265,15 +268,6 @@ declare namespace Config { after(name: string): this; } - class OneOf extends ChainedMap implements Orderable { - resourceQuery(value: webpack.Condition | webpack.Condition[]): this; - use(name: string): Use; - - // Orderable - before(name: string): this; - after(name: string): this; - } - type DevTool = 'eval' | 'inline-source-map' | 'cheap-eval-source-map' | 'cheap-source-map' | 'cheap-module-eval-source-map' | 'cheap-module-source-map' | 'eval-source-map' | 'source-map' | 'nosources-source-map' | 'hidden-source-map' | 'nosources-source-map' | '@eval' | diff --git a/types/test/webpack-chain-tests.ts b/types/test/webpack-chain-tests.ts index 38f25ba..74e8e01 100644 --- a/types/test/webpack-chain-tests.ts +++ b/types/test/webpack-chain-tests.ts @@ -295,6 +295,9 @@ config .post() .oneOf('inline') .after('vue') + .uses + .delete('babel') + .end() .resourceQuery(/inline/) .use('url') .loader('url-loader')