@ohos-ports/rsbuild-core 1.1.14-beta.1

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 (244) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +28 -0
  3. package/bin/rsbuild.js +20 -0
  4. package/compiled/chokidar/index.d.ts +345 -0
  5. package/compiled/chokidar/index.js +1778 -0
  6. package/compiled/chokidar/license +21 -0
  7. package/compiled/chokidar/package.json +1 -0
  8. package/compiled/connect/index.d.ts +90 -0
  9. package/compiled/connect/index.js +1240 -0
  10. package/compiled/connect/license +25 -0
  11. package/compiled/connect/package.json +1 -0
  12. package/compiled/connect-history-api-fallback/index.d.ts +1 -0
  13. package/compiled/connect-history-api-fallback/index.js +149 -0
  14. package/compiled/connect-history-api-fallback/license +21 -0
  15. package/compiled/connect-history-api-fallback/package.json +1 -0
  16. package/compiled/cors/index.d.ts +1 -0
  17. package/compiled/cors/index.js +371 -0
  18. package/compiled/cors/license +22 -0
  19. package/compiled/cors/package.json +1 -0
  20. package/compiled/css-loader/api.js +85 -0
  21. package/compiled/css-loader/getUrl.js +26 -0
  22. package/compiled/css-loader/index.d.ts +1 -0
  23. package/compiled/css-loader/index.js +8008 -0
  24. package/compiled/css-loader/license +20 -0
  25. package/compiled/css-loader/noSourceMaps.js +5 -0
  26. package/compiled/css-loader/package.json +1 -0
  27. package/compiled/css-loader/sourceMaps.js +16 -0
  28. package/compiled/html-rspack-plugin/default_index.ejs +9 -0
  29. package/compiled/html-rspack-plugin/index.d.ts +289 -0
  30. package/compiled/html-rspack-plugin/index.js +1583 -0
  31. package/compiled/html-rspack-plugin/license +20 -0
  32. package/compiled/html-rspack-plugin/loader.js +162 -0
  33. package/compiled/html-rspack-plugin/package.json +1 -0
  34. package/compiled/http-proxy-middleware/index.d.ts +318 -0
  35. package/compiled/http-proxy-middleware/index.js +5280 -0
  36. package/compiled/http-proxy-middleware/license +22 -0
  37. package/compiled/http-proxy-middleware/package.json +1 -0
  38. package/compiled/jiti/index.d.ts +1 -0
  39. package/compiled/jiti/index.js +416 -0
  40. package/compiled/jiti/license +21 -0
  41. package/compiled/jiti/package.json +1 -0
  42. package/compiled/launch-editor-middleware/index.d.ts +1 -0
  43. package/compiled/launch-editor-middleware/index.js +694 -0
  44. package/compiled/launch-editor-middleware/license +21 -0
  45. package/compiled/launch-editor-middleware/package.json +1 -0
  46. package/compiled/mrmime/index.d.ts +4 -0
  47. package/compiled/mrmime/index.js +452 -0
  48. package/compiled/mrmime/package.json +1 -0
  49. package/compiled/on-finished/index.d.ts +13 -0
  50. package/compiled/on-finished/index.js +197 -0
  51. package/compiled/on-finished/license +23 -0
  52. package/compiled/on-finished/package.json +1 -0
  53. package/compiled/open/index.d.ts +153 -0
  54. package/compiled/open/index.js +409 -0
  55. package/compiled/open/package.json +1 -0
  56. package/compiled/open/xdg-open +1066 -0
  57. package/compiled/picocolors/index.d.ts +55 -0
  58. package/compiled/picocolors/index.js +108 -0
  59. package/compiled/picocolors/license +15 -0
  60. package/compiled/picocolors/package.json +1 -0
  61. package/compiled/postcss/index.d.ts +1 -0
  62. package/compiled/postcss/index.js +5997 -0
  63. package/compiled/postcss/license +20 -0
  64. package/compiled/postcss/package.json +1 -0
  65. package/compiled/postcss-load-config/index.d.ts +1 -0
  66. package/compiled/postcss-load-config/index.js +739 -0
  67. package/compiled/postcss-load-config/license +20 -0
  68. package/compiled/postcss-load-config/package.json +1 -0
  69. package/compiled/postcss-loader/index.d.ts +1 -0
  70. package/compiled/postcss-loader/index.js +741 -0
  71. package/compiled/postcss-loader/license +20 -0
  72. package/compiled/postcss-loader/package.json +1 -0
  73. package/compiled/rsbuild-dev-middleware/index.d.ts +1 -0
  74. package/compiled/rsbuild-dev-middleware/index.js +6158 -0
  75. package/compiled/rsbuild-dev-middleware/license +20 -0
  76. package/compiled/rsbuild-dev-middleware/package.json +1 -0
  77. package/compiled/rslog/index.d.ts +66 -0
  78. package/compiled/rslog/index.js +334 -0
  79. package/compiled/rslog/license +21 -0
  80. package/compiled/rslog/package.json +1 -0
  81. package/compiled/rspack-chain/index.d.ts +611 -0
  82. package/compiled/rspack-chain/index.js +1740 -0
  83. package/compiled/rspack-chain/license +373 -0
  84. package/compiled/rspack-chain/package.json +1 -0
  85. package/compiled/rspack-manifest-plugin/index.d.ts +44 -0
  86. package/compiled/rspack-manifest-plugin/index.js +394 -0
  87. package/compiled/rspack-manifest-plugin/license +21 -0
  88. package/compiled/rspack-manifest-plugin/package.json +1 -0
  89. package/compiled/sirv/index.d.ts +1 -0
  90. package/compiled/sirv/index.js +709 -0
  91. package/compiled/sirv/package.json +1 -0
  92. package/compiled/style-loader/index.d.ts +1 -0
  93. package/compiled/style-loader/index.js +427 -0
  94. package/compiled/style-loader/license +20 -0
  95. package/compiled/style-loader/package.json +1 -0
  96. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  97. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
  98. package/compiled/style-loader/runtime/insertBySelector.js +34 -0
  99. package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
  100. package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
  101. package/compiled/style-loader/runtime/isOldIE.js +17 -0
  102. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
  103. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
  104. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
  105. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
  106. package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
  107. package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
  108. package/compiled/tinyglobby/index.d.ts +25 -0
  109. package/compiled/tinyglobby/index.js +2749 -0
  110. package/compiled/tinyglobby/index1.js +17 -0
  111. package/compiled/tinyglobby/license +21 -0
  112. package/compiled/tinyglobby/package.json +1 -0
  113. package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
  114. package/compiled/webpack-bundle-analyzer/index.js +13480 -0
  115. package/compiled/webpack-bundle-analyzer/license +20 -0
  116. package/compiled/webpack-bundle-analyzer/package.json +1 -0
  117. package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
  118. package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
  119. package/compiled/webpack-merge/index.d.ts +31 -0
  120. package/compiled/webpack-merge/index.js +1200 -0
  121. package/compiled/webpack-merge/license +20 -0
  122. package/compiled/webpack-merge/package.json +1 -0
  123. package/compiled/ws/index.d.ts +401 -0
  124. package/compiled/ws/index.js +3153 -0
  125. package/compiled/ws/license +20 -0
  126. package/compiled/ws/package.json +1 -0
  127. package/dist/client/hmr.js +143 -0
  128. package/dist/client/overlay.js +210 -0
  129. package/dist/ignoreCssLoader.mjs +4 -0
  130. package/dist/index.cjs +7251 -0
  131. package/dist/index.js +7118 -0
  132. package/dist/transformLoader.mjs +22 -0
  133. package/dist/transformRawLoader.mjs +22 -0
  134. package/dist-types/cli/commands.d.ts +23 -0
  135. package/dist-types/cli/index.d.ts +1 -0
  136. package/dist-types/cli/init.d.ts +7 -0
  137. package/dist-types/cli/prepare.d.ts +1 -0
  138. package/dist-types/client/hmr.d.ts +1 -0
  139. package/dist-types/client/overlay.d.ts +1 -0
  140. package/dist-types/config.d.ts +90 -0
  141. package/dist-types/configChain.d.ts +139 -0
  142. package/dist-types/constants.d.ts +37 -0
  143. package/dist-types/createContext.d.ts +11 -0
  144. package/dist-types/createRsbuild.d.ts +2 -0
  145. package/dist-types/helpers/format.d.ts +5 -0
  146. package/dist-types/helpers/fs.d.ts +13 -0
  147. package/dist-types/helpers/index.d.ts +47 -0
  148. package/dist-types/helpers/path.d.ts +11 -0
  149. package/dist-types/helpers/stats.d.ts +9 -0
  150. package/dist-types/hooks.d.ts +48 -0
  151. package/dist-types/index.d.ts +26 -0
  152. package/dist-types/initPlugins.d.ts +6 -0
  153. package/dist-types/internal.d.ts +6 -0
  154. package/dist-types/loadEnv.d.ts +50 -0
  155. package/dist-types/loader/ignoreCssLoader.d.ts +2 -0
  156. package/dist-types/loader/transformLoader.d.ts +7 -0
  157. package/dist-types/loader/transformRawLoader.d.ts +3 -0
  158. package/dist-types/logger.d.ts +4 -0
  159. package/dist-types/mergeConfig.d.ts +2 -0
  160. package/dist-types/package.json +1 -0
  161. package/dist-types/pluginHelper.d.ts +12 -0
  162. package/dist-types/pluginManager.d.ts +9 -0
  163. package/dist-types/plugins/appIcon.d.ts +2 -0
  164. package/dist-types/plugins/asset.d.ts +3 -0
  165. package/dist-types/plugins/basic.d.ts +5 -0
  166. package/dist-types/plugins/bundleAnalyzer.d.ts +2 -0
  167. package/dist-types/plugins/cache.d.ts +2 -0
  168. package/dist-types/plugins/cleanOutput.d.ts +3 -0
  169. package/dist-types/plugins/css.d.ts +3 -0
  170. package/dist-types/plugins/define.d.ts +2 -0
  171. package/dist-types/plugins/entry.d.ts +2 -0
  172. package/dist-types/plugins/externals.d.ts +2 -0
  173. package/dist-types/plugins/fileSize.d.ts +4 -0
  174. package/dist-types/plugins/html.d.ts +9 -0
  175. package/dist-types/plugins/inlineChunk.d.ts +2 -0
  176. package/dist-types/plugins/lazyCompilation.d.ts +2 -0
  177. package/dist-types/plugins/manifest.d.ts +2 -0
  178. package/dist-types/plugins/minimize.d.ts +10 -0
  179. package/dist-types/plugins/moduleFederation.d.ts +2 -0
  180. package/dist-types/plugins/moment.d.ts +2 -0
  181. package/dist-types/plugins/nodeAddons.d.ts +2 -0
  182. package/dist-types/plugins/nonce.d.ts +2 -0
  183. package/dist-types/plugins/output.d.ts +2 -0
  184. package/dist-types/plugins/performance.d.ts +5 -0
  185. package/dist-types/plugins/progress.d.ts +2 -0
  186. package/dist-types/plugins/resolve.d.ts +2 -0
  187. package/dist-types/plugins/resourceHints.d.ts +2 -0
  188. package/dist-types/plugins/rsdoctor.d.ts +2 -0
  189. package/dist-types/plugins/rspackProfile.d.ts +2 -0
  190. package/dist-types/plugins/server.d.ts +2 -0
  191. package/dist-types/plugins/splitChunks.d.ts +4 -0
  192. package/dist-types/plugins/sri.d.ts +2 -0
  193. package/dist-types/plugins/swc.d.ts +7 -0
  194. package/dist-types/plugins/target.d.ts +2 -0
  195. package/dist-types/plugins/wasm.d.ts +2 -0
  196. package/dist-types/provider/build.d.ts +3 -0
  197. package/dist-types/provider/createCompiler.d.ts +27 -0
  198. package/dist-types/provider/helpers.d.ts +12 -0
  199. package/dist-types/provider/initConfigs.d.ts +10 -0
  200. package/dist-types/provider/inspectConfig.d.ts +6 -0
  201. package/dist-types/provider/provider.d.ts +2 -0
  202. package/dist-types/provider/rspackConfig.d.ts +8 -0
  203. package/dist-types/rspack/RsbuildHtmlPlugin.d.ts +37 -0
  204. package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +29 -0
  205. package/dist-types/rspack/preload/helpers/determineAsValue.d.ts +22 -0
  206. package/dist-types/rspack/preload/helpers/doesChunkBelongToHtml.d.ts +29 -0
  207. package/dist-types/rspack/preload/helpers/extractChunks.d.ts +28 -0
  208. package/dist-types/rspack/preload/helpers/index.d.ts +4 -0
  209. package/dist-types/rspack/preload/helpers/type.d.ts +13 -0
  210. package/dist-types/server/ansiHTML.d.ts +12 -0
  211. package/dist-types/server/cliShortcuts.d.ts +10 -0
  212. package/dist-types/server/compilerDevMiddleware.d.ts +31 -0
  213. package/dist-types/server/devMiddleware.d.ts +27 -0
  214. package/dist-types/server/devServer.d.ts +60 -0
  215. package/dist-types/server/environment.d.ts +8 -0
  216. package/dist-types/server/getDevMiddlewares.d.ts +25 -0
  217. package/dist-types/server/gzipMiddleware.d.ts +4 -0
  218. package/dist-types/server/helper.d.ts +71 -0
  219. package/dist-types/server/httpServer.d.ts +8 -0
  220. package/dist-types/server/middlewares.d.ts +34 -0
  221. package/dist-types/server/open.d.ts +10 -0
  222. package/dist-types/server/prodServer.d.ts +25 -0
  223. package/dist-types/server/proxy.d.ts +6 -0
  224. package/dist-types/server/restart.d.ts +14 -0
  225. package/dist-types/server/runner/asModule.d.ts +2 -0
  226. package/dist-types/server/runner/basic.d.ts +25 -0
  227. package/dist-types/server/runner/cjs.d.ts +10 -0
  228. package/dist-types/server/runner/esm.d.ts +6 -0
  229. package/dist-types/server/runner/index.d.ts +8 -0
  230. package/dist-types/server/runner/type.d.ts +36 -0
  231. package/dist-types/server/socketServer.d.ts +26 -0
  232. package/dist-types/server/watchFiles.d.ts +14 -0
  233. package/dist-types/types/config.d.ts +1309 -0
  234. package/dist-types/types/context.d.ts +52 -0
  235. package/dist-types/types/hooks.d.ts +146 -0
  236. package/dist-types/types/index.d.ts +8 -0
  237. package/dist-types/types/plugin.d.ts +329 -0
  238. package/dist-types/types/rsbuild.d.ts +156 -0
  239. package/dist-types/types/rspack.d.ts +16 -0
  240. package/dist-types/types/thirdParty.d.ts +176 -0
  241. package/dist-types/types/utils.d.ts +12 -0
  242. package/package.json +61 -0
  243. package/static/openChrome.applescript +95 -0
  244. package/types.d.ts +221 -0
@@ -0,0 +1,611 @@
1
+ import {
2
+ Configuration,
3
+ Compiler,
4
+ RuleSetRule,
5
+ ResolveOptions,
6
+ } from '@rspack/core';
7
+ import * as https from 'https';
8
+
9
+ export = Config;
10
+
11
+ // The compiler type of Rspack / webpack are mismatch,
12
+ // so we use a loose type here to allow using webpack plugins.
13
+ interface PluginInstance {
14
+ apply: (compiler: any) => void;
15
+ [index: string]: any;
16
+ }
17
+
18
+ declare namespace __Config {
19
+ class Chained<Parent> {
20
+ batch(handler: (chained: this) => void): this;
21
+ end(): Parent;
22
+ }
23
+ class TypedChainedMap<Parent, OptionsType> extends Chained<Parent> {
24
+ clear(): this;
25
+ delete(key: string): this;
26
+ has(key: string): boolean;
27
+ get<T extends keyof OptionsType>(key: T): OptionsType[T];
28
+ getOrCompute<T extends keyof OptionsType>(
29
+ key: T,
30
+ compute: () => OptionsType[T],
31
+ ): OptionsType[T];
32
+ set<T extends keyof OptionsType>(key: T, value: OptionsType[T]): this;
33
+ merge(obj: Partial<OptionsType>): this;
34
+ entries(): OptionsType;
35
+ values<T extends keyof OptionsType>(): [OptionsType[T]][];
36
+ when(
37
+ condition: boolean,
38
+ trueBrancher: (obj: this) => void,
39
+ falseBrancher?: (obj: this) => void,
40
+ ): this;
41
+ }
42
+
43
+ class ChainedMap<Parent> extends TypedChainedMap<Parent, any> {}
44
+ class TypedChainedSet<Parent, Value> extends Chained<Parent> {
45
+ add(value: Value): this;
46
+ prepend(value: Value): this;
47
+ clear(): this;
48
+ delete(key: string): this;
49
+ has(key: string): boolean;
50
+ merge(arr: Value[]): this;
51
+ values(): Value[];
52
+ when(
53
+ condition: boolean,
54
+ trueBrancher: (obj: this) => void,
55
+ falseBrancher?: (obj: this) => void,
56
+ ): this;
57
+ }
58
+
59
+ class ChainedSet<Parent> extends TypedChainedSet<Parent, any> {}
60
+ }
61
+
62
+ type RspackConfig = Required<Configuration>;
63
+ declare class Config extends __Config.ChainedMap<void> {
64
+ entryPoints: Config.TypedChainedMap<
65
+ Config,
66
+ { [key: string]: Config.EntryPoint }
67
+ >;
68
+ output: Config.Output;
69
+ module: Config.Module;
70
+ node: Config.ChainedMap<this> & ((value: boolean) => this);
71
+ optimization: Config.Optimization;
72
+ performance: Config.Performance & ((value: boolean) => this);
73
+ plugins: Config.Plugins<this, PluginInstance>;
74
+ resolve: Config.Resolve;
75
+ resolveLoader: Config.ResolveLoader;
76
+ devServer: Config.DevServer;
77
+
78
+ context(value: RspackConfig['context']): this;
79
+ mode(value: RspackConfig['mode']): this;
80
+ devtool(value: Config.DevTool): this;
81
+ target(value: RspackConfig['target']): this;
82
+ watch(value: RspackConfig['watch']): this;
83
+ watchOptions(value: RspackConfig['watchOptions']): this;
84
+ externals(value: RspackConfig['externals']): this;
85
+ externalsType(value: RspackConfig['externalsType']): this;
86
+ externalsPresets(value: RspackConfig['externalsPresets']): this;
87
+ stats(value: RspackConfig['stats']): this;
88
+ experiments(value: RspackConfig['experiments']): this;
89
+ amd(value: RspackConfig['amd']): this;
90
+ bail(value: RspackConfig['bail']): this;
91
+ // TODO: Rspack does not support cache yet
92
+ cache(value: any): this;
93
+ // cache(value: RspackConfig['cache']): this;
94
+ dependencies(value: RspackConfig['dependencies']): this;
95
+ ignoreWarnings(value: RspackConfig['ignoreWarnings']): this;
96
+ loader(value: RspackConfig['loader']): this;
97
+ parallelism(value: RspackConfig['parallelism']): this;
98
+ profile(value: RspackConfig['profile']): this;
99
+ recordsPath(value: RspackConfig['recordsPath']): this;
100
+ recordsInputPath(value: RspackConfig['recordsInputPath']): this;
101
+ recordsOutputPath(value: RspackConfig['recordsOutputPath']): this;
102
+ name(value: RspackConfig['name']): this;
103
+ infrastructureLogging(value: RspackConfig['infrastructureLogging']): this;
104
+ snapshot(value: RspackConfig['snapshot']): this;
105
+
106
+ entry(name: string): Config.EntryPoint;
107
+ plugin(name: string): Config.Plugin<this, PluginInstance>;
108
+
109
+ toConfig(): Configuration;
110
+ }
111
+
112
+ declare namespace Config {
113
+ class Chained<Parent> extends __Config.Chained<Parent> {}
114
+ class TypedChainedMap<Parent, OptionsType> extends __Config.TypedChainedMap<
115
+ Parent,
116
+ OptionsType
117
+ > {}
118
+ class ChainedMap<Parent> extends __Config.TypedChainedMap<Parent, any> {}
119
+ class TypedChainedSet<Parent, Value> extends __Config.TypedChainedSet<
120
+ Parent,
121
+ Value
122
+ > {}
123
+ class ChainedSet<Parent> extends __Config.TypedChainedSet<Parent, any> {}
124
+
125
+ class Plugins<
126
+ Parent,
127
+ PluginType extends PluginInstance,
128
+ > extends TypedChainedMap<
129
+ Parent,
130
+ { [key: string]: Plugin<Parent, PluginType> }
131
+ > {}
132
+
133
+ class Plugin<Parent, PluginType extends PluginInstance | ResolvePlugin>
134
+ extends ChainedMap<Parent>
135
+ implements Orderable
136
+ {
137
+ init<P extends PluginType | PluginClass<PluginType>>(
138
+ value: (
139
+ plugin: P,
140
+ args: P extends PluginClass<PluginType>
141
+ ? ConstructorParameters<P>
142
+ : any[],
143
+ ) => PluginType,
144
+ ): this;
145
+ use<P extends string | PluginType | PluginClass<PluginType>>(
146
+ plugin: P,
147
+ args?: P extends PluginClass<PluginType>
148
+ ? ConstructorParameters<P>
149
+ : any[],
150
+ ): this;
151
+ tap<P extends PluginClass<PluginType>>(
152
+ f: (args: ConstructorParameters<P>) => ConstructorParameters<P>,
153
+ ): this;
154
+
155
+ // Orderable
156
+ before(name: string): this;
157
+ after(name: string): this;
158
+ }
159
+
160
+ type RspackEntry = NonNullable<Configuration['entry']>;
161
+
162
+ type WepackEntryObject = Exclude<
163
+ RspackEntry,
164
+ string | string[] | Function
165
+ >[string];
166
+
167
+ class EntryPoint extends TypedChainedSet<Config, WepackEntryObject> {}
168
+
169
+ type RspackModule = Required<NonNullable<Configuration['module']>>;
170
+
171
+ class Module extends ChainedMap<Config> {
172
+ rules: TypedChainedMap<this, { [key: string]: Rule }>;
173
+ generator: ChainedMap<this>;
174
+ parser: ChainedMap<this>;
175
+ rule(name: string): Rule;
176
+ noParse(value: RspackModule['noParse']): this;
177
+ unsafeCache(value: RspackModule['unsafeCache']): this;
178
+ wrappedContextCritical(value: RspackModule['wrappedContextCritical']): this;
179
+ exprContextRegExp(value: RspackModule['exprContextRegExp']): this;
180
+ wrappedContextRecursive(
181
+ value: RspackModule['wrappedContextRecursive'],
182
+ ): this;
183
+ strictExportPresence(value: RspackModule['strictExportPresence']): this;
184
+ wrappedContextRegExp(value: RspackModule['wrappedContextRegExp']): this;
185
+ }
186
+
187
+ type RspackOutput = Required<NonNullable<Configuration['output']>>;
188
+
189
+ class Output extends ChainedMap<Config> {
190
+ auxiliaryComment(value: RspackOutput['auxiliaryComment']): this;
191
+ charset(value: RspackOutput['charset']): this;
192
+ chunkFilename(value: RspackOutput['chunkFilename']): this;
193
+ chunkLoadTimeout(value: RspackOutput['chunkLoadTimeout']): this;
194
+ chunkLoadingGlobal(value: RspackOutput['chunkLoadingGlobal']): this;
195
+ chunkLoading(value: RspackOutput['chunkLoading']): this;
196
+ chunkFormat(value: RspackOutput['chunkFormat']): this;
197
+ enabledChunkLoadingTypes(
198
+ value: RspackOutput['enabledChunkLoadingTypes'],
199
+ ): this;
200
+ crossOriginLoading(value: RspackOutput['crossOriginLoading']): this;
201
+ devtoolFallbackModuleFilenameTemplate(
202
+ value: RspackOutput['devtoolFallbackModuleFilenameTemplate'],
203
+ ): this;
204
+ devtoolModuleFilenameTemplate(
205
+ value: RspackOutput['devtoolModuleFilenameTemplate'],
206
+ ): this;
207
+ devtoolNamespace(value: RspackOutput['devtoolNamespace']): this;
208
+ filename(value: RspackOutput['filename']): this;
209
+ assetModuleFilename(value: RspackOutput['assetModuleFilename']): this;
210
+ globalObject(value: RspackOutput['globalObject']): this;
211
+ uniqueName(value: RspackOutput['uniqueName']): this;
212
+ hashDigest(value: RspackOutput['hashDigest']): this;
213
+ hashDigestLength(value: RspackOutput['hashDigestLength']): this;
214
+ hashFunction(value: RspackOutput['hashFunction']): this;
215
+ hashSalt(value: RspackOutput['hashSalt']): this;
216
+ hotUpdateChunkFilename(value: RspackOutput['hotUpdateChunkFilename']): this;
217
+ hotUpdateGlobal(value: RspackOutput['hotUpdateGlobal']): this;
218
+ hotUpdateMainFilename(value: RspackOutput['hotUpdateMainFilename']): this;
219
+ library(value: RspackOutput['library']): this;
220
+ libraryExport(value: RspackOutput['libraryExport']): this;
221
+ libraryTarget(value: RspackOutput['libraryTarget']): this;
222
+ importFunctionName(value: RspackOutput['importFunctionName']): this;
223
+ path(value: RspackOutput['path']): this;
224
+ pathinfo(value: RspackOutput['pathinfo']): this;
225
+ publicPath(value: RspackOutput['publicPath']): this;
226
+ scriptType(value: RspackOutput['scriptType']): this;
227
+ sourceMapFilename(value: RspackOutput['sourceMapFilename']): this;
228
+ sourcePrefix(value: RspackOutput['sourcePrefix']): this;
229
+ strictModuleErrorHandling(
230
+ value: RspackOutput['strictModuleErrorHandling'],
231
+ ): this;
232
+ strictModuleExceptionHandling(
233
+ value: RspackOutput['strictModuleExceptionHandling'],
234
+ ): this;
235
+ umdNamedDefine(value: RspackOutput['umdNamedDefine']): this;
236
+ workerChunkLoading(value: RspackOutput['workerChunkLoading']): this;
237
+ enabledLibraryTypes(value: RspackOutput['enabledLibraryTypes']): this;
238
+ environment(value: RspackOutput['environment']): this;
239
+ compareBeforeEmit(value: RspackOutput['compareBeforeEmit']): this;
240
+ wasmLoading(value: RspackOutput['wasmLoading']): this;
241
+ enabledWasmLoadingTypes(
242
+ value: RspackOutput['enabledWasmLoadingTypes'],
243
+ ): this;
244
+ iife(value: RspackOutput['iife']): this;
245
+ module(value: RspackOutput['module']): this;
246
+ clean(value: RspackOutput['clean']): this;
247
+ }
248
+
249
+ // await for @types/webpack-dev-server update do v4 to remove all any
250
+ class DevServer extends ChainedMap<Config> {
251
+ allowedHosts: TypedChainedSet<this, string>;
252
+ after(value: (app: any, server: any, compiler: Compiler) => void): this;
253
+ before(value: (app: any, server: any, compiler: Compiler) => void): this;
254
+ bonjour(value: boolean): this;
255
+ clientLogLevel(
256
+ value:
257
+ | 'silent'
258
+ | 'trace'
259
+ | 'debug'
260
+ | 'info'
261
+ | 'warn'
262
+ | 'error'
263
+ | 'none'
264
+ | 'warning',
265
+ ): this;
266
+ compress(value: boolean): this;
267
+ contentBase(value: boolean | string | string[]): this;
268
+ contentBasePublicPath(value: string): this;
269
+ disableHostCheck(value: boolean): this;
270
+ filename(value: string): this;
271
+ headers(value: { [header: string]: string }): this;
272
+ historyApiFallback(value: boolean | any): this;
273
+ host(value: string): this;
274
+ hot(value: boolean): this;
275
+ hotOnly(value: boolean): this;
276
+ http2(value: boolean): this;
277
+ https(value: boolean | https.ServerOptions): this;
278
+ index(value: string): this;
279
+ injectClient(value: boolean | ((compiler: Compiler) => boolean)): this;
280
+ injectHot(value: boolean | ((compiler: Compiler) => boolean)): this;
281
+ inline(value: boolean): this;
282
+ lazy(value: boolean): this;
283
+ liveReload(value: boolean): this;
284
+ mimeTypes(value: Object): this;
285
+ noInfo(value: boolean): this;
286
+ onListening(value: (server: any) => void): this;
287
+ open(value: boolean): this;
288
+ openPage(value: string | string[]): this;
289
+ overlay(value: boolean | { warnings?: boolean; errors?: boolean }): this;
290
+ pfx(value: string): this;
291
+ pfxPassphrase(value: string): this;
292
+ port(value: number): this;
293
+ progress(value: boolean): this;
294
+ proxy(value: any): this;
295
+ public(value: string): this;
296
+ publicPath(publicPath: string): this;
297
+ quiet(value: boolean): this;
298
+ serveIndex(value: boolean): this;
299
+ setup(value: (expressApp: any) => void): this;
300
+ socket(value: string): this;
301
+ sockHost(value: string): this;
302
+ sockPath(value: string): this;
303
+ sockPort(value: number): this;
304
+ staticOptions(value: any): this;
305
+ stats(value: Configuration['stats']): this;
306
+ stdin(value: boolean): this;
307
+ transportMode(
308
+ value:
309
+ | 'sockjs'
310
+ | 'ws'
311
+ | {
312
+ server: 'ws';
313
+ client: object;
314
+ }
315
+ | {
316
+ client: 'sockjs';
317
+ server: object;
318
+ }
319
+ | {
320
+ client: object;
321
+ server: object;
322
+ },
323
+ ): this;
324
+ useLocalIp(value: boolean): this;
325
+ watchContentBase(value: boolean): this;
326
+ watchOptions(value: Configuration['watchOptions']): this;
327
+ writeToDisk(value: boolean): this;
328
+ }
329
+
330
+ type RspackPerformance = Exclude<
331
+ Required<NonNullable<Configuration['performance']>>,
332
+ false
333
+ >;
334
+ class Performance extends ChainedMap<Config> {
335
+ hints(value: RspackPerformance['hints']): this;
336
+ maxEntrypointSize(value: RspackPerformance['maxEntrypointSize']): this;
337
+ maxAssetSize(value: RspackPerformance['maxAssetSize']): this;
338
+ assetFilter(value: RspackPerformance['assetFilter']): this;
339
+ }
340
+
341
+ type RspackResolve = Required<NonNullable<Configuration['resolve']>>;
342
+ type ResolvePlugin = Exclude<
343
+ NonNullable<ResolveOptions['plugins']>[number],
344
+ '...'
345
+ >;
346
+
347
+ class Resolve<T = Config> extends ChainedMap<T> {
348
+ alias: TypedChainedMap<this, { [key: string]: string | false | string[] }>;
349
+ aliasFields: TypedChainedSet<this, RspackResolve['aliasFields'][number]>;
350
+ conditionNames: TypedChainedSet<
351
+ this,
352
+ RspackResolve['conditionNames'][number]
353
+ >;
354
+ descriptionFiles: TypedChainedSet<
355
+ this,
356
+ RspackResolve['descriptionFiles'][number]
357
+ >;
358
+ extensions: TypedChainedSet<this, RspackResolve['extensions'][number]>;
359
+ extensionAlias: TypedChainedMap<this, RspackResolve['extensionAlias']>;
360
+ mainFields: TypedChainedSet<this, RspackResolve['mainFields'][number]>;
361
+ mainFiles: TypedChainedSet<this, RspackResolve['mainFiles'][number]>;
362
+ exportsFields: TypedChainedSet<
363
+ this,
364
+ RspackResolve['exportsFields'][number]
365
+ >;
366
+ importsFields: TypedChainedSet<
367
+ this,
368
+ RspackResolve['importsFields'][number]
369
+ >;
370
+ restrictions: TypedChainedSet<this, RspackResolve['restrictions'][number]>;
371
+ roots: TypedChainedSet<this, RspackResolve['roots'][number]>;
372
+ modules: TypedChainedSet<this, RspackResolve['modules'][number]>;
373
+ plugins: TypedChainedMap<
374
+ this,
375
+ { [key: string]: Plugin<Resolve, ResolvePlugin> }
376
+ >;
377
+ fallback: TypedChainedMap<
378
+ this,
379
+ { [key: string]: string | false | string[] }
380
+ >;
381
+ byDependency: TypedChainedMap<this, RspackResolve['byDependency']>;
382
+
383
+ cachePredicate(value: RspackResolve['cachePredicate']): this;
384
+ cacheWithContext(value: RspackResolve['cacheWithContext']): this;
385
+ enforceExtension(value: RspackResolve['enforceExtension']): this;
386
+ symlinks(value: RspackResolve['symlinks']): this;
387
+ unsafeCache(value: RspackResolve['unsafeCache']): this;
388
+ preferRelative(value: RspackResolve['preferRelative']): this;
389
+ preferAbsolute(value: RspackResolve['preferAbsolute']): this;
390
+
391
+ plugin(name: string): Plugin<this, ResolvePlugin>;
392
+ tsConfig(value: RspackResolve['tsConfig']): this;
393
+ }
394
+
395
+ class RuleResolve<T = Config> extends Resolve<T> {
396
+ fullySpecified(value: boolean): this;
397
+ }
398
+
399
+ class ResolveLoader extends Resolve {
400
+ modules: ChainedSet<this>;
401
+ moduleExtensions: ChainedSet<this>;
402
+ packageMains: ChainedSet<this>;
403
+ }
404
+
405
+ type RspackRuleSet = Required<RuleSetRule>;
406
+
407
+ class Rule<T = Module> extends ChainedMap<T> implements Orderable {
408
+ uses: TypedChainedMap<this, { [key: string]: Use }>;
409
+ include: TypedChainedSet<this, RspackRuleSet['include']>;
410
+ exclude: TypedChainedSet<this, RspackRuleSet['exclude']>;
411
+ rules: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
412
+ oneOfs: TypedChainedMap<this, { [key: string]: Rule<Rule> }>;
413
+ resolve: RuleResolve<Rule<T>>;
414
+
415
+ dependency(value: RspackRuleSet['dependency']): this;
416
+ enforce(value: RspackRuleSet['enforce']): this;
417
+ issuer(value: RspackRuleSet['issuer']): this;
418
+ issuerLayer(value: RspackRuleSet['issuerLayer']): this;
419
+ layer(value: RspackRuleSet['layer']): this;
420
+ mimetype(value: RspackRuleSet['mimetype']): this;
421
+ parser(value: RspackRuleSet['parser']): this;
422
+ generator(value: RspackRuleSet['generator']): this;
423
+ resource(value: RspackRuleSet['resource']): this;
424
+ resourceFragment(value: RspackRuleSet['resourceFragment']): this;
425
+ resourceQuery(value: RspackRuleSet['resourceQuery']): this;
426
+ sideEffects(value: RspackRuleSet['sideEffects']): this;
427
+ with(value: RspackRuleSet['with']): this;
428
+ test(value: RspackRuleSet['test']): this;
429
+ type(value: RspackRuleSet['type']): this;
430
+
431
+ use(name: string): Use<this>;
432
+ rule(name: string): Rule<Rule>;
433
+ oneOf(name: string): Rule<Rule>;
434
+ pre(): this;
435
+ post(): this;
436
+ before(name: string): this;
437
+ after(name: string): this;
438
+ }
439
+
440
+ type RspackOptimization = Required<
441
+ NonNullable<Configuration['optimization']>
442
+ >;
443
+ type SplitChunksObject = Exclude<RspackOptimization['splitChunks'], false>;
444
+ class Optimization extends ChainedMap<Config> {
445
+ minimizer(name: string): Config.Plugin<this, PluginInstance>;
446
+ minimizers: TypedChainedMap<this, Config.Plugin<this, PluginInstance>>;
447
+ splitChunks: TypedChainedMap<this, SplitChunksObject> &
448
+ ((value: SplitChunksObject | false) => this);
449
+
450
+ minimize(value: RspackOptimization['minimize']): this;
451
+ runtimeChunk(value: RspackOptimization['runtimeChunk']): this;
452
+ emitOnErrors(value: RspackOptimization['emitOnErrors']): this;
453
+ moduleIds(value: RspackOptimization['moduleIds']): this;
454
+ chunkIds(value: RspackOptimization['chunkIds']): this;
455
+ nodeEnv(value: RspackOptimization['nodeEnv']): this;
456
+ mangleWasmImports(value: RspackOptimization['mangleWasmImports']): this;
457
+ removeAvailableModules(
458
+ value: RspackOptimization['removeAvailableModules'],
459
+ ): this;
460
+ removeEmptyChunks(value: RspackOptimization['removeEmptyChunks']): this;
461
+ mergeDuplicateChunks(
462
+ value: RspackOptimization['mergeDuplicateChunks'],
463
+ ): this;
464
+ flagIncludedChunks(value: RspackOptimization['flagIncludedChunks']): this;
465
+ providedExports(value: RspackOptimization['providedExports']): this;
466
+ usedExports(value: RspackOptimization['usedExports']): this;
467
+ concatenateModules(value: RspackOptimization['concatenateModules']): this;
468
+ sideEffects(value: RspackOptimization['sideEffects']): this;
469
+ portableRecords(value: RspackOptimization['portableRecords']): this;
470
+ mangleExports(value: RspackOptimization['mangleExports']): this;
471
+ innerGraph(value: RspackOptimization['innerGraph']): this;
472
+ realContentHash(value: RspackOptimization['realContentHash']): this;
473
+ }
474
+
475
+ interface RuntimeChunk {
476
+ name: string | RuntimeChunkFunction;
477
+ }
478
+
479
+ type RuntimeChunkFunction = (entryPoint: EntryPoint) => string;
480
+
481
+ interface SplitChunksOptions {
482
+ [name: string]: any;
483
+ }
484
+
485
+ interface LoaderOptions {
486
+ [name: string]: any;
487
+ }
488
+
489
+ class Use<Parent = Rule> extends ChainedMap<Parent> implements Orderable {
490
+ loader(value: string): this;
491
+ options(value: LoaderOptions): this;
492
+
493
+ tap(f: (options: LoaderOptions) => LoaderOptions): this;
494
+
495
+ // Orderable
496
+ before(name: string): this;
497
+ after(name: string): this;
498
+ }
499
+
500
+ type DevTool =
501
+ | 'eval'
502
+ | 'eval-cheap-source-map'
503
+ | 'eval-cheap-module-source-map'
504
+ | 'eval-source-map'
505
+ | 'cheap-source-map'
506
+ | 'cheap-module-source-map'
507
+ | 'source-map'
508
+ | 'inline-cheap-source-map'
509
+ | 'inline-cheap-module-source-map'
510
+ | 'inline-source-map'
511
+ | 'eval-nosources-cheap-source-map'
512
+ | 'eval-nosources-cheap-module-source-map'
513
+ | 'eval-nosources-source-map'
514
+ | 'inline-nosources-cheap-source-map'
515
+ | 'inline-nosources-cheap-module-source-map'
516
+ | 'inline-nosources-source-map'
517
+ | 'nosources-cheap-source-map'
518
+ | 'nosources-cheap-module-source-map'
519
+ | 'nosources-source-map'
520
+ | 'hidden-nosources-cheap-source-map'
521
+ | 'hidden-nosources-cheap-module-source-map'
522
+ | 'hidden-nosources-source-map'
523
+ | 'hidden-cheap-source-map'
524
+ | 'hidden-cheap-module-source-map'
525
+ | 'hidden-source-map'
526
+ | '@eval'
527
+ | '@eval-cheap-source-map'
528
+ | '@eval-cheap-module-source-map'
529
+ | '@eval-source-map'
530
+ | '@cheap-source-map'
531
+ | '@cheap-module-source-map'
532
+ | '@source-map'
533
+ | '@inline-cheap-source-map'
534
+ | '@inline-cheap-module-source-map'
535
+ | '@inline-source-map'
536
+ | '@eval-nosources-cheap-source-map'
537
+ | '@eval-nosources-cheap-module-source-map'
538
+ | '@eval-nosources-source-map'
539
+ | '@inline-nosources-cheap-source-map'
540
+ | '@inline-nosources-cheap-module-source-map'
541
+ | '@inline-nosources-source-map'
542
+ | '@nosources-cheap-source-map'
543
+ | '@nosources-cheap-module-source-map'
544
+ | '@nosources-source-map'
545
+ | '@hidden-nosources-cheap-source-map'
546
+ | '@hidden-nosources-cheap-module-source-map'
547
+ | '@hidden-nosources-source-map'
548
+ | '@hidden-cheap-source-map'
549
+ | '@hidden-cheap-module-source-map'
550
+ | '@hidden-source-map'
551
+ | '#eval'
552
+ | '#eval-cheap-source-map'
553
+ | '#eval-cheap-module-source-map'
554
+ | '#eval-source-map'
555
+ | '#cheap-source-map'
556
+ | '#cheap-module-source-map'
557
+ | '#source-map'
558
+ | '#inline-cheap-source-map'
559
+ | '#inline-cheap-module-source-map'
560
+ | '#inline-source-map'
561
+ | '#eval-nosources-cheap-source-map'
562
+ | '#eval-nosources-cheap-module-source-map'
563
+ | '#eval-nosources-source-map'
564
+ | '#inline-nosources-cheap-source-map'
565
+ | '#inline-nosources-cheap-module-source-map'
566
+ | '#inline-nosources-source-map'
567
+ | '#nosources-cheap-source-map'
568
+ | '#nosources-cheap-module-source-map'
569
+ | '#nosources-source-map'
570
+ | '#hidden-nosources-cheap-source-map'
571
+ | '#hidden-nosources-cheap-module-source-map'
572
+ | '#hidden-nosources-source-map'
573
+ | '#hidden-cheap-source-map'
574
+ | '#hidden-cheap-module-source-map'
575
+ | '#hidden-source-map'
576
+ | '#@eval'
577
+ | '#@eval-cheap-source-map'
578
+ | '#@eval-cheap-module-source-map'
579
+ | '#@eval-source-map'
580
+ | '#@cheap-source-map'
581
+ | '#@cheap-module-source-map'
582
+ | '#@source-map'
583
+ | '#@inline-cheap-source-map'
584
+ | '#@inline-cheap-module-source-map'
585
+ | '#@inline-source-map'
586
+ | '#@eval-nosources-cheap-source-map'
587
+ | '#@eval-nosources-cheap-module-source-map'
588
+ | '#@eval-nosources-source-map'
589
+ | '#@inline-nosources-cheap-source-map'
590
+ | '#@inline-nosources-cheap-module-source-map'
591
+ | '#@inline-nosources-source-map'
592
+ | '#@nosources-cheap-source-map'
593
+ | '#@nosources-cheap-module-source-map'
594
+ | '#@nosources-source-map'
595
+ | '#@hidden-nosources-cheap-source-map'
596
+ | '#@hidden-nosources-cheap-module-source-map'
597
+ | '#@hidden-nosources-source-map'
598
+ | '#@hidden-cheap-source-map'
599
+ | '#@hidden-cheap-module-source-map'
600
+ | '#@hidden-source-map'
601
+ | boolean;
602
+
603
+ interface PluginClass<PluginType extends PluginInstance | ResolvePlugin> {
604
+ new (...opts: any[]): PluginType;
605
+ }
606
+
607
+ interface Orderable {
608
+ before(name: string): this;
609
+ after(name: string): this;
610
+ }
611
+ }