@ohos-ports/rspack-core 1.7.11-beta.1 → 2.2.9-beta.0

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 (317) hide show
  1. package/README.md +11 -1
  2. package/compiled/@rspack/lite-tapable/dist/index.d.ts +190 -0
  3. package/compiled/@rspack/lite-tapable/license +22 -0
  4. package/compiled/@rspack/lite-tapable/package.json +1 -0
  5. package/compiled/@swc/types/index.d.ts +161 -11
  6. package/compiled/@swc/types/package.json +1 -1
  7. package/compiled/connect-next/index.d.ts +57 -0
  8. package/compiled/connect-next/license +26 -0
  9. package/compiled/connect-next/package.json +1 -0
  10. package/compiled/http-proxy-middleware/index.d.ts +455 -0
  11. package/compiled/{browserslist-load-config → http-proxy-middleware}/license +3 -2
  12. package/compiled/http-proxy-middleware/package.json +1 -0
  13. package/compiled/open/index.d.ts +161 -0
  14. package/compiled/open/package.json +1 -0
  15. package/compiled/tinypool/README.md +196 -2
  16. package/compiled/tinypool/dist/{common-Qw-RoVFD.js → common-Bo3KCGim.js} +4 -1
  17. package/compiled/tinypool/dist/entry/worker.js +1 -1
  18. package/compiled/tinypool/dist/index.d.ts +9 -4
  19. package/compiled/tinypool/dist/index.js +17 -53
  20. package/compiled/tinypool/package.json +22 -6
  21. package/compiled/watchpack/index.d.ts +3 -217
  22. package/compiled/watchpack/index.js +1778 -1091
  23. package/compiled/watchpack/package.json +8 -1
  24. package/compiled/watchpack/types/DirectoryWatcher.d.ts +335 -0
  25. package/compiled/watchpack/types/LinkResolver.d.ts +10 -0
  26. package/compiled/watchpack/types/getWatcherManager.d.ts +62 -0
  27. package/compiled/watchpack/types/index.d.ts +269 -0
  28. package/compiled/watchpack/types/reducePlan.d.ts +34 -0
  29. package/compiled/watchpack/types/util/globToRegExp.d.ts +2 -0
  30. package/compiled/watchpack/types/watchEventSource.d.ts +53 -0
  31. package/compiled/watchpack/types/watchpack.d.ts +2 -0
  32. package/compiled/webpack-sources/index.d.ts +61 -0
  33. package/compiled/webpack-sources/index.js +2370 -576
  34. package/compiled/webpack-sources/package.json +8 -1
  35. package/compiled/webpack-sources/types/CachedSource.d.ts +192 -0
  36. package/compiled/webpack-sources/types/CompatSource.d.ts +87 -0
  37. package/compiled/webpack-sources/types/ConcatSource.d.ts +75 -0
  38. package/compiled/webpack-sources/types/OriginalSource.d.ts +87 -0
  39. package/compiled/webpack-sources/types/PrefixSource.d.ts +59 -0
  40. package/compiled/webpack-sources/types/RawSource.d.ts +75 -0
  41. package/compiled/webpack-sources/types/ReplaceSource.d.ts +107 -0
  42. package/compiled/webpack-sources/types/SizeOnlySource.d.ts +24 -0
  43. package/compiled/webpack-sources/types/Source.d.ts +189 -0
  44. package/compiled/webpack-sources/types/SourceMapSource.d.ts +136 -0
  45. package/compiled/webpack-sources/types/helpers/createMappingsSerializer.d.ts +60 -0
  46. package/compiled/webpack-sources/types/helpers/getFromStreamChunks.d.ts +16 -0
  47. package/compiled/webpack-sources/types/helpers/getGeneratedSourceInfo.d.ts +31 -0
  48. package/compiled/webpack-sources/types/helpers/getName.d.ts +15 -0
  49. package/compiled/webpack-sources/types/helpers/getSource.d.ts +15 -0
  50. package/compiled/webpack-sources/types/helpers/readMappings.d.ts +19 -0
  51. package/compiled/webpack-sources/types/helpers/scopes.d.ts +119 -0
  52. package/compiled/webpack-sources/types/helpers/splitIntoLines.d.ts +6 -0
  53. package/compiled/webpack-sources/types/helpers/splitIntoPotentialTokens.d.ts +37 -0
  54. package/compiled/webpack-sources/types/helpers/streamAndGetSourceAndMap.d.ts +39 -0
  55. package/compiled/webpack-sources/types/helpers/streamChunks.d.ts +56 -0
  56. package/compiled/webpack-sources/types/helpers/streamChunksOfCombinedSourceMap.d.ts +42 -0
  57. package/compiled/webpack-sources/types/helpers/streamChunksOfRawSource.d.ts +16 -0
  58. package/compiled/webpack-sources/types/helpers/streamChunksOfSourceMap.d.ts +19 -0
  59. package/compiled/webpack-sources/types/helpers/stringBufferUtils.d.ts +55 -0
  60. package/compiled/webpack-sources/types/index.d.ts +50 -0
  61. package/dist/BuildInfo.d.ts +3 -1
  62. package/dist/ChunkGraph.d.ts +1 -1
  63. package/dist/CodeGenerationResults.d.ts +6 -1
  64. package/dist/Compilation.d.ts +60 -89
  65. package/dist/Compiler.d.ts +25 -22
  66. package/dist/ContextModuleFactory.d.ts +2 -2
  67. package/dist/Diagnostics.d.ts +2 -6
  68. package/dist/ExecuteModulePlugin.d.ts +1 -1
  69. package/dist/ExportsInfo.d.ts +1 -1
  70. package/dist/ExternalModule.d.ts +15 -1
  71. package/dist/FileSystem.d.ts +4 -2
  72. package/dist/FileSystemDependencies.d.ts +15 -0
  73. package/dist/Module.d.ts +9 -6
  74. package/dist/ModuleGraph.d.ts +11 -8
  75. package/dist/ModuleGraphConnection.d.ts +10 -0
  76. package/dist/Modules.d.ts +3 -0
  77. package/dist/MultiCompiler.d.ts +9 -9
  78. package/dist/MultiStats.d.ts +3 -3
  79. package/dist/MultiWatching.d.ts +3 -3
  80. package/dist/NativeWatchFileSystem.d.ts +31 -2
  81. package/dist/NormalModule.d.ts +4 -5
  82. package/dist/NormalModuleFactory.d.ts +5 -4
  83. package/dist/Resolver.d.ts +10 -2
  84. package/dist/ResolverFactory.d.ts +2 -2
  85. package/dist/RuntimeGlobals.d.ts +61 -56
  86. package/dist/RuntimeModule.d.ts +3 -3
  87. package/dist/RuntimeTemplate.d.ts +151 -0
  88. package/dist/Stats.d.ts +4 -4
  89. package/dist/VirtualModulesPlugin.d.ts +1 -1
  90. package/dist/Watching.d.ts +5 -5
  91. package/dist/builtin-loader/lightningcss/index.d.ts +11 -14
  92. package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
  93. package/dist/builtin-loader/swc/index.d.ts +3 -5
  94. package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
  95. package/dist/builtin-loader/swc/types.d.ts +36 -65
  96. package/dist/builtin-plugin/APIPlugin.d.ts +3 -3
  97. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +3 -3
  98. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +3 -3
  99. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +3 -3
  100. package/dist/builtin-plugin/BannerPlugin.d.ts +3 -3
  101. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +3 -3
  102. package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +3 -3
  103. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +3 -3
  104. package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
  105. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +10 -4
  106. package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
  107. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +3 -3
  108. package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +12 -0
  109. package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +12 -0
  110. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +3 -3
  111. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +3 -3
  112. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +3 -3
  113. package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +9 -0
  114. package/dist/builtin-plugin/CssModulesPlugin.d.ts +3 -3
  115. package/dist/builtin-plugin/DataUriPlugin.d.ts +3 -3
  116. package/dist/builtin-plugin/DefinePlugin.d.ts +3 -3
  117. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
  118. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +13 -2
  119. package/dist/builtin-plugin/DllEntryPlugin.d.ts +3 -3
  120. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +3 -3
  121. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
  122. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +3 -3
  123. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +2 -2
  124. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +2 -2
  125. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
  126. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +3 -3
  127. package/dist/builtin-plugin/EntryPlugin.d.ts +4 -4
  128. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +7 -2
  129. package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
  130. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +3 -3
  131. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -3
  132. package/dist/builtin-plugin/ExternalsPlugin.d.ts +4 -3
  133. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +3 -3
  134. package/dist/builtin-plugin/FileUriPlugin.d.ts +3 -3
  135. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +3 -3
  136. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +3 -3
  137. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
  138. package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
  139. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +2 -2
  140. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +5 -5
  141. package/dist/builtin-plugin/HttpUriPlugin.d.ts +7 -3
  142. package/dist/builtin-plugin/IgnorePlugin.d.ts +3 -3
  143. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +3 -3
  144. package/dist/builtin-plugin/InlineExportsPlugin.d.ts +3 -3
  145. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +21 -6
  146. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +2 -2
  147. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +3 -3
  148. package/dist/builtin-plugin/LibManifestPlugin.d.ts +3 -3
  149. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +7 -11
  150. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +3 -3
  151. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
  152. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +3 -3
  153. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +3 -3
  154. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
  155. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +3 -3
  156. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +3 -3
  157. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +3 -3
  158. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
  159. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
  160. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +3 -3
  161. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +3 -3
  162. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +4 -4
  163. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +3 -3
  164. package/dist/builtin-plugin/ProgressPlugin.d.ts +8 -7
  165. package/dist/builtin-plugin/ProvidePlugin.d.ts +3 -3
  166. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +15 -4
  167. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +3 -3
  168. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +3 -3
  169. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -11
  170. package/dist/builtin-plugin/RslibPlugin.d.ts +5 -6
  171. package/dist/builtin-plugin/RstestPlugin.d.ts +3 -4
  172. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +3 -3
  173. package/dist/builtin-plugin/RuntimePlugin.d.ts +7 -11
  174. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
  175. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +5 -5
  176. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +3 -3
  177. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +6 -5
  178. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +2 -2
  179. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +7 -6
  180. package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
  181. package/dist/builtin-plugin/URLPlugin.d.ts +3 -3
  182. package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
  183. package/dist/builtin-plugin/base.d.ts +3 -3
  184. package/dist/builtin-plugin/css-extract/index.d.ts +3 -3
  185. package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
  186. package/dist/builtin-plugin/css-extract/utils.d.ts +8 -1
  187. package/dist/builtin-plugin/html-plugin/hooks.d.ts +3 -3
  188. package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
  189. package/dist/builtin-plugin/html-plugin/options.d.ts +2 -7
  190. package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -9
  191. package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
  192. package/dist/builtin-plugin/index.d.ts +92 -84
  193. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +6 -6
  194. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -4
  195. package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
  196. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
  197. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +47 -0
  198. package/dist/builtin-plugin/rsc/index.d.ts +24 -0
  199. package/dist/checkNodeVersion.d.ts +1 -0
  200. package/dist/config/adapter.d.ts +4 -4
  201. package/dist/config/adapterRuleUse.d.ts +89 -55
  202. package/dist/config/browserslistTargetHandler.d.ts +1 -1
  203. package/dist/config/defaults.d.ts +5 -3
  204. package/dist/config/devServer.d.ts +103 -238
  205. package/dist/config/index.d.ts +5 -5
  206. package/dist/config/normalization.d.ts +26 -47
  207. package/dist/config/target.d.ts +19 -12
  208. package/dist/config/types.d.ts +615 -256
  209. package/dist/container/ContainerPlugin.d.ts +4 -4
  210. package/dist/container/ContainerReferencePlugin.d.ts +4 -4
  211. package/dist/container/ModuleFederationManifestPlugin.d.ts +12 -5
  212. package/dist/container/ModuleFederationPlugin.d.ts +22 -5
  213. package/dist/container/ModuleFederationPluginV1.d.ts +10 -6
  214. package/dist/container/ModuleFederationRuntimePlugin.d.ts +3 -3
  215. package/dist/cssExtractHmr.js +2 -27
  216. package/dist/cssExtractLoader.js +24 -65
  217. package/dist/exports.d.ts +98 -84
  218. package/dist/index.d.ts +4 -3
  219. package/dist/index.js +14201 -11810
  220. package/dist/lib/AbstractMethodError.d.ts +1 -1
  221. package/dist/lib/Cache.d.ts +5 -2
  222. package/dist/lib/CacheFacade.d.ts +4 -4
  223. package/dist/lib/DllPlugin.d.ts +2 -2
  224. package/dist/lib/DllReferencePlugin.d.ts +3 -3
  225. package/dist/lib/EntryOptionPlugin.d.ts +2 -2
  226. package/dist/lib/EnvironmentPlugin.d.ts +3 -3
  227. package/dist/lib/HookWebpackError.d.ts +2 -3
  228. package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
  229. package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
  230. package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
  231. package/dist/lib/WebpackError.d.ts +2 -2
  232. package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
  233. package/dist/lib/cache/getLazyHashedEtag.d.ts +2 -2
  234. package/dist/lib/cache/mergeEtags.d.ts +1 -2
  235. package/dist/loader-runner/ModuleError.d.ts +1 -1
  236. package/dist/loader-runner/cache.d.ts +27 -0
  237. package/dist/loader-runner/dependencies.d.ts +23 -0
  238. package/dist/loader-runner/index.d.ts +10 -11
  239. package/dist/loader-runner/loadLoader.d.ts +2 -2
  240. package/dist/loader-runner/service.d.ts +10 -1
  241. package/dist/loader-runner/utils.d.ts +3 -3
  242. package/dist/loader-runner/worker.d.ts +1 -1
  243. package/dist/logging/createConsoleLogger.d.ts +2 -2
  244. package/dist/l~0.js +34 -0
  245. package/dist/l~3.js +34 -0
  246. package/dist/moduleFederationDefaultRuntime.js +1 -1
  247. package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
  248. package/dist/node/NodeTemplatePlugin.d.ts +1 -1
  249. package/dist/node/NodeWatchFileSystem.d.ts +15 -3
  250. package/dist/node/nodeConsole.d.ts +1 -1
  251. package/dist/rspack.d.ts +7 -8
  252. package/dist/rspackOptionsApply.d.ts +1 -1
  253. package/dist/runtime/cssExtractHmr.d.ts +2 -2
  254. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -2
  255. package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
  256. package/dist/sharing/ConsumeSharedPlugin.d.ts +18 -6
  257. package/dist/sharing/IndependentSharedPlugin.d.ts +37 -0
  258. package/dist/sharing/ProvideSharedPlugin.d.ts +22 -3
  259. package/dist/sharing/SharePlugin.d.ts +51 -3
  260. package/dist/sharing/ShareRuntimePlugin.d.ts +2 -2
  261. package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
  262. package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
  263. package/dist/sharing/TreeShakingSharedPlugin.d.ts +19 -0
  264. package/dist/sharing/utils.d.ts +1 -0
  265. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +1 -1
  266. package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
  267. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
  268. package/dist/stats/StatsFactory.d.ts +7 -5
  269. package/dist/stats/StatsPrinter.d.ts +7 -7
  270. package/dist/stats/statsFactoryUtils.d.ts +15 -19
  271. package/dist/swc.d.ts +2 -2
  272. package/dist/taps/compilation.d.ts +1 -1
  273. package/dist/taps/compiler.d.ts +1 -1
  274. package/dist/taps/contextModuleFactory.d.ts +1 -1
  275. package/dist/taps/externalModule.d.ts +2 -0
  276. package/dist/taps/index.d.ts +7 -6
  277. package/dist/taps/javascriptModules.d.ts +1 -1
  278. package/dist/taps/normalModuleFactory.d.ts +1 -1
  279. package/dist/taps/types.d.ts +2 -2
  280. package/dist/trace/index.d.ts +1 -0
  281. package/dist/trace/traceHookPlugin.d.ts +1 -1
  282. package/dist/util/bindingHelpers.d.ts +7 -0
  283. package/dist/util/comparators.d.ts +1 -1
  284. package/dist/util/createHash.d.ts +2 -2
  285. package/dist/util/fs.d.ts +19 -18
  286. package/dist/util/hash/md4.d.ts +1 -1
  287. package/dist/util/hash/xxhash64.d.ts +1 -1
  288. package/dist/util/identifier.d.ts +35 -9
  289. package/dist/util/index.d.ts +2 -2
  290. package/dist/util/source.d.ts +3 -3
  291. package/dist/util/supportsColor.d.ts +6 -0
  292. package/dist/util/targetsVersion.d.ts +2 -0
  293. package/dist/util/validateConfig.d.ts +1 -1
  294. package/dist/util/watchTimeInfo.d.ts +7 -0
  295. package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
  296. package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
  297. package/dist/worker.js +935 -907
  298. package/hot/dev-server.js +12 -11
  299. package/hot/emitter.js +3 -1
  300. package/hot/lazy-compilation-node.js +4 -1
  301. package/hot/lazy-compilation-web.js +2 -3
  302. package/hot/log-apply-result.js +8 -5
  303. package/hot/log.js +18 -10
  304. package/hot/only-dev-server.js +13 -12
  305. package/hot/poll.js +10 -9
  306. package/hot/signal.js +12 -10
  307. package/module.d.ts +39 -2
  308. package/package.json +15 -39
  309. package/compiled/browserslist-load-config/index.d.ts +0 -21
  310. package/compiled/browserslist-load-config/index.js +0 -252
  311. package/compiled/browserslist-load-config/package.json +0 -1
  312. package/compiled/webpack-sources/types.d.ts +0 -458
  313. package/dist/builtin-loader/index.d.ts +0 -1
  314. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +0 -7
  315. package/dist/container/index.d.ts +0 -4
  316. package/dist/util/MergeCaller.d.ts +0 -10
  317. package/dist/util/fake.d.ts +0 -14
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import WebpackError from './WebpackError';
10
+ import WebpackError from './WebpackError.js';
11
11
  /**
12
12
  * Error for abstract method
13
13
  * @example
@@ -7,14 +7,16 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '@rspack/lite-tapable';
11
- import type { WebpackError } from './WebpackError';
10
+ import type binding from '@rspack/binding';
11
+ import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist/index.js';
12
+ import type { WebpackError } from './WebpackError.js';
12
13
  export interface Etag {
13
14
  toString(): string;
14
15
  }
15
16
  export type CallbackCache<T> = (err?: WebpackError | null, result?: T) => void;
16
17
  type GotHandler<T = any> = (result: T | null, callback: (error: Error | null) => void) => void;
17
18
  export declare class Cache {
19
+ #private;
18
20
  static STAGE_DISK: number;
19
21
  static STAGE_MEMORY: number;
20
22
  static STAGE_DEFAULT: number;
@@ -28,6 +30,7 @@ export declare class Cache {
28
30
  shutdown: AsyncParallelHook<[]>;
29
31
  };
30
32
  constructor();
33
+ static __to_binding(cache: Cache): binding.JsCache;
31
34
  /**
32
35
  * @param identifier the cache identifier
33
36
  * @param etag the etag
@@ -7,9 +7,9 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Cache, CallbackCache, Etag } from './Cache';
11
- import type { HashableObject, HashConstructor } from './cache/getLazyHashedEtag';
12
- import type WebpackError from './WebpackError';
10
+ import type { Cache, CallbackCache, Etag } from './Cache.js';
11
+ import type { HashableObject, HashConstructor } from './cache/getLazyHashedEtag.js';
12
+ import type WebpackError from './WebpackError.js';
13
13
  type CallbackNormalErrorCache<T> = (err?: WebpackError | null, result?: T) => void;
14
14
  declare abstract class BaseCache {
15
15
  abstract get<T>(callback: CallbackCache<T>): void;
@@ -134,6 +134,6 @@ export declare class CacheFacade {
134
134
  * @param computer function to compute the value if not cached
135
135
  * @returns promise with the data
136
136
  */
137
- providePromise<T>(identifier: string, etag: Etag | null, computer: () => Promise<T> | T): Promise<{} | T | null>;
137
+ providePromise<T>(identifier: string, etag: Etag | null, computer: () => Promise<T> | T): Promise<T>;
138
138
  }
139
139
  export default CacheFacade;
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Compiler } from '../Compiler';
10
+ import type { Compiler } from '../Compiler.js';
11
11
  export type DllPluginOptions = {
12
12
  /**
13
13
  * Context of requests in the manifest file (defaults to the webpack context).
@@ -31,7 +31,7 @@ export type DllPluginOptions = {
31
31
  */
32
32
  path: string;
33
33
  /**
34
- * Type of the dll bundle (external type, use value of 'output.libraryTarget').
34
+ * Type of the dll bundle (external type, use value of 'output.library.type').
35
35
  */
36
36
  type?: string;
37
37
  };
@@ -8,7 +8,7 @@
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
10
  import type { JsBuildMeta } from '@rspack/binding';
11
- import type { Compiler } from '../Compiler';
11
+ import type { Compiler } from '../Compiler.js';
12
12
  export type DllReferencePluginOptions = {
13
13
  /**
14
14
  * Context of requests in the manifest (or content property) as absolute path.
@@ -31,7 +31,7 @@ export type DllReferencePluginOptions = {
31
31
  */
32
32
  scope?: string;
33
33
  /**
34
- * How the dll is exposed (libraryTarget, defaults to manifest.type).
34
+ * How the dll is exposed (library.type, defaults to manifest.type).
35
35
  */
36
36
  sourceType?: DllReferencePluginOptionsSourceType;
37
37
  /**
@@ -60,7 +60,7 @@ export type DllReferencePluginOptions = {
60
60
  */
61
61
  scope?: string;
62
62
  /**
63
- * How the dll is exposed (libraryTarget).
63
+ * How the dll is exposed (library.type).
64
64
  */
65
65
  sourceType?: DllReferencePluginOptionsSourceType;
66
66
  /**
@@ -7,8 +7,8 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Compiler, EntryDescriptionNormalized, EntryNormalized } from '..';
11
- import type { EntryOptions } from '../builtin-plugin';
10
+ import type { Compiler, EntryDescriptionNormalized, EntryNormalized } from '../index.js';
11
+ import type { EntryOptions } from '../builtin-plugin/index.js';
12
12
  export declare class EntryOptionPlugin {
13
13
  /**
14
14
  * @param compiler the compiler instance one is tapping into
@@ -7,11 +7,11 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Compiler } from '../Compiler';
10
+ import type { Compiler } from '../Compiler.js';
11
11
  declare class EnvironmentPlugin {
12
12
  keys: string[];
13
- defaultValues: Record<string, string | undefined | null>;
14
- constructor(...keys: string[] | [Record<string, string | undefined | null> | string | string[]]);
13
+ defaultValues: Record<string, any>;
14
+ constructor(...keys: string[] | [Record<string, any> | string | string[]]);
15
15
  /**
16
16
  * Apply the plugin
17
17
  * @param compiler the compiler instance
@@ -7,8 +7,8 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Callback } from '@rspack/lite-tapable';
11
- import WebpackError from './WebpackError';
10
+ import type { Callback } from '../../compiled/@rspack/lite-tapable/dist/index.js';
11
+ import WebpackError from './WebpackError.js';
12
12
  export declare class HookWebpackError extends WebpackError {
13
13
  hook: string;
14
14
  error: Error;
@@ -19,7 +19,6 @@ export declare class HookWebpackError extends WebpackError {
19
19
  */
20
20
  constructor(error: Error, hook: string);
21
21
  }
22
- export default HookWebpackError;
23
22
  /**
24
23
  * @param error an error
25
24
  * @param hook name of the hook
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Compiler, IgnoreWarningsNormalized, RspackPluginInstance } from '..';
10
+ import type { Compiler, IgnoreWarningsNormalized, RspackPluginInstance } from '../index.js';
11
11
  declare class IgnoreWarningsPlugin implements RspackPluginInstance {
12
12
  _ignorePattern: IgnoreWarningsNormalized;
13
13
  name: string;
@@ -7,8 +7,8 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Compiler } from '../Compiler';
11
- import type { MatchObject } from './ModuleFilenameHelpers';
10
+ import type { Compiler } from '../Compiler.js';
11
+ import type { MatchObject } from './ModuleFilenameHelpers.js';
12
12
  type LoaderOptionsPluginOptions = MatchObject & {
13
13
  [key: string]: unknown;
14
14
  };
@@ -7,8 +7,8 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Compiler } from '../Compiler';
11
- import type { Target } from '../config';
10
+ import type { Compiler } from '../Compiler.js';
11
+ import type { Target } from '../config/index.js';
12
12
  export declare class LoaderTargetPlugin {
13
13
  readonly target: Target;
14
14
  /**
@@ -8,8 +8,8 @@
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
10
  import type { DependencyLocation } from '@rspack/binding';
11
- import type { Chunk } from '../Chunk';
12
- import type { Module } from '../Module';
11
+ import type { Chunk } from '../Chunk.js';
12
+ import type { Module } from '../Module.js';
13
13
  export declare class WebpackError extends Error {
14
14
  loc?: DependencyLocation;
15
15
  file?: string;
@@ -1,4 +1,4 @@
1
- import type { Compiler } from '../../Compiler';
1
+ import type { Compiler } from '../../Compiler.js';
2
2
  export default class MemoryCachePlugin {
3
3
  static PLUGIN_NAME: string;
4
4
  apply(compiler: Compiler): void;
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type Hash from '../../util/hash';
10
+ import type Hash from '../../util/hash/index.js';
11
11
  export type HashConstructor = typeof Hash;
12
12
  export interface HashableObject {
13
13
  updateHash(hash: Hash): void;
@@ -32,4 +32,4 @@ declare class LazyHashedEtag {
32
32
  * @returns etag
33
33
  */
34
34
  export declare const getter: (obj: HashableObject, hashFunction?: string | HashConstructor) => LazyHashedEtag;
35
- export default getter;
35
+ export {};
@@ -7,11 +7,10 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Etag } from '../Cache';
10
+ import type { Etag } from '../Cache.js';
11
11
  /**
12
12
  * @param first first
13
13
  * @param second second
14
14
  * @returns result
15
15
  */
16
16
  export declare const mergeEtags: (first: Etag, second: Etag) => Etag;
17
- export default mergeEtags;
@@ -1,4 +1,4 @@
1
- import WebpackError from '../lib/WebpackError';
1
+ import WebpackError from '../lib/WebpackError.js';
2
2
  export declare class ModuleError extends WebpackError {
3
3
  error?: Error;
4
4
  constructor(err: Error, { from }?: {
@@ -0,0 +1,27 @@
1
+ import type { JsLoaderContext } from '@rspack/binding';
2
+ import { type LoaderDependencies, LoaderDependenciesState } from './dependencies.js';
3
+ type LoaderCacheContent = string | Uint8Array;
4
+ export type LoaderCacheEntry = {
5
+ content: LoaderCacheContent | null;
6
+ sourceMap?: Uint8Array;
7
+ addedDependencies: LoaderDependencies;
8
+ removedDependencies: LoaderDependencies;
9
+ parseMeta: Record<string, string>;
10
+ };
11
+ export type WorkerCacheResult = {
12
+ type: 'disabled';
13
+ } | {
14
+ type: 'miss';
15
+ } | {
16
+ type: 'hit';
17
+ entry: LoaderCacheEntry;
18
+ };
19
+ export declare class LoaderCache {
20
+ #private;
21
+ constructor(context: JsLoaderContext, dependencies: LoaderDependenciesState);
22
+ get(loaderIndex: number, content: LoaderCacheContent | null | undefined, additionalData: unknown): Promise<LoaderCacheEntry | null | undefined>;
23
+ store(loaderIndex: number, content: LoaderCacheContent | null | undefined, sourceMap: Uint8Array | undefined, additionalData: unknown): Promise<void>;
24
+ workerGet(loaderIndex: number, content: LoaderCacheContent | null | undefined, additionalData: unknown): Promise<WorkerCacheResult>;
25
+ workerStore(loaderIndex: number, content: LoaderCacheContent | null | undefined, sourceMap: Uint8Array | undefined, additionalData: unknown): Promise<void>;
26
+ }
27
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { JsLoaderContext } from '@rspack/binding';
2
+ export type LoaderDependencies = JsLoaderContext['dependencies'];
3
+ export declare class LoaderDependenciesState {
4
+ #private;
5
+ readonly existing: LoaderDependencies;
6
+ constructor(existing: LoaderDependencies);
7
+ get added(): LoaderDependencies;
8
+ get removed(): LoaderDependencies;
9
+ resetChanges(): void;
10
+ mergeChanges(): void;
11
+ addDependencies(dependencies: LoaderDependencies): void;
12
+ addFile(dependency: string): void;
13
+ addContext(dependency: string): void;
14
+ addMissing(dependency: string): void;
15
+ addBuild(dependency: string): void;
16
+ fileDependencies(): string[];
17
+ contextDependencies(): string[];
18
+ missingDependencies(): string[];
19
+ clearDependencies(): void;
20
+ private add;
21
+ private get;
22
+ private clear;
23
+ }
@@ -1,15 +1,18 @@
1
1
  import { type JsLoaderContext, type JsLoaderItem } from '@rspack/binding';
2
- import type { Compiler } from '../Compiler';
2
+ import type { Compiler } from '../Compiler.js';
3
+ type LoaderObjectOptions = string | (object & {
4
+ ident?: unknown;
5
+ }) | null;
3
6
  export declare class LoaderObject {
4
7
  request: string;
5
8
  path: string;
6
9
  query: string;
7
10
  fragment: string;
8
- options?: string | object;
9
- ident: string;
10
- normal?: Function;
11
- pitch?: Function;
12
- raw?: boolean;
11
+ options?: LoaderObjectOptions;
12
+ ident: string | null;
13
+ normal?: Function | null;
14
+ pitch?: Function | null;
15
+ raw?: boolean | null;
13
16
  type?: 'module' | 'commonjs';
14
17
  parallel?: boolean | {
15
18
  maxWorkers?: number;
@@ -29,8 +32,4 @@ export declare class LoaderObject {
29
32
  static __to_binding(loader: LoaderObject): JsLoaderItem;
30
33
  }
31
34
  export declare function runLoaders(compiler: Compiler, context: JsLoaderContext): Promise<JsLoaderContext>;
32
- export declare function parsePathQueryFragment(str: string): {
33
- path: string;
34
- query: string;
35
- fragment: string;
36
- };
35
+ export {};
@@ -7,6 +7,6 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/loader-runner/blob/main/LICENSE
9
9
  */
10
- import type { Compiler } from '../exports';
11
- import type { LoaderObject } from '.';
10
+ import type { Compiler } from '../exports.js';
11
+ import type { LoaderObject } from './index.js';
12
12
  export default function loadLoader(loader: LoaderObject, compiler: Compiler, callback: (err: unknown) => void): void;
@@ -43,6 +43,8 @@ export declare enum RequestType {
43
43
  GetContextDependencies = "GetContextDependencies",
44
44
  GetMissingDependencies = "GetMissingDependencies",
45
45
  ClearDependencies = "ClearDependencies",
46
+ BeginDependencyChanges = "BeginDependencyChanges",
47
+ MergeDependencyChanges = "MergeDependencyChanges",
46
48
  Resolve = "Resolve",
47
49
  GetResolve = "GetResolve",
48
50
  GetLogger = "GetLogger",
@@ -53,6 +55,9 @@ export declare enum RequestType {
53
55
  SetCacheable = "SetCacheable",
54
56
  ImportModule = "ImportModule",
55
57
  UpdateLoaderObjects = "UpdateLoaderObjects",
58
+ UpdateBuildInfo = "UpdateBuildInfo",
59
+ LoaderCacheGet = "LoaderCacheGet",
60
+ LoaderCacheStore = "LoaderCacheStore",
56
61
  CompilationGetPath = "CompilationGetPath",
57
62
  CompilationGetPathWithInfo = "CompilationGetPathWithInfo",
58
63
  CompilationGetAssetPath = "CompilationGetAssetPath",
@@ -63,8 +68,12 @@ export declare enum RequestSyncType {
63
68
  }
64
69
  export type HandleIncomingRequest = (requestType: RequestType, ...args: any[]) => any;
65
70
  type WorkerArgs = any[];
66
- export type WorkerError = Error;
71
+ export type WorkerError = Error & {
72
+ __internal__isAggregateError?: boolean;
73
+ errors?: unknown;
74
+ };
67
75
  export declare function serializeError(error: unknown): WorkerError;
76
+ export declare function deserializeError(error: WorkerError): WorkerError;
68
77
  export declare const run: (loaderName: string, task: any, options: RunOptions & {
69
78
  handleIncomingRequest: HandleIncomingRequest;
70
79
  }, workerOptions?: {
@@ -1,6 +1,6 @@
1
- import type { LoaderContext } from '../config/adapterRuleUse';
2
- import type { Compiler } from '../exports';
3
- import type { LoaderObject } from '.';
1
+ import type { LoaderContext } from '../config/adapterRuleUse.js';
2
+ import type { Compiler } from '../exports.js';
3
+ import type { LoaderObject } from './index.js';
4
4
  export declare function convertArgs(args: any[], raw: boolean): void;
5
5
  export declare const loadLoader: (loaderObject: LoaderObject, compiler: Compiler) => Promise<void>;
6
6
  export declare const runSyncOrAsync: (arg1: Function, arg2: LoaderContext<{}>, arg3: any[]) => Promise<any[]>;
@@ -1,6 +1,6 @@
1
1
  import { type MessagePort } from 'node:worker_threads';
2
2
  import { JsLoaderState } from '@rspack/binding';
3
- import type { LoaderContext } from '../config';
3
+ import type { LoaderContext } from '../config/index.js';
4
4
  interface WorkerOptions {
5
5
  loaderContext: LoaderContext;
6
6
  loaderState: JsLoaderState;
@@ -7,8 +7,8 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { FilterTypes } from '../config';
11
- import { type LogTypeEnum } from './Logger';
10
+ import type { FilterTypes } from '../config/index.js';
11
+ import { type LogTypeEnum } from './Logger.js';
12
12
  export type FilterFunction = (ident: string) => boolean;
13
13
  export type LoggerConsole = {
14
14
  clear: () => void;
package/dist/l~0.js ADDED
@@ -0,0 +1,34 @@
1
+ var modules = {}, moduleCache = {};
2
+ function rspackRequire(moduleId) {
3
+ var cachedModule = moduleCache[moduleId];
4
+ if (void 0 !== cachedModule) return cachedModule.exports;
5
+ var module = moduleCache[moduleId] = {
6
+ exports: {}
7
+ };
8
+ return modules[moduleId](module, module.exports, rspackRequire), module.exports;
9
+ }
10
+ var moduleFactories = modules, compatGetDefaultExport = (module)=>{
11
+ var getter = module && module.__esModule ? ()=>module.default : ()=>module;
12
+ return definePropertyGetters(getter, {
13
+ a: getter
14
+ }), getter;
15
+ }, definePropertyGetters = (exports, getters, values)=>{
16
+ var define = (defs, kind)=>{
17
+ for(var key in defs)hasOwnProperty(defs, key) && !hasOwnProperty(exports, key) && Object.defineProperty(exports, key, {
18
+ enumerable: !0,
19
+ [kind]: defs[key]
20
+ });
21
+ };
22
+ define(getters, "get"), define(values, "value");
23
+ };
24
+ moduleFactories.add = function(modules) {
25
+ Object.assign(moduleFactories, modules);
26
+ };
27
+ var hasOwnProperty = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), makeNamespaceObject = (exports)=>{
28
+ "u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
29
+ value: 'Module'
30
+ }), Object.defineProperty(exports, '__esModule', {
31
+ value: !0
32
+ });
33
+ };
34
+ export { rspackRequire, moduleFactories, compatGetDefaultExport, definePropertyGetters, makeNamespaceObject };
package/dist/l~3.js ADDED
@@ -0,0 +1,34 @@
1
+ var modules = {}, moduleCache = {};
2
+ function rspackRequire(moduleId) {
3
+ var cachedModule = moduleCache[moduleId];
4
+ if (void 0 !== cachedModule) return cachedModule.exports;
5
+ var module = moduleCache[moduleId] = {
6
+ exports: {}
7
+ };
8
+ return modules[moduleId](module, module.exports, rspackRequire), module.exports;
9
+ }
10
+ var moduleFactories = modules, compatGetDefaultExport = (module)=>{
11
+ var getter = module && module.__esModule ? ()=>module.default : ()=>module;
12
+ return definePropertyGetters(getter, {
13
+ a: getter
14
+ }), getter;
15
+ }, definePropertyGetters = (exports, getters, values)=>{
16
+ var define = (defs, kind)=>{
17
+ for(var key in defs)hasOwnProperty(defs, key) && !hasOwnProperty(exports, key) && Object.defineProperty(exports, key, {
18
+ enumerable: !0,
19
+ [kind]: defs[key]
20
+ });
21
+ };
22
+ define(getters, "get"), define(values, "value");
23
+ };
24
+ moduleFactories.add = function(modules) {
25
+ Object.assign(moduleFactories, modules);
26
+ };
27
+ var hasOwnProperty = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), makeNamespaceObject = (exports)=>{
28
+ "u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
29
+ value: 'Module'
30
+ }), Object.defineProperty(exports, '__esModule', {
31
+ value: !0
32
+ });
33
+ };
34
+ export { rspackRequire, moduleFactories, compatGetDefaultExport, definePropertyGetters, makeNamespaceObject };
@@ -1 +1 @@
1
- var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__;module.exports=function(){if((__webpack_require__.initializeSharingData||__webpack_require__.initializeExposesData)&&__webpack_require__.federation){var _ref,_ref1,_ref2,_ref3,_ref4;var __webpack_require___remotesLoadingData,__webpack_require___remotesLoadingData1,__webpack_require___initializeSharingData,__webpack_require___consumesLoadingData,__webpack_require___consumesLoadingData1,__webpack_require___initializeExposesData,__webpack_require___consumesLoadingData2;const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1,_1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};const remotesLoadingChunkMapping=(_ref=(__webpack_require___remotesLoadingData=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData===void 0?void 0:__webpack_require___remotesLoadingData.chunkMapping)!==null&&_ref!==void 0?_ref:{};const remotesLoadingModuleIdToRemoteDataMapping=(_ref1=(__webpack_require___remotesLoadingData1=__webpack_require__.remotesLoadingData)===null||__webpack_require___remotesLoadingData1===void 0?void 0:__webpack_require___remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&_ref1!==void 0?_ref1:{};const initializeSharingScopeToInitDataMapping=(_ref2=(__webpack_require___initializeSharingData=__webpack_require__.initializeSharingData)===null||__webpack_require___initializeSharingData===void 0?void 0:__webpack_require___initializeSharingData.scopeToSharingDataMapping)!==null&&_ref2!==void 0?_ref2:{};const consumesLoadingChunkMapping=(_ref3=(__webpack_require___consumesLoadingData=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData===void 0?void 0:__webpack_require___consumesLoadingData.chunkMapping)!==null&&_ref3!==void 0?_ref3:{};const consumesLoadingModuleToConsumeDataMapping=(_ref4=(__webpack_require___consumesLoadingData1=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData1===void 0?void 0:__webpack_require___consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&_ref4!==void 0?_ref4:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(__webpack_require___initializeExposesData=__webpack_require__.initializeExposesData)===null||__webpack_require___initializeExposesData===void 0?void 0:__webpack_require___initializeExposesData.shareScope;for(const key in __module_federation_bundler_runtime__){__webpack_require__.federation[key]=__module_federation_bundler_runtime__[key]}early(__webpack_require__.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){consumesLoadingModuleToHandlerMapping[moduleId]={getter:data.fallback,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey}}return consumesLoadingModuleToHandlerMapping});early(__webpack_require__.federation,"initOptions",()=>({}));early(__webpack_require__.federation.initOptions,"name",()=>__module_federation_container_name__);early(__webpack_require__.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(__webpack_require__.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name,version,factory,eager,singleton,requiredVersion,strictVersion}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,get:factory};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared});merge(__webpack_require__.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>remote.externalType==="script"));merge(__webpack_require__.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(__webpack_require__.federation,"bundlerRuntimeOptions",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>__module_federation_remote_infos__);early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping});early(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>__webpack_require__);merge(__webpack_require__.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(__webpack_require__,"S",__webpack_require__.federation.bundlerRuntime.S);if(__webpack_require__.federation.attachShareScopeMap){__webpack_require__.federation.attachShareScopeMap(__webpack_require__)}override(__webpack_require__.f,"remotes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:__webpack_require__.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:__webpack_require__}));override(__webpack_require__.f,"consumes",(chunkId,promises)=>__webpack_require__.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:__webpack_require__}));override(__webpack_require__,"I",(name,initScope)=>__webpack_require__.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:__webpack_require__}));override(__webpack_require__,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>__webpack_require__.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:__webpack_require__}));override(__webpack_require__,"getContainer",(module1,getScope)=>{var moduleMap=__webpack_require__.initializeExposesData.moduleMap;__webpack_require__.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module1)?moduleMap[module1]():Promise.resolve().then(()=>{throw new Error('Module "'+module1+'" does not exist in container.')});__webpack_require__.R=undefined;return getScope});__webpack_require__.federation.instance=__webpack_require__.federation.runtime.init(__webpack_require__.federation.initOptions);if((__webpack_require___consumesLoadingData2=__webpack_require__.consumesLoadingData)===null||__webpack_require___consumesLoadingData2===void 0?void 0:__webpack_require___consumesLoadingData2.initialConsumes){__webpack_require__.federation.bundlerRuntime.installInitialConsumes({webpackRequire:__webpack_require__,installedModules:consumesLoadinginstalledModules,initialConsumes:__webpack_require__.consumesLoadingData.initialConsumes,moduleToHandlerMapping:__webpack_require__.federation.consumesLoadingModuleToHandlerMapping})}}};
1
+ var __module_federation_bundler_runtime__,__module_federation_runtime_plugins__,__module_federation_remote_infos__,__module_federation_container_name__,__module_federation_share_strategy__,__module_federation_share_fallbacks__,__module_federation_library_type__;export default function(){const runtimeRequire=__module_federation_runtime_require__;if((runtimeRequire.initializeSharingData||runtimeRequire.initializeExposesData)&&runtimeRequire.federation){var _ref,_ref1,_ref2,_ref3,_ref4;var _runtimeRequire_remotesLoadingData,_runtimeRequire_remotesLoadingData1,_runtimeRequire_initializeSharingData,_runtimeRequire_consumesLoadingData,_runtimeRequire_consumesLoadingData1,_runtimeRequire_initializeExposesData,_runtimeRequire_consumesLoadingData2;const override=(obj,key,value)=>{if(!obj)return;if(obj[key])obj[key]=value};const merge=(obj,key,fn)=>{const value=fn();if(Array.isArray(value)){var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=[];obj[key].push(...value)}else if(typeof value==="object"&&value!==null){var _obj1,_key1,_1;(_1=(_obj1=obj)[_key1=key])!==null&&_1!==void 0?_1:_obj1[_key1]={};Object.assign(obj[key],value)}};const early=(obj,key,initial)=>{var _obj,_key,_;(_=(_obj=obj)[_key=key])!==null&&_!==void 0?_:_obj[_key]=initial()};const remotesLoadingChunkMapping=(_ref=(_runtimeRequire_remotesLoadingData=runtimeRequire.remotesLoadingData)===null||_runtimeRequire_remotesLoadingData===void 0?void 0:_runtimeRequire_remotesLoadingData.chunkMapping)!==null&&_ref!==void 0?_ref:{};const remotesLoadingModuleIdToRemoteDataMapping=(_ref1=(_runtimeRequire_remotesLoadingData1=runtimeRequire.remotesLoadingData)===null||_runtimeRequire_remotesLoadingData1===void 0?void 0:_runtimeRequire_remotesLoadingData1.moduleIdToRemoteDataMapping)!==null&&_ref1!==void 0?_ref1:{};const initializeSharingScopeToInitDataMapping=(_ref2=(_runtimeRequire_initializeSharingData=runtimeRequire.initializeSharingData)===null||_runtimeRequire_initializeSharingData===void 0?void 0:_runtimeRequire_initializeSharingData.scopeToSharingDataMapping)!==null&&_ref2!==void 0?_ref2:{};const consumesLoadingChunkMapping=(_ref3=(_runtimeRequire_consumesLoadingData=runtimeRequire.consumesLoadingData)===null||_runtimeRequire_consumesLoadingData===void 0?void 0:_runtimeRequire_consumesLoadingData.chunkMapping)!==null&&_ref3!==void 0?_ref3:{};const consumesLoadingModuleToConsumeDataMapping=(_ref4=(_runtimeRequire_consumesLoadingData1=runtimeRequire.consumesLoadingData)===null||_runtimeRequire_consumesLoadingData1===void 0?void 0:_runtimeRequire_consumesLoadingData1.moduleIdToConsumeDataMapping)!==null&&_ref4!==void 0?_ref4:{};const consumesLoadinginstalledModules={};const initializeSharingInitPromises=[];const initializeSharingInitTokens={};const containerShareScope=(_runtimeRequire_initializeExposesData=runtimeRequire.initializeExposesData)===null||_runtimeRequire_initializeExposesData===void 0?void 0:_runtimeRequire_initializeExposesData.shareScope;for(const key in __module_federation_bundler_runtime__){runtimeRequire.federation[key]=__module_federation_bundler_runtime__[key]}early(runtimeRequire.federation,"libraryType",()=>__module_federation_library_type__);early(runtimeRequire.federation,"sharedFallback",()=>__module_federation_share_fallbacks__);const sharedFallback=runtimeRequire.federation.sharedFallback;early(runtimeRequire.federation,"consumesLoadingModuleToHandlerMapping",()=>{const consumesLoadingModuleToHandlerMapping={};for(let[moduleId,data]of Object.entries(consumesLoadingModuleToConsumeDataMapping)){var _runtimeRequire_federation_bundlerRuntime;consumesLoadingModuleToHandlerMapping[moduleId]={getter:sharedFallback?(_runtimeRequire_federation_bundlerRuntime=runtimeRequire.federation.bundlerRuntime)===null||_runtimeRequire_federation_bundlerRuntime===void 0?void 0:_runtimeRequire_federation_bundlerRuntime.getSharedFallbackGetter({shareKey:data.shareKey,factory:data.fallback,webpackRequire:runtimeRequire,libraryType:runtimeRequire.federation.libraryType}):data.fallback,treeShakingGetter:sharedFallback?data.fallback:undefined,shareInfo:{shareConfig:{fixedDependencies:false,requiredVersion:data.requiredVersion,strictVersion:data.strictVersion,singleton:data.singleton,eager:data.eager},scope:[data.shareScope]},shareKey:data.shareKey,treeShaking:runtimeRequire.federation.sharedFallback?{get:data.fallback,mode:data.treeShakingMode}:undefined}}return consumesLoadingModuleToHandlerMapping});early(runtimeRequire.federation,"initOptions",()=>({}));early(runtimeRequire.federation.initOptions,"name",()=>__module_federation_container_name__);early(runtimeRequire.federation.initOptions,"shareStrategy",()=>__module_federation_share_strategy__);early(runtimeRequire.federation.initOptions,"shared",()=>{const shared={};for(let[scope,stages]of Object.entries(initializeSharingScopeToInitDataMapping)){for(let stage of stages){if(typeof stage==="object"&&stage!==null){const{name,version,factory,eager,singleton,requiredVersion,strictVersion,treeShakingMode}=stage;const shareConfig={};const isValidValue=function(val){return typeof val!=="undefined"};if(isValidValue(singleton)){shareConfig.singleton=singleton}if(isValidValue(requiredVersion)){shareConfig.requiredVersion=requiredVersion}if(isValidValue(eager)){shareConfig.eager=eager}if(isValidValue(strictVersion)){shareConfig.strictVersion=strictVersion}const options={version,scope:[scope],shareConfig,get:factory,treeShaking:treeShakingMode?{mode:treeShakingMode}:undefined};if(shared[name]){shared[name].push(options)}else{shared[name]=[options]}}}}return shared});merge(runtimeRequire.federation.initOptions,"remotes",()=>Object.values(__module_federation_remote_infos__).flat().filter(remote=>remote.externalType==="script"));merge(runtimeRequire.federation.initOptions,"plugins",()=>__module_federation_runtime_plugins__);early(runtimeRequire.federation,"bundlerRuntimeOptions",()=>({}));early(runtimeRequire.federation.bundlerRuntimeOptions,"remotes",()=>({}));early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"chunkMapping",()=>remotesLoadingChunkMapping);early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"remoteInfos",()=>__module_federation_remote_infos__);early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"idToExternalAndNameMapping",()=>{const remotesLoadingIdToExternalAndNameMappingMapping={};for(let[moduleId,data]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){remotesLoadingIdToExternalAndNameMappingMapping[moduleId]=[data.shareScope,data.name,data.externalModuleId,data.remoteName]}return remotesLoadingIdToExternalAndNameMappingMapping});early(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"webpackRequire",()=>runtimeRequire);merge(runtimeRequire.federation.bundlerRuntimeOptions.remotes,"idToRemoteMap",()=>{const idToRemoteMap={};for(let[id,remoteData]of Object.entries(remotesLoadingModuleIdToRemoteDataMapping)){const info=__module_federation_remote_infos__[remoteData.remoteName];if(info)idToRemoteMap[id]=info}return idToRemoteMap});override(runtimeRequire,"S",runtimeRequire.federation.bundlerRuntime.S);if(runtimeRequire.federation.attachShareScopeMap){runtimeRequire.federation.attachShareScopeMap(runtimeRequire)}override(runtimeRequire.f,"remotes",(chunkId,promises)=>runtimeRequire.federation.bundlerRuntime.remotes({chunkId,promises,chunkMapping:remotesLoadingChunkMapping,idToExternalAndNameMapping:runtimeRequire.federation.bundlerRuntimeOptions.remotes.idToExternalAndNameMapping,idToRemoteMap:runtimeRequire.federation.bundlerRuntimeOptions.remotes.idToRemoteMap,webpackRequire:runtimeRequire}));override(runtimeRequire.f,"consumes",(chunkId,promises)=>runtimeRequire.federation.bundlerRuntime.consumes({chunkId,promises,chunkMapping:consumesLoadingChunkMapping,moduleToHandlerMapping:runtimeRequire.federation.consumesLoadingModuleToHandlerMapping,installedModules:consumesLoadinginstalledModules,webpackRequire:runtimeRequire}));override(runtimeRequire,"I",(name,initScope)=>runtimeRequire.federation.bundlerRuntime.I({shareScopeName:name,initScope,initPromises:initializeSharingInitPromises,initTokens:initializeSharingInitTokens,webpackRequire:runtimeRequire}));override(runtimeRequire,"initContainer",(shareScope,initScope,remoteEntryInitOptions)=>runtimeRequire.federation.bundlerRuntime.initContainerEntry({shareScope,initScope,remoteEntryInitOptions,shareScopeKey:containerShareScope,webpackRequire:runtimeRequire}));override(runtimeRequire,"getContainer",(module,getScope)=>{var moduleMap=runtimeRequire.initializeExposesData.moduleMap;runtimeRequire.R=getScope;getScope=Object.prototype.hasOwnProperty.call(moduleMap,module)?moduleMap[module]():Promise.resolve().then(()=>{throw new Error('Module "'+module+'" does not exist in container.')});runtimeRequire.R=undefined;return getScope});runtimeRequire.federation.instance=runtimeRequire.federation.bundlerRuntime.init({webpackRequire:runtimeRequire});if((_runtimeRequire_consumesLoadingData2=runtimeRequire.consumesLoadingData)===null||_runtimeRequire_consumesLoadingData2===void 0?void 0:_runtimeRequire_consumesLoadingData2.initialConsumes){runtimeRequire.federation.bundlerRuntime.installInitialConsumes({webpackRequire:runtimeRequire,installedModules:consumesLoadinginstalledModules,initialConsumes:runtimeRequire.consumesLoadingData.initialConsumes,moduleToHandlerMapping:runtimeRequire.federation.consumesLoadingModuleToHandlerMapping})}}}
@@ -1,5 +1,5 @@
1
- import type { Compiler } from '..';
2
- import type { InfrastructureLogging } from '../config';
1
+ import type { Compiler } from '../index.js';
2
+ import type { InfrastructureLogging } from '../config/index.js';
3
3
  export interface NodeEnvironmentPluginOptions {
4
4
  infrastructureLogging: InfrastructureLogging;
5
5
  }
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Compiler } from '../Compiler';
10
+ import type { Compiler } from '../Compiler.js';
11
11
  export type NodeTemplatePluginOptions = {
12
12
  asyncChunkLoading?: boolean;
13
13
  };
@@ -7,12 +7,24 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type Watchpack from '../../compiled/watchpack';
11
- import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from '../util/fs';
10
+ import type Watchpack from '../../compiled/watchpack/index.js';
11
+ import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from '../util/fs.js';
12
+ type WatchpackInstance = InstanceType<typeof Watchpack>;
12
13
  export default class NodeWatchFileSystem implements WatchFileSystem {
14
+ #private;
13
15
  inputFileSystem: InputFileSystem;
14
16
  watcherOptions: Watchpack.WatchOptions;
15
- watcher?: Watchpack;
17
+ watcher?: WatchpackInstance;
16
18
  constructor(inputFileSystem: InputFileSystem);
17
19
  watch(files: Iterable<string>, directories: Iterable<string>, missing: Iterable<string>, startTime: number, options: Watchpack.WatchOptions, callback: (error: Error | null, fileTimeInfoEntries: Map<string, FileSystemInfoEntry | 'ignore'>, contextTimeInfoEntries: Map<string, FileSystemInfoEntry | 'ignore'>, changedFiles: Set<string>, removedFiles: Set<string>) => void, callbackUndelayed: (fileName: string, changeTime: number) => void): Watcher;
20
+ on(event: 'change', listener: (filename: string, mtime: number) => void): this;
21
+ on(event: 'remove', listener: (filename: string) => void): this;
22
+ on(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
23
+ once(event: 'change', listener: (filename: string, mtime: number) => void): this;
24
+ once(event: 'remove', listener: (filename: string) => void): this;
25
+ once(event: 'aggregated', listener: (changes: Set<string>, removals: Set<string>) => void): this;
26
+ emit(event: 'change', filename: string, mtime: number): boolean;
27
+ emit(event: 'remove', filename: string): boolean;
28
+ emit(event: 'aggregated', changes: Set<string>, removals: Set<string>): boolean;
18
29
  }
30
+ export {};
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { LoggerConsole } from '../logging/createConsoleLogger';
10
+ import type { LoggerConsole } from '../logging/createConsoleLogger.js';
11
11
  export default function ({ colors, appendOnly, stream, }: {
12
12
  colors?: boolean;
13
13
  appendOnly?: boolean;
package/dist/rspack.d.ts CHANGED
@@ -7,14 +7,14 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Callback } from '@rspack/lite-tapable';
11
- import { Compiler } from './Compiler';
12
- import { type RspackOptions } from './config';
13
- import { MultiCompiler, type MultiRspackOptions } from './MultiCompiler';
14
- import MultiStats from './MultiStats';
15
- import { Stats } from './Stats';
10
+ import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.js';
11
+ import { Compiler } from './Compiler.js';
12
+ import { type RspackOptions } from './config/index.js';
13
+ import { MultiCompiler, type MultiRspackOptions } from './MultiCompiler.js';
14
+ import MultiStats from './MultiStats.js';
15
+ import { Stats } from './Stats.js';
16
16
  declare function createMultiCompiler(options: MultiRspackOptions): MultiCompiler;
17
- declare function createCompiler(userOptions: RspackOptions): Compiler;
17
+ declare function createCompiler(userOptions: RspackOptions, compilerIndex?: number): Compiler;
18
18
  declare function rspack(options: MultiRspackOptions): MultiCompiler;
19
19
  declare function rspack(options: RspackOptions): Compiler;
20
20
  declare function rspack(options: MultiRspackOptions | RspackOptions): MultiCompiler | Compiler;
@@ -22,4 +22,3 @@ declare function rspack(options: MultiRspackOptions, callback?: Callback<Error,
22
22
  declare function rspack(options: RspackOptions, callback?: Callback<Error, Stats>): null | Compiler;
23
23
  declare function rspack(options: MultiRspackOptions | RspackOptions, callback?: Callback<Error, MultiStats | Stats>): null | MultiCompiler | Compiler;
24
24
  export { createCompiler, createMultiCompiler, MultiStats, rspack, Stats };
25
- export default rspack;
@@ -1,4 +1,4 @@
1
- import type { Compiler, RspackOptionsNormalized } from '.';
1
+ import type { Compiler, RspackOptionsNormalized } from './index.js';
2
2
  export declare class RspackOptionsApply {
3
3
  process(options: RspackOptionsNormalized, compiler: Compiler): void;
4
4
  }
@@ -1,4 +1,4 @@
1
1
  export declare function normalizeUrl(url: string): string;
2
- declare function noop(): void;
3
- declare function cssReload(moduleId: string, options: Record<string, any>): typeof noop;
2
+ type DebouncedFunction<T extends (...args: any[]) => any> = (...args: Parameters<T>) => void;
3
+ declare function cssReload(moduleId: string, options: Record<string, any>): DebouncedFunction<() => void>;
4
4
  export { cssReload };