@rsbuild/core 1.0.0-alpha.2 → 1.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/compiled/autoprefixer/index.d.ts +95 -0
  2. package/compiled/autoprefixer/index.js +10217 -0
  3. package/compiled/autoprefixer/license +20 -0
  4. package/compiled/autoprefixer/package.json +1 -0
  5. package/compiled/browserslist/index.d.ts +201 -0
  6. package/compiled/browserslist/index.js +2017 -0
  7. package/compiled/browserslist/license +20 -0
  8. package/compiled/browserslist/package.json +1 -0
  9. package/compiled/chokidar/index.d.ts +198 -0
  10. package/compiled/chokidar/index.js +6692 -0
  11. package/compiled/chokidar/license +21 -0
  12. package/compiled/chokidar/package.json +1 -0
  13. package/compiled/gzip-size/index.d.ts +1 -0
  14. package/compiled/gzip-size/index.js +242 -0
  15. package/compiled/gzip-size/package.json +1 -0
  16. package/compiled/http-proxy-middleware/index.d.ts +315 -0
  17. package/compiled/http-proxy-middleware/index.js +7503 -0
  18. package/compiled/http-proxy-middleware/license +22 -0
  19. package/compiled/http-proxy-middleware/package.json +1 -0
  20. package/compiled/launch-editor-middleware/index.js +9 -9
  21. package/compiled/rspack-chain/index.d.ts +600 -0
  22. package/compiled/rspack-chain/index.js +2192 -0
  23. package/compiled/rspack-chain/license +373 -0
  24. package/compiled/rspack-chain/package.json +1 -0
  25. package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
  26. package/compiled/webpack-bundle-analyzer/index.js +14968 -0
  27. package/compiled/webpack-bundle-analyzer/license +20 -0
  28. package/compiled/webpack-bundle-analyzer/package.json +1 -0
  29. package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
  30. package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
  31. package/compiled/webpack-merge/index.d.ts +31 -0
  32. package/compiled/webpack-merge/index.js +1239 -0
  33. package/compiled/webpack-merge/license +20 -0
  34. package/compiled/webpack-merge/package.json +1 -0
  35. package/dist/index.cjs +882 -2519
  36. package/dist/index.js +966 -2647
  37. package/dist-types/cli/commands.d.ts +1 -1
  38. package/dist-types/config.d.ts +1 -1
  39. package/dist-types/configChain.d.ts +158 -2
  40. package/dist-types/constants.d.ts +1 -0
  41. package/dist-types/createContext.d.ts +1 -2
  42. package/dist-types/helpers.d.ts +7 -4
  43. package/dist-types/index.d.ts +2 -2
  44. package/dist-types/initHooks.d.ts +1 -1
  45. package/dist-types/initPlugins.d.ts +1 -2
  46. package/dist-types/internal.d.ts +1 -1
  47. package/dist-types/loader/transformLoader.d.ts +1 -1
  48. package/dist-types/mergeConfig.d.ts +1 -1
  49. package/dist-types/pluginManager.d.ts +1 -1
  50. package/dist-types/plugins/css.d.ts +1 -2
  51. package/dist-types/plugins/html.d.ts +1 -2
  52. package/dist-types/plugins/minimize.d.ts +1 -2
  53. package/dist-types/provider/build.d.ts +1 -1
  54. package/dist-types/provider/createCompiler.d.ts +1 -2
  55. package/dist-types/provider/initConfigs.d.ts +1 -2
  56. package/dist-types/provider/inspectConfig.d.ts +1 -1
  57. package/dist-types/provider/rspackConfig.d.ts +2 -2
  58. package/dist-types/rspack/HtmlBasicPlugin.d.ts +1 -1
  59. package/dist-types/rspack/InlineChunkHtmlPlugin.d.ts +1 -1
  60. package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +1 -1
  61. package/dist-types/rspack/preload/helpers/doesChunkBelongToHtml.d.ts +1 -1
  62. package/dist-types/rspack/preload/helpers/extractChunks.d.ts +1 -1
  63. package/dist-types/server/compilerDevMiddleware.d.ts +1 -1
  64. package/dist-types/server/devMiddleware.d.ts +4 -1
  65. package/dist-types/server/devServer.d.ts +1 -2
  66. package/dist-types/server/environment.d.ts +1 -1
  67. package/dist-types/server/getDevMiddlewares.d.ts +1 -1
  68. package/dist-types/server/helper.d.ts +1 -2
  69. package/dist-types/server/httpServer.d.ts +1 -1
  70. package/dist-types/server/middlewares.d.ts +1 -1
  71. package/dist-types/server/prodServer.d.ts +1 -2
  72. package/dist-types/server/proxy.d.ts +3 -3
  73. package/dist-types/server/socketServer.d.ts +1 -1
  74. package/dist-types/server/watchFiles.d.ts +1 -1
  75. package/dist-types/types/config/dev.d.ts +85 -0
  76. package/dist-types/types/config/html.d.ts +107 -0
  77. package/dist-types/types/config/index.d.ts +134 -0
  78. package/dist-types/types/config/output.d.ts +301 -0
  79. package/dist-types/types/config/performance.d.ts +122 -0
  80. package/dist-types/types/config/security.d.ts +18 -0
  81. package/dist-types/types/config/server.d.ts +106 -0
  82. package/dist-types/types/config/source.d.ts +79 -0
  83. package/dist-types/types/config/tools.d.ts +86 -0
  84. package/dist-types/types/context.d.ts +38 -0
  85. package/dist-types/types/hooks.d.ts +125 -0
  86. package/dist-types/types/index.d.ts +9 -0
  87. package/dist-types/types/plugin.d.ts +194 -0
  88. package/dist-types/{types.d.ts → types/rsbuild.d.ts} +56 -33
  89. package/dist-types/types/rspack.d.ts +28 -0
  90. package/dist-types/types/stats.d.ts +17 -0
  91. package/dist-types/types/thirdParty.d.ts +169 -0
  92. package/dist-types/types/utils.d.ts +14 -0
  93. package/package.json +18 -3
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Steven Chim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1 @@
1
+ {"name":"http-proxy-middleware","author":"Steven Chim","version":"2.0.6","license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -355,7 +355,7 @@ module.exports = function guessEditor (specifiedEditor) {
355
355
  const fs = __nccwpck_require__(147)
356
356
  const os = __nccwpck_require__(37)
357
357
  const path = __nccwpck_require__(17)
358
- const colors = __nccwpck_require__(802)
358
+ const colors = __nccwpck_require__(146)
359
359
  const childProcess = __nccwpck_require__(81)
360
360
 
361
361
  const guessEditor = __nccwpck_require__(641)
@@ -786,14 +786,6 @@ module.exports = function quote(xs) {
786
786
  };
787
787
 
788
788
 
789
- /***/ }),
790
-
791
- /***/ 802:
792
- /***/ ((module) => {
793
-
794
- "use strict";
795
- module.exports = require("@rsbuild/shared/picocolors");
796
-
797
789
  /***/ }),
798
790
 
799
791
  /***/ 81:
@@ -828,6 +820,14 @@ module.exports = require("path");
828
820
 
829
821
  /***/ }),
830
822
 
823
+ /***/ 146:
824
+ /***/ ((module) => {
825
+
826
+ "use strict";
827
+ module.exports = require("picocolors");
828
+
829
+ /***/ }),
830
+
831
831
  /***/ 310:
832
832
  /***/ ((module) => {
833
833
 
@@ -0,0 +1,600 @@
1
+ import { Configuration, Compiler, ResolveOptions, RuleSetRule } from '@rspack/core';
2
+ import * as https from 'https';
3
+
4
+ // The compiler type of Rspack / webpack are mismatch,
5
+ // so we use a loose type here to allow using webpack plugins.
6
+ interface PluginInstance {
7
+ apply: (compiler: any) => void;
8
+ [index: string]: any;
9
+ }
10
+
11
+ declare namespace __Config {
12
+ class Chained<Parent> {
13
+ batch(handler: (chained: this) => void): this;
14
+ end(): Parent;
15
+ }
16
+ class TypedChainedMap<Parent, OptionsType> extends Chained<Parent> {
17
+ clear(): this;
18
+ delete(key: string): this;
19
+ has(key: string): boolean;
20
+ get<T extends keyof OptionsType>(key: T): OptionsType[T];
21
+ getOrCompute<T extends keyof OptionsType>(
22
+ key: T,
23
+ compute: () => OptionsType[T],
24
+ ): OptionsType[T];
25
+ set<T extends keyof OptionsType>(key: T, value: OptionsType[T]): this;
26
+ merge(obj: Partial<OptionsType>): this;
27
+ entries(): OptionsType;
28
+ values<T extends keyof OptionsType>(): [OptionsType[T]][];
29
+ when(
30
+ condition: boolean,
31
+ trueBrancher: (obj: this) => void,
32
+ falseBrancher?: (obj: this) => void,
33
+ ): this;
34
+ }
35
+
36
+ class ChainedMap<Parent> extends TypedChainedMap<Parent, any> {}
37
+ class TypedChainedSet<Parent, Value> extends Chained<Parent> {
38
+ add(value: Value): this;
39
+ prepend(value: Value): this;
40
+ clear(): this;
41
+ delete(key: string): this;
42
+ has(key: string): boolean;
43
+ merge(arr: Value[]): this;
44
+ values(): Value[];
45
+ when(
46
+ condition: boolean,
47
+ trueBrancher: (obj: this) => void,
48
+ falseBrancher?: (obj: this) => void,
49
+ ): this;
50
+ }
51
+
52
+ class ChainedSet<Parent> extends TypedChainedSet<Parent, any> {}
53
+ }
54
+
55
+ type RspackConfig = Required<Configuration>;
56
+ declare class Config extends __Config.ChainedMap<void> {
57
+ entryPoints: Config.TypedChainedMap<
58
+ Config,
59
+ { [key: string]: Config.EntryPoint }
60
+ >;
61
+ output: Config.Output;
62
+ module: Config.Module;
63
+ node: Config.ChainedMap<this> & ((value: boolean) => this);
64
+ optimization: Config.Optimization;
65
+ performance: Config.Performance & ((value: boolean) => this);
66
+ plugins: Config.Plugins<this, PluginInstance>;
67
+ resolve: Config.Resolve;
68
+ resolveLoader: Config.ResolveLoader;
69
+ devServer: Config.DevServer;
70
+
71
+ context(value: RspackConfig['context']): this;
72
+ mode(value: RspackConfig['mode']): this;
73
+ devtool(value: Config.DevTool): this;
74
+ target(value: RspackConfig['target']): this;
75
+ watch(value: RspackConfig['watch']): this;
76
+ watchOptions(value: RspackConfig['watchOptions']): this;
77
+ externals(value: RspackConfig['externals']): this;
78
+ externalsType(value: RspackConfig['externalsType']): this;
79
+ externalsPresets(value: RspackConfig['externalsPresets']): this;
80
+ stats(value: RspackConfig['stats']): this;
81
+ experiments(value: RspackConfig['experiments']): this;
82
+ amd(value: RspackConfig['amd']): this;
83
+ bail(value: RspackConfig['bail']): this;
84
+ // TODO: Rspack does not support cache yet
85
+ cache(value: any): this;
86
+ // cache(value: RspackConfig['cache']): this;
87
+ dependencies(value: RspackConfig['dependencies']): this;
88
+ ignoreWarnings(value: RspackConfig['ignoreWarnings']): this;
89
+ loader(value: RspackConfig['loader']): this;
90
+ parallelism(value: RspackConfig['parallelism']): this;
91
+ profile(value: RspackConfig['profile']): this;
92
+ recordsPath(value: RspackConfig['recordsPath']): this;
93
+ recordsInputPath(value: RspackConfig['recordsInputPath']): this;
94
+ recordsOutputPath(value: RspackConfig['recordsOutputPath']): this;
95
+ name(value: RspackConfig['name']): this;
96
+ infrastructureLogging(value: RspackConfig['infrastructureLogging']): this;
97
+ snapshot(value: RspackConfig['snapshot']): this;
98
+
99
+ entry(name: string): Config.EntryPoint;
100
+ plugin(name: string): Config.Plugin<this, PluginInstance>;
101
+
102
+ toConfig(): Configuration;
103
+ }
104
+
105
+ declare namespace Config {
106
+ class Chained<Parent> extends __Config.Chained<Parent> {}
107
+ class TypedChainedMap<Parent, OptionsType> extends __Config.TypedChainedMap<
108
+ Parent,
109
+ OptionsType
110
+ > {}
111
+ class ChainedMap<Parent> extends __Config.TypedChainedMap<Parent, any> {}
112
+ class TypedChainedSet<Parent, Value> extends __Config.TypedChainedSet<
113
+ Parent,
114
+ Value
115
+ > {}
116
+ class ChainedSet<Parent> extends __Config.TypedChainedSet<Parent, any> {}
117
+
118
+ class Plugins<
119
+ Parent,
120
+ PluginType extends PluginInstance,
121
+ > extends TypedChainedMap<
122
+ Parent,
123
+ { [key: string]: Plugin<Parent, PluginType> }
124
+ > {}
125
+
126
+ class Plugin<Parent, PluginType extends PluginInstance | ResolvePlugin>
127
+ extends ChainedMap<Parent>
128
+ implements Orderable
129
+ {
130
+ init<P extends PluginType | PluginClass<PluginType>>(
131
+ value: (
132
+ plugin: P,
133
+ args: P extends PluginClass<PluginType>
134
+ ? ConstructorParameters<P>
135
+ : any[],
136
+ ) => PluginType,
137
+ ): this;
138
+ use<P extends string | PluginType | PluginClass<PluginType>>(
139
+ plugin: P,
140
+ args?: P extends PluginClass<PluginType>
141
+ ? ConstructorParameters<P>
142
+ : any[],
143
+ ): this;
144
+ tap<P extends PluginClass<PluginType>>(
145
+ f: (args: ConstructorParameters<P>) => ConstructorParameters<P>,
146
+ ): this;
147
+
148
+ // Orderable
149
+ before(name: string): this;
150
+ after(name: string): this;
151
+ }
152
+
153
+ type RspackEntry = NonNullable<Configuration['entry']>;
154
+
155
+ type WepackEntryObject = Exclude<
156
+ RspackEntry,
157
+ string | string[] | Function
158
+ >[string];
159
+
160
+ class EntryPoint extends TypedChainedSet<Config, WepackEntryObject> {}
161
+
162
+ type RspackModule = Required<NonNullable<Configuration['module']>>;
163
+
164
+ class Module extends ChainedMap<Config> {
165
+ rules: TypedChainedMap<this, { [key: string]: Rule }>;
166
+ generator: ChainedMap<this>;
167
+ parser: ChainedMap<this>;
168
+ rule(name: string): Rule;
169
+ noParse(value: RspackModule['noParse']): this;
170
+ unsafeCache(value: RspackModule['unsafeCache']): this;
171
+ wrappedContextCritical(value: RspackModule['wrappedContextCritical']): this;
172
+ exprContextRegExp(value: RspackModule['exprContextRegExp']): this;
173
+ wrappedContextRecursive(
174
+ value: RspackModule['wrappedContextRecursive'],
175
+ ): this;
176
+ strictExportPresence(value: RspackModule['strictExportPresence']): this;
177
+ wrappedContextRegExp(value: RspackModule['wrappedContextRegExp']): this;
178
+ }
179
+
180
+ type RspackOutput = Required<NonNullable<Configuration['output']>>;
181
+
182
+ class Output extends ChainedMap<Config> {
183
+ auxiliaryComment(value: RspackOutput['auxiliaryComment']): this;
184
+ charset(value: RspackOutput['charset']): this;
185
+ chunkFilename(value: RspackOutput['chunkFilename']): this;
186
+ chunkLoadTimeout(value: RspackOutput['chunkLoadTimeout']): this;
187
+ chunkLoadingGlobal(value: RspackOutput['chunkLoadingGlobal']): this;
188
+ chunkLoading(value: RspackOutput['chunkLoading']): this;
189
+ chunkFormat(value: RspackOutput['chunkFormat']): this;
190
+ enabledChunkLoadingTypes(
191
+ value: RspackOutput['enabledChunkLoadingTypes'],
192
+ ): this;
193
+ crossOriginLoading(value: RspackOutput['crossOriginLoading']): this;
194
+ devtoolFallbackModuleFilenameTemplate(
195
+ value: RspackOutput['devtoolFallbackModuleFilenameTemplate'],
196
+ ): this;
197
+ devtoolModuleFilenameTemplate(
198
+ value: RspackOutput['devtoolModuleFilenameTemplate'],
199
+ ): this;
200
+ devtoolNamespace(value: RspackOutput['devtoolNamespace']): this;
201
+ filename(value: RspackOutput['filename']): this;
202
+ assetModuleFilename(value: RspackOutput['assetModuleFilename']): this;
203
+ globalObject(value: RspackOutput['globalObject']): this;
204
+ uniqueName(value: RspackOutput['uniqueName']): this;
205
+ hashDigest(value: RspackOutput['hashDigest']): this;
206
+ hashDigestLength(value: RspackOutput['hashDigestLength']): this;
207
+ hashFunction(value: RspackOutput['hashFunction']): this;
208
+ hashSalt(value: RspackOutput['hashSalt']): this;
209
+ hotUpdateChunkFilename(value: RspackOutput['hotUpdateChunkFilename']): this;
210
+ hotUpdateGlobal(value: RspackOutput['hotUpdateGlobal']): this;
211
+ hotUpdateMainFilename(value: RspackOutput['hotUpdateMainFilename']): this;
212
+ library(value: RspackOutput['library']): this;
213
+ libraryExport(value: RspackOutput['libraryExport']): this;
214
+ libraryTarget(value: RspackOutput['libraryTarget']): this;
215
+ importFunctionName(value: RspackOutput['importFunctionName']): this;
216
+ path(value: RspackOutput['path']): this;
217
+ pathinfo(value: RspackOutput['pathinfo']): this;
218
+ publicPath(value: RspackOutput['publicPath']): this;
219
+ scriptType(value: RspackOutput['scriptType']): this;
220
+ sourceMapFilename(value: RspackOutput['sourceMapFilename']): this;
221
+ sourcePrefix(value: RspackOutput['sourcePrefix']): this;
222
+ strictModuleErrorHandling(
223
+ value: RspackOutput['strictModuleErrorHandling'],
224
+ ): this;
225
+ strictModuleExceptionHandling(
226
+ value: RspackOutput['strictModuleExceptionHandling'],
227
+ ): this;
228
+ umdNamedDefine(value: RspackOutput['umdNamedDefine']): this;
229
+ workerChunkLoading(value: RspackOutput['workerChunkLoading']): this;
230
+ enabledLibraryTypes(value: RspackOutput['enabledLibraryTypes']): this;
231
+ environment(value: RspackOutput['environment']): this;
232
+ compareBeforeEmit(value: RspackOutput['compareBeforeEmit']): this;
233
+ wasmLoading(value: RspackOutput['wasmLoading']): this;
234
+ enabledWasmLoadingTypes(
235
+ value: RspackOutput['enabledWasmLoadingTypes'],
236
+ ): this;
237
+ iife(value: RspackOutput['iife']): this;
238
+ module(value: RspackOutput['module']): this;
239
+ clean(value: RspackOutput['clean']): this;
240
+ }
241
+
242
+ // await for @types/webpack-dev-server update do v4 to remove all any
243
+ class DevServer extends ChainedMap<Config> {
244
+ allowedHosts: TypedChainedSet<this, string>;
245
+ after(value: (app: any, server: any, compiler: Compiler) => void): this;
246
+ before(value: (app: any, server: any, compiler: Compiler) => void): this;
247
+ bonjour(value: boolean): this;
248
+ clientLogLevel(
249
+ value:
250
+ | 'silent'
251
+ | 'trace'
252
+ | 'debug'
253
+ | 'info'
254
+ | 'warn'
255
+ | 'error'
256
+ | 'none'
257
+ | 'warning',
258
+ ): this;
259
+ compress(value: boolean): this;
260
+ contentBase(value: boolean | string | string[]): this;
261
+ contentBasePublicPath(value: string): this;
262
+ disableHostCheck(value: boolean): this;
263
+ filename(value: string): this;
264
+ headers(value: { [header: string]: string }): this;
265
+ historyApiFallback(value: boolean | any): this;
266
+ host(value: string): this;
267
+ hot(value: boolean): this;
268
+ hotOnly(value: boolean): this;
269
+ http2(value: boolean): this;
270
+ https(value: boolean | https.ServerOptions): this;
271
+ index(value: string): this;
272
+ injectClient(value: boolean | ((compiler: Compiler) => boolean)): this;
273
+ injectHot(value: boolean | ((compiler: Compiler) => boolean)): this;
274
+ inline(value: boolean): this;
275
+ lazy(value: boolean): this;
276
+ liveReload(value: boolean): this;
277
+ mimeTypes(value: Object): this;
278
+ noInfo(value: boolean): this;
279
+ onListening(value: (server: any) => void): this;
280
+ open(value: boolean): this;
281
+ openPage(value: string | string[]): this;
282
+ overlay(value: boolean | { warnings?: boolean; errors?: boolean }): this;
283
+ pfx(value: string): this;
284
+ pfxPassphrase(value: string): this;
285
+ port(value: number): this;
286
+ progress(value: boolean): this;
287
+ proxy(value: any): this;
288
+ public(value: string): this;
289
+ publicPath(publicPath: string): this;
290
+ quiet(value: boolean): this;
291
+ serveIndex(value: boolean): this;
292
+ setup(value: (expressApp: any) => void): this;
293
+ socket(value: string): this;
294
+ sockHost(value: string): this;
295
+ sockPath(value: string): this;
296
+ sockPort(value: number): this;
297
+ staticOptions(value: any): this;
298
+ stats(value: Configuration['stats']): this;
299
+ stdin(value: boolean): this;
300
+ transportMode(
301
+ value:
302
+ | 'sockjs'
303
+ | 'ws'
304
+ | {
305
+ server: 'ws';
306
+ client: object;
307
+ }
308
+ | {
309
+ client: 'sockjs';
310
+ server: object;
311
+ }
312
+ | {
313
+ client: object;
314
+ server: object;
315
+ },
316
+ ): this;
317
+ useLocalIp(value: boolean): this;
318
+ watchContentBase(value: boolean): this;
319
+ watchOptions(value: Configuration['watchOptions']): this;
320
+ writeToDisk(value: boolean): this;
321
+ }
322
+
323
+ type RspackPerformance = Exclude<
324
+ Required<NonNullable<Configuration['performance']>>,
325
+ false
326
+ >;
327
+ class Performance extends ChainedMap<Config> {
328
+ hints(value: RspackPerformance['hints']): this;
329
+ maxEntrypointSize(value: RspackPerformance['maxEntrypointSize']): this;
330
+ maxAssetSize(value: RspackPerformance['maxAssetSize']): this;
331
+ assetFilter(value: RspackPerformance['assetFilter']): this;
332
+ }
333
+
334
+ type RspackResolve = Required<NonNullable<Configuration['resolve']>>;
335
+ type ResolvePlugin = Exclude<
336
+ NonNullable<ResolveOptions['plugins']>[number],
337
+ '...'
338
+ >;
339
+
340
+ class Resolve<T = Config> extends ChainedMap<T> {
341
+ alias: TypedChainedMap<this, { [key: string]: string | false | string[] }>;
342
+ aliasFields: TypedChainedSet<this, RspackResolve['aliasFields'][number]>;
343
+ conditionNames: TypedChainedSet<
344
+ this,
345
+ RspackResolve['conditionNames'][number]
346
+ >;
347
+ descriptionFiles: TypedChainedSet<
348
+ this,
349
+ RspackResolve['descriptionFiles'][number]
350
+ >;
351
+ extensions: TypedChainedSet<this, RspackResolve['extensions'][number]>;
352
+ mainFields: TypedChainedSet<this, RspackResolve['mainFields'][number]>;
353
+ mainFiles: TypedChainedSet<this, RspackResolve['mainFiles'][number]>;
354
+ exportsFields: TypedChainedSet<
355
+ this,
356
+ RspackResolve['exportsFields'][number]
357
+ >;
358
+ importsFields: TypedChainedSet<
359
+ this,
360
+ RspackResolve['importsFields'][number]
361
+ >;
362
+ restrictions: TypedChainedSet<this, RspackResolve['restrictions'][number]>;
363
+ roots: TypedChainedSet<this, RspackResolve['roots'][number]>;
364
+ modules: TypedChainedSet<this, RspackResolve['modules'][number]>;
365
+ plugins: TypedChainedMap<
366
+ this,
367
+ { [key: string]: Plugin<Resolve, ResolvePlugin> }
368
+ >;
369
+ fallback: TypedChainedMap<
370
+ this,
371
+ { [key: string]: string | false | string[] }
372
+ >;
373
+ byDependency: TypedChainedMap<this, RspackResolve['byDependency']>;
374
+
375
+ cachePredicate(value: RspackResolve['cachePredicate']): this;
376
+ cacheWithContext(value: RspackResolve['cacheWithContext']): this;
377
+ enforceExtension(value: RspackResolve['enforceExtension']): this;
378
+ symlinks(value: RspackResolve['symlinks']): this;
379
+ unsafeCache(value: RspackResolve['unsafeCache']): this;
380
+ preferRelative(value: RspackResolve['preferRelative']): this;
381
+ preferAbsolute(value: RspackResolve['preferAbsolute']): this;
382
+
383
+ plugin(name: string): Plugin<this, ResolvePlugin>;
384
+ }
385
+
386
+ class RuleResolve<T = Config> extends Resolve<T> {
387
+ fullySpecified(value: boolean): this;
388
+ }
389
+
390
+ class ResolveLoader extends Resolve {
391
+ modules: ChainedSet<this>;
392
+ moduleExtensions: ChainedSet<this>;
393
+ packageMains: ChainedSet<this>;
394
+ }
395
+
396
+ type RspackRuleSet = Required<RuleSetRule>;
397
+
398
+ class Rule<T = Module> extends ChainedMap<T> implements Orderable {
399
+ uses: TypedChainedMap<this, { [key: string]: Use }>;
400
+ include: TypedChainedSet<this, RspackRuleSet['include']>;
401
+ exclude: TypedChainedSet<this, RspackRuleSet['exclude']>;
402
+ rules: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
403
+ oneOfs: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
404
+ resolve: RuleResolve<Rule<T>>;
405
+
406
+ enforce(value: RspackRuleSet['enforce']): this;
407
+ issuer(value: RspackRuleSet['issuer']): this;
408
+ issuerLayer(value: RspackRuleSet['issuerLayer']): this;
409
+ layer(value: RspackRuleSet['layer']): this;
410
+ mimetype(value: RspackRuleSet['mimetype']): this;
411
+ parser(value: RspackRuleSet['parser']): this;
412
+ generator(value: RspackRuleSet['generator']): this;
413
+ resource(value: RspackRuleSet['resource']): this;
414
+ resourceQuery(value: RspackRuleSet['resourceQuery']): this;
415
+ sideEffects(value: RspackRuleSet['sideEffects']): this;
416
+ test(value: RspackRuleSet['test']): this;
417
+ type(value: RspackRuleSet['type']): this;
418
+
419
+ use(name: string): Use<this>;
420
+ rule(name: string): Rule<Rule>;
421
+ oneOf(name: string): Rule<Rule>;
422
+ pre(): this;
423
+ post(): this;
424
+ before(name: string): this;
425
+ after(name: string): this;
426
+ }
427
+
428
+ type RspackOptimization = Required<
429
+ NonNullable<Configuration['optimization']>
430
+ >;
431
+ type SplitChunksObject = Exclude<RspackOptimization['splitChunks'], false>;
432
+ class Optimization extends ChainedMap<Config> {
433
+ minimizer(name: string): Config.Plugin<this, PluginInstance>;
434
+ splitChunks: TypedChainedMap<this, SplitChunksObject> &
435
+ ((value: SplitChunksObject | false) => this);
436
+
437
+ minimize(value: RspackOptimization['minimize']): this;
438
+ runtimeChunk(value: RspackOptimization['runtimeChunk']): this;
439
+ emitOnErrors(value: RspackOptimization['emitOnErrors']): this;
440
+ moduleIds(value: RspackOptimization['moduleIds']): this;
441
+ chunkIds(value: RspackOptimization['chunkIds']): this;
442
+ nodeEnv(value: RspackOptimization['nodeEnv']): this;
443
+ mangleWasmImports(value: RspackOptimization['mangleWasmImports']): this;
444
+ removeAvailableModules(
445
+ value: RspackOptimization['removeAvailableModules'],
446
+ ): this;
447
+ removeEmptyChunks(value: RspackOptimization['removeEmptyChunks']): this;
448
+ mergeDuplicateChunks(
449
+ value: RspackOptimization['mergeDuplicateChunks'],
450
+ ): this;
451
+ flagIncludedChunks(value: RspackOptimization['flagIncludedChunks']): this;
452
+ providedExports(value: RspackOptimization['providedExports']): this;
453
+ usedExports(value: RspackOptimization['usedExports']): this;
454
+ concatenateModules(value: RspackOptimization['concatenateModules']): this;
455
+ sideEffects(value: RspackOptimization['sideEffects']): this;
456
+ portableRecords(value: RspackOptimization['portableRecords']): this;
457
+ mangleExports(value: RspackOptimization['mangleExports']): this;
458
+ innerGraph(value: RspackOptimization['innerGraph']): this;
459
+ realContentHash(value: RspackOptimization['realContentHash']): this;
460
+ }
461
+
462
+ interface RuntimeChunk {
463
+ name: string | RuntimeChunkFunction;
464
+ }
465
+
466
+ type RuntimeChunkFunction = (entryPoint: EntryPoint) => string;
467
+
468
+ interface SplitChunksOptions {
469
+ [name: string]: any;
470
+ }
471
+
472
+ interface LoaderOptions {
473
+ [name: string]: any;
474
+ }
475
+
476
+ class Use<Parent = Rule> extends ChainedMap<Parent> implements Orderable {
477
+ loader(value: string): this;
478
+ options(value: LoaderOptions): this;
479
+
480
+ tap(f: (options: LoaderOptions) => LoaderOptions): this;
481
+
482
+ // Orderable
483
+ before(name: string): this;
484
+ after(name: string): this;
485
+ }
486
+
487
+ type DevTool =
488
+ | 'eval'
489
+ | 'eval-cheap-source-map'
490
+ | 'eval-cheap-module-source-map'
491
+ | 'eval-source-map'
492
+ | 'cheap-source-map'
493
+ | 'cheap-module-source-map'
494
+ | 'source-map'
495
+ | 'inline-cheap-source-map'
496
+ | 'inline-cheap-module-source-map'
497
+ | 'inline-source-map'
498
+ | 'eval-nosources-cheap-source-map'
499
+ | 'eval-nosources-cheap-module-source-map'
500
+ | 'eval-nosources-source-map'
501
+ | 'inline-nosources-cheap-source-map'
502
+ | 'inline-nosources-cheap-module-source-map'
503
+ | 'inline-nosources-source-map'
504
+ | 'nosources-cheap-source-map'
505
+ | 'nosources-cheap-module-source-map'
506
+ | 'nosources-source-map'
507
+ | 'hidden-nosources-cheap-source-map'
508
+ | 'hidden-nosources-cheap-module-source-map'
509
+ | 'hidden-nosources-source-map'
510
+ | 'hidden-cheap-source-map'
511
+ | 'hidden-cheap-module-source-map'
512
+ | 'hidden-source-map'
513
+ | '@eval'
514
+ | '@eval-cheap-source-map'
515
+ | '@eval-cheap-module-source-map'
516
+ | '@eval-source-map'
517
+ | '@cheap-source-map'
518
+ | '@cheap-module-source-map'
519
+ | '@source-map'
520
+ | '@inline-cheap-source-map'
521
+ | '@inline-cheap-module-source-map'
522
+ | '@inline-source-map'
523
+ | '@eval-nosources-cheap-source-map'
524
+ | '@eval-nosources-cheap-module-source-map'
525
+ | '@eval-nosources-source-map'
526
+ | '@inline-nosources-cheap-source-map'
527
+ | '@inline-nosources-cheap-module-source-map'
528
+ | '@inline-nosources-source-map'
529
+ | '@nosources-cheap-source-map'
530
+ | '@nosources-cheap-module-source-map'
531
+ | '@nosources-source-map'
532
+ | '@hidden-nosources-cheap-source-map'
533
+ | '@hidden-nosources-cheap-module-source-map'
534
+ | '@hidden-nosources-source-map'
535
+ | '@hidden-cheap-source-map'
536
+ | '@hidden-cheap-module-source-map'
537
+ | '@hidden-source-map'
538
+ | '#eval'
539
+ | '#eval-cheap-source-map'
540
+ | '#eval-cheap-module-source-map'
541
+ | '#eval-source-map'
542
+ | '#cheap-source-map'
543
+ | '#cheap-module-source-map'
544
+ | '#source-map'
545
+ | '#inline-cheap-source-map'
546
+ | '#inline-cheap-module-source-map'
547
+ | '#inline-source-map'
548
+ | '#eval-nosources-cheap-source-map'
549
+ | '#eval-nosources-cheap-module-source-map'
550
+ | '#eval-nosources-source-map'
551
+ | '#inline-nosources-cheap-source-map'
552
+ | '#inline-nosources-cheap-module-source-map'
553
+ | '#inline-nosources-source-map'
554
+ | '#nosources-cheap-source-map'
555
+ | '#nosources-cheap-module-source-map'
556
+ | '#nosources-source-map'
557
+ | '#hidden-nosources-cheap-source-map'
558
+ | '#hidden-nosources-cheap-module-source-map'
559
+ | '#hidden-nosources-source-map'
560
+ | '#hidden-cheap-source-map'
561
+ | '#hidden-cheap-module-source-map'
562
+ | '#hidden-source-map'
563
+ | '#@eval'
564
+ | '#@eval-cheap-source-map'
565
+ | '#@eval-cheap-module-source-map'
566
+ | '#@eval-source-map'
567
+ | '#@cheap-source-map'
568
+ | '#@cheap-module-source-map'
569
+ | '#@source-map'
570
+ | '#@inline-cheap-source-map'
571
+ | '#@inline-cheap-module-source-map'
572
+ | '#@inline-source-map'
573
+ | '#@eval-nosources-cheap-source-map'
574
+ | '#@eval-nosources-cheap-module-source-map'
575
+ | '#@eval-nosources-source-map'
576
+ | '#@inline-nosources-cheap-source-map'
577
+ | '#@inline-nosources-cheap-module-source-map'
578
+ | '#@inline-nosources-source-map'
579
+ | '#@nosources-cheap-source-map'
580
+ | '#@nosources-cheap-module-source-map'
581
+ | '#@nosources-source-map'
582
+ | '#@hidden-nosources-cheap-source-map'
583
+ | '#@hidden-nosources-cheap-module-source-map'
584
+ | '#@hidden-nosources-source-map'
585
+ | '#@hidden-cheap-source-map'
586
+ | '#@hidden-cheap-module-source-map'
587
+ | '#@hidden-source-map'
588
+ | boolean;
589
+
590
+ interface PluginClass<PluginType extends PluginInstance | ResolvePlugin> {
591
+ new (...opts: any[]): PluginType;
592
+ }
593
+
594
+ interface Orderable {
595
+ before(name: string): this;
596
+ after(name: string): this;
597
+ }
598
+ }
599
+
600
+ export { Config as default };