@ohos-ports/rspack-core 1.7.11-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 (284) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +15 -0
  3. package/compiled/@swc/types/index.d.ts +2134 -0
  4. package/compiled/@swc/types/index.js +19 -0
  5. package/compiled/@swc/types/license +201 -0
  6. package/compiled/@swc/types/package.json +1 -0
  7. package/compiled/browserslist-load-config/index.d.ts +21 -0
  8. package/compiled/browserslist-load-config/index.js +252 -0
  9. package/compiled/browserslist-load-config/license +21 -0
  10. package/compiled/browserslist-load-config/package.json +1 -0
  11. package/compiled/tinypool/LICENSE +24 -0
  12. package/compiled/tinypool/README.md +20 -0
  13. package/compiled/tinypool/dist/common-Qw-RoVFD.js +28 -0
  14. package/compiled/tinypool/dist/entry/process.d.ts +1 -0
  15. package/compiled/tinypool/dist/entry/process.js +72 -0
  16. package/compiled/tinypool/dist/entry/utils.d.ts +7 -0
  17. package/compiled/tinypool/dist/entry/utils.js +3 -0
  18. package/compiled/tinypool/dist/entry/worker.d.ts +1 -0
  19. package/compiled/tinypool/dist/entry/worker.js +76 -0
  20. package/compiled/tinypool/dist/index.d.ts +195 -0
  21. package/compiled/tinypool/dist/index.js +820 -0
  22. package/compiled/tinypool/dist/utils-B--2TaWv.js +38 -0
  23. package/compiled/tinypool/dist/utils-De75vAgL.js +10 -0
  24. package/compiled/tinypool/package.json +39 -0
  25. package/compiled/watchpack/index.d.ts +217 -0
  26. package/compiled/watchpack/index.js +3124 -0
  27. package/compiled/watchpack/license +20 -0
  28. package/compiled/watchpack/package.json +1 -0
  29. package/compiled/webpack-sources/index.js +4675 -0
  30. package/compiled/webpack-sources/license +21 -0
  31. package/compiled/webpack-sources/package.json +1 -0
  32. package/compiled/webpack-sources/types.d.ts +458 -0
  33. package/dist/BuildInfo.d.ts +17 -0
  34. package/dist/Chunk.d.ts +16 -0
  35. package/dist/ChunkGraph.d.ts +9 -0
  36. package/dist/Chunks.d.ts +12 -0
  37. package/dist/CodeGenerationResults.d.ts +1 -0
  38. package/dist/Compilation.d.ts +438 -0
  39. package/dist/Compiler.d.ts +226 -0
  40. package/dist/ConcatenatedModule.d.ts +1 -0
  41. package/dist/ContextModule.d.ts +1 -0
  42. package/dist/ContextModuleFactory.d.ts +13 -0
  43. package/dist/Diagnostics.d.ts +7 -0
  44. package/dist/Entrypoint.d.ts +2 -0
  45. package/dist/ErrorHelpers.d.ts +3 -0
  46. package/dist/ExecuteModulePlugin.d.ts +4 -0
  47. package/dist/ExportsInfo.d.ts +20 -0
  48. package/dist/ExternalModule.d.ts +1 -0
  49. package/dist/FileSystem.d.ts +54 -0
  50. package/dist/FileSystemInfo.d.ts +5 -0
  51. package/dist/Module.d.ts +42 -0
  52. package/dist/ModuleGraph.d.ts +19 -0
  53. package/dist/ModuleTypeConstants.d.ts +8 -0
  54. package/dist/MultiCompiler.d.ts +82 -0
  55. package/dist/MultiStats.d.ts +23 -0
  56. package/dist/MultiWatching.d.ts +27 -0
  57. package/dist/NativeWatchFileSystem.d.ts +23 -0
  58. package/dist/NormalModule.d.ts +15 -0
  59. package/dist/NormalModuleFactory.d.ts +23 -0
  60. package/dist/Resolver.d.ts +30 -0
  61. package/dist/ResolverFactory.d.ts +17 -0
  62. package/dist/RspackError.d.ts +12 -0
  63. package/dist/RuleSetCompiler.d.ts +9 -0
  64. package/dist/RuntimeGlobals.d.ts +356 -0
  65. package/dist/RuntimeModule.d.ts +34 -0
  66. package/dist/Stats.d.ts +17 -0
  67. package/dist/Template.d.ts +77 -0
  68. package/dist/VirtualModulesPlugin.d.ts +12 -0
  69. package/dist/Watching.d.ts +56 -0
  70. package/dist/builtin-loader/index.d.ts +1 -0
  71. package/dist/builtin-loader/lightningcss/index.d.ts +117 -0
  72. package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -0
  73. package/dist/builtin-loader/swc/index.d.ts +5 -0
  74. package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
  75. package/dist/builtin-loader/swc/types.d.ts +89 -0
  76. package/dist/builtin-plugin/APIPlugin.d.ts +9 -0
  77. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +9 -0
  78. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +9 -0
  79. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +9 -0
  80. package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
  81. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +14 -0
  82. package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +9 -0
  83. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +9 -0
  84. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +54 -0
  85. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -0
  86. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +9 -0
  87. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +14 -0
  88. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +21 -0
  89. package/dist/builtin-plugin/CssModulesPlugin.d.ts +9 -0
  90. package/dist/builtin-plugin/DataUriPlugin.d.ts +9 -0
  91. package/dist/builtin-plugin/DefinePlugin.d.ts +16 -0
  92. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +7 -0
  93. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +7 -0
  94. package/dist/builtin-plugin/DllEntryPlugin.d.ts +12 -0
  95. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
  96. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +12 -0
  97. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +9 -0
  98. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +25 -0
  99. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
  100. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +9 -0
  101. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +9 -0
  102. package/dist/builtin-plugin/EntryPlugin.d.ts +32 -0
  103. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +11 -0
  104. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +11 -0
  105. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +10 -0
  106. package/dist/builtin-plugin/ExternalsPlugin.d.ts +12 -0
  107. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +9 -0
  108. package/dist/builtin-plugin/FileUriPlugin.d.ts +9 -0
  109. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +9 -0
  110. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +9 -0
  111. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +9 -0
  112. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
  113. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +9 -0
  114. package/dist/builtin-plugin/HttpUriPlugin.d.ts +36 -0
  115. package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
  116. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +9 -0
  117. package/dist/builtin-plugin/InlineExportsPlugin.d.ts +9 -0
  118. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -0
  119. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +10 -0
  120. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +9 -0
  121. package/dist/builtin-plugin/LibManifestPlugin.d.ts +17 -0
  122. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +32 -0
  123. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +14 -0
  124. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +9 -0
  125. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +9 -0
  126. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +9 -0
  127. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +7 -0
  128. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +9 -0
  129. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +9 -0
  130. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +9 -0
  131. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +7 -0
  132. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +7 -0
  133. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +9 -0
  134. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +9 -0
  135. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
  136. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
  137. package/dist/builtin-plugin/ProgressPlugin.d.ts +11 -0
  138. package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
  139. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +9 -0
  140. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +9 -0
  141. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +9 -0
  142. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +49 -0
  143. package/dist/builtin-plugin/RslibPlugin.d.ts +11 -0
  144. package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
  145. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
  146. package/dist/builtin-plugin/RuntimePlugin.d.ts +29 -0
  147. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -0
  148. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +19 -0
  149. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
  150. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +11 -0
  151. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +39 -0
  152. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +215 -0
  153. package/dist/builtin-plugin/URLPlugin.d.ts +9 -0
  154. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +7 -0
  155. package/dist/builtin-plugin/WorkerPlugin.d.ts +14 -0
  156. package/dist/builtin-plugin/base.d.ts +45 -0
  157. package/dist/builtin-plugin/css-extract/index.d.ts +24 -0
  158. package/dist/builtin-plugin/css-extract/loader.d.ts +21 -0
  159. package/dist/builtin-plugin/css-extract/utils.d.ts +6 -0
  160. package/dist/builtin-plugin/html-plugin/hooks.d.ts +32 -0
  161. package/dist/builtin-plugin/html-plugin/index.d.ts +2 -0
  162. package/dist/builtin-plugin/html-plugin/options.d.ts +82 -0
  163. package/dist/builtin-plugin/html-plugin/plugin.d.ts +24 -0
  164. package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
  165. package/dist/builtin-plugin/index.d.ts +84 -0
  166. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +10 -0
  167. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +12 -0
  168. package/dist/config/adapter.d.ts +8 -0
  169. package/dist/config/adapterRuleUse.d.ts +391 -0
  170. package/dist/config/browserslistTargetHandler.d.ts +15 -0
  171. package/dist/config/defaults.d.ts +13 -0
  172. package/dist/config/devServer.d.ts +314 -0
  173. package/dist/config/index.d.ts +5 -0
  174. package/dist/config/normalization.d.ts +174 -0
  175. package/dist/config/target.d.ts +93 -0
  176. package/dist/config/types.d.ts +2432 -0
  177. package/dist/container/ContainerPlugin.d.ts +41 -0
  178. package/dist/container/ContainerReferencePlugin.d.ts +34 -0
  179. package/dist/container/ModuleFederationManifestPlugin.d.ts +37 -0
  180. package/dist/container/ModuleFederationPlugin.d.ts +17 -0
  181. package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
  182. package/dist/container/ModuleFederationRuntimePlugin.d.ts +16 -0
  183. package/dist/container/index.d.ts +4 -0
  184. package/dist/container/options.d.ts +3 -0
  185. package/dist/cssExtractHmr.js +124 -0
  186. package/dist/cssExtractLoader.js +160 -0
  187. package/dist/error/ConcurrentCompilationError.d.ts +14 -0
  188. package/dist/exports.d.ts +178 -0
  189. package/dist/index.d.ts +10 -0
  190. package/dist/index.js +12638 -0
  191. package/dist/lib/AbstractMethodError.d.ts +23 -0
  192. package/dist/lib/Cache.d.ts +65 -0
  193. package/dist/lib/CacheFacade.d.ts +139 -0
  194. package/dist/lib/DllPlugin.d.ts +42 -0
  195. package/dist/lib/DllReferencePlugin.d.ts +119 -0
  196. package/dist/lib/EntryOptionPlugin.d.ts +33 -0
  197. package/dist/lib/EnvironmentPlugin.d.ts +22 -0
  198. package/dist/lib/HookWebpackError.d.ts +40 -0
  199. package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
  200. package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
  201. package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
  202. package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
  203. package/dist/lib/WebpackError.d.ts +21 -0
  204. package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
  205. package/dist/lib/cache/getLazyHashedEtag.d.ts +35 -0
  206. package/dist/lib/cache/mergeEtags.d.ts +17 -0
  207. package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
  208. package/dist/loader-runner/ModuleError.d.ts +13 -0
  209. package/dist/loader-runner/index.d.ts +36 -0
  210. package/dist/loader-runner/loadLoader.d.ts +12 -0
  211. package/dist/loader-runner/service.d.ts +73 -0
  212. package/dist/loader-runner/utils.d.ts +7 -0
  213. package/dist/loader-runner/worker.d.ts +14 -0
  214. package/dist/logging/Logger.d.ts +61 -0
  215. package/dist/logging/createConsoleLogger.d.ts +35 -0
  216. package/dist/logging/truncateArgs.d.ts +16 -0
  217. package/dist/moduleFederationDefaultRuntime.js +1 -0
  218. package/dist/node/NodeEnvironmentPlugin.d.ts +10 -0
  219. package/dist/node/NodeTemplatePlugin.d.ts +18 -0
  220. package/dist/node/NodeWatchFileSystem.d.ts +18 -0
  221. package/dist/node/nodeConsole.d.ts +15 -0
  222. package/dist/rspack.d.ts +25 -0
  223. package/dist/rspackOptionsApply.d.ts +4 -0
  224. package/dist/runtime/cssExtractHmr.d.ts +4 -0
  225. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
  226. package/dist/sharing/ConsumeSharedPlugin.d.ts +42 -0
  227. package/dist/sharing/ProvideSharedPlugin.d.ts +35 -0
  228. package/dist/sharing/SharePlugin.d.ts +53 -0
  229. package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
  230. package/dist/sharing/utils.d.ts +1 -0
  231. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +20 -0
  232. package/dist/stats/DefaultStatsPresetPlugin.d.ts +4 -0
  233. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +13 -0
  234. package/dist/stats/StatsFactory.d.ts +57 -0
  235. package/dist/stats/StatsPrinter.d.ts +57 -0
  236. package/dist/stats/statsFactoryUtils.d.ts +341 -0
  237. package/dist/swc.d.ts +7 -0
  238. package/dist/taps/compilation.d.ts +8 -0
  239. package/dist/taps/compiler.d.ts +2 -0
  240. package/dist/taps/contextModuleFactory.d.ts +2 -0
  241. package/dist/taps/index.d.ts +6 -0
  242. package/dist/taps/javascriptModules.d.ts +2 -0
  243. package/dist/taps/normalModuleFactory.d.ts +2 -0
  244. package/dist/taps/types.d.ts +11 -0
  245. package/dist/trace/index.d.ts +46 -0
  246. package/dist/trace/traceHookPlugin.d.ts +5 -0
  247. package/dist/util/ArrayQueue.d.ts +45 -0
  248. package/dist/util/AsyncTask.d.ts +7 -0
  249. package/dist/util/MergeCaller.d.ts +10 -0
  250. package/dist/util/SizeFormatHelpers.d.ts +10 -0
  251. package/dist/util/SplitChunkSize.d.ts +5 -0
  252. package/dist/util/assertNotNil.d.ts +1 -0
  253. package/dist/util/assetCondition.d.ts +2 -0
  254. package/dist/util/asyncLib.d.ts +54 -0
  255. package/dist/util/bindingVersionCheck.d.ts +5 -0
  256. package/dist/util/cleverMerge.d.ts +24 -0
  257. package/dist/util/comparators.d.ts +16 -0
  258. package/dist/util/createHash.d.ts +16 -0
  259. package/dist/util/createReadonlyMap.d.ts +1 -0
  260. package/dist/util/fake.d.ts +14 -0
  261. package/dist/util/fs.d.ts +375 -0
  262. package/dist/util/hash/index.d.ts +26 -0
  263. package/dist/util/hash/md4.d.ts +11 -0
  264. package/dist/util/hash/wasm-hash.d.ts +51 -0
  265. package/dist/util/hash/xxhash64.d.ts +11 -0
  266. package/dist/util/identifier.d.ts +31 -0
  267. package/dist/util/index.d.ts +9 -0
  268. package/dist/util/memoize.d.ts +2 -0
  269. package/dist/util/runtime.d.ts +2 -0
  270. package/dist/util/smartGrouping.d.ts +21 -0
  271. package/dist/util/source.d.ts +6 -0
  272. package/dist/util/validateConfig.d.ts +5 -0
  273. package/dist/worker.js +978 -0
  274. package/hot/dev-server.js +75 -0
  275. package/hot/emitter.js +21 -0
  276. package/hot/lazy-compilation-node.js +106 -0
  277. package/hot/lazy-compilation-web.js +98 -0
  278. package/hot/log-apply-result.js +49 -0
  279. package/hot/log.js +79 -0
  280. package/hot/only-dev-server.js +103 -0
  281. package/hot/poll.js +40 -0
  282. package/hot/signal.js +66 -0
  283. package/module.d.ts +273 -0
  284. package/package.json +79 -0
@@ -0,0 +1,438 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/Compilation.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
11
+ import binding from '@rspack/binding';
12
+ export type { AssetInfo } from '@rspack/binding';
13
+ import * as liteTapable from '@rspack/lite-tapable';
14
+ import type { Source } from '../compiled/webpack-sources';
15
+ import type { EntryOptions, EntryPlugin } from './builtin-plugin';
16
+ import type { Chunk } from './Chunk';
17
+ import type { ChunkGraph } from './ChunkGraph';
18
+ import type { Compiler } from './Compiler';
19
+ import type { ContextModuleFactory } from './ContextModuleFactory';
20
+ import type { OutputNormalized, RspackOptionsNormalized, RspackPluginInstance, StatsOptions, StatsValue } from './config';
21
+ import type { Entrypoint } from './Entrypoint';
22
+ import WebpackError from './lib/WebpackError';
23
+ import { Logger } from './logging/Logger';
24
+ import type { Module } from './Module';
25
+ import ModuleGraph from './ModuleGraph';
26
+ import type { NormalModuleCompilationHooks } from './NormalModule';
27
+ import type { NormalModuleFactory } from './NormalModuleFactory';
28
+ import type { ResolverFactory } from './ResolverFactory';
29
+ import type { RspackError } from './RspackError';
30
+ import { RuntimeModule } from './RuntimeModule';
31
+ import { Stats, type StatsAsset, type StatsError, type StatsModule } from './Stats';
32
+ import { StatsFactory } from './stats/StatsFactory';
33
+ import { StatsPrinter } from './stats/StatsPrinter';
34
+ import type { InputFileSystem } from './util/fs';
35
+ import type Hash from './util/hash';
36
+ import './Chunk';
37
+ import './Chunks';
38
+ import './ChunkGraph';
39
+ import './CodeGenerationResults';
40
+ import type { CodeGenerationResult } from './taps/compilation';
41
+ export type Assets = Record<string, Source>;
42
+ export interface Asset {
43
+ name: string;
44
+ source: Source;
45
+ info: AssetInfo;
46
+ }
47
+ export type ChunkPathData = {
48
+ id?: string;
49
+ name?: string;
50
+ hash?: string;
51
+ contentHash?: Record<string, string>;
52
+ };
53
+ export type PathData = {
54
+ filename?: string;
55
+ hash?: string;
56
+ contentHash?: string;
57
+ runtime?: string;
58
+ url?: string;
59
+ id?: string;
60
+ chunk?: Chunk | ChunkPathData;
61
+ contentHashType?: string;
62
+ };
63
+ export interface LogEntry {
64
+ type: string;
65
+ args: any[];
66
+ time?: number;
67
+ trace?: string[];
68
+ }
69
+ export interface CompilationParams {
70
+ normalModuleFactory: NormalModuleFactory;
71
+ contextModuleFactory: ContextModuleFactory;
72
+ }
73
+ export interface KnownCreateStatsOptionsContext {
74
+ forToString?: boolean;
75
+ }
76
+ export interface ExecuteModuleArgument {
77
+ codeGenerationResult: CodeGenerationResult;
78
+ moduleObject: {
79
+ id: string;
80
+ exports: any;
81
+ loaded: boolean;
82
+ error?: Error;
83
+ };
84
+ }
85
+ export interface ExecuteModuleContext {
86
+ [key: string]: (id: string) => any;
87
+ }
88
+ export interface KnownNormalizedStatsOptions {
89
+ context: string;
90
+ chunksSort: string;
91
+ modulesSort: string;
92
+ chunkModulesSort: string;
93
+ nestedModulesSort: string;
94
+ assetsSort: string;
95
+ ids: boolean;
96
+ cachedAssets: boolean;
97
+ groupAssetsByEmitStatus: boolean;
98
+ groupAssetsByPath: boolean;
99
+ groupAssetsByExtension: boolean;
100
+ assetsSpace: number;
101
+ excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
102
+ excludeModules: ((name: string, module: StatsModule, type: 'module' | 'chunk' | 'root-of-chunk' | 'nested') => boolean)[];
103
+ warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
104
+ cachedModules: boolean;
105
+ orphanModules: boolean;
106
+ dependentModules: boolean;
107
+ runtimeModules: boolean;
108
+ groupModulesByCacheStatus: boolean;
109
+ groupModulesByLayer: boolean;
110
+ groupModulesByAttributes: boolean;
111
+ groupModulesByPath: boolean;
112
+ groupModulesByExtension: boolean;
113
+ groupModulesByType: boolean;
114
+ entrypoints: boolean | 'auto';
115
+ chunkGroups: boolean;
116
+ chunkGroupAuxiliary: boolean;
117
+ chunkGroupChildren: boolean;
118
+ chunkGroupMaxAssets: number;
119
+ modulesSpace: number;
120
+ chunkModulesSpace: number;
121
+ nestedModulesSpace: number;
122
+ logging: false | 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
123
+ loggingDebug: ((value: string) => boolean)[];
124
+ loggingTrace: boolean;
125
+ chunkModules: boolean;
126
+ chunkRelations: boolean;
127
+ reasons: boolean;
128
+ moduleAssets: boolean;
129
+ nestedModules: boolean;
130
+ source: boolean;
131
+ usedExports: boolean;
132
+ providedExports: boolean;
133
+ optimizationBailout: boolean;
134
+ depth: boolean;
135
+ assets: boolean;
136
+ chunks: boolean;
137
+ errors: boolean;
138
+ errorsCount: boolean;
139
+ hash: boolean;
140
+ modules: boolean;
141
+ warnings: boolean;
142
+ warningsCount: boolean;
143
+ }
144
+ export type CreateStatsOptionsContext = KnownCreateStatsOptionsContext & Record<string, any>;
145
+ export type NormalizedStatsOptions = KnownNormalizedStatsOptions & Omit<StatsOptions, keyof KnownNormalizedStatsOptions> & Record<string, any>;
146
+ export declare const checkCompilation: (compilation: Compilation) => void;
147
+ export declare class Compilation {
148
+ #private;
149
+ hooks: Readonly<{
150
+ processAssets: liteTapable.AsyncSeriesHook<Assets>;
151
+ afterProcessAssets: liteTapable.SyncHook<Assets>;
152
+ childCompiler: liteTapable.SyncHook<[Compiler, string, number]>;
153
+ log: liteTapable.SyncBailHook<[string, LogEntry], true>;
154
+ additionalAssets: any;
155
+ optimizeModules: liteTapable.SyncBailHook<Iterable<Module>, void>;
156
+ afterOptimizeModules: liteTapable.SyncHook<Iterable<Module>>;
157
+ optimizeTree: liteTapable.AsyncSeriesHook<[
158
+ Iterable<Chunk>,
159
+ Iterable<Module>
160
+ ]>;
161
+ optimizeChunkModules: liteTapable.AsyncSeriesBailHook<[
162
+ Iterable<Chunk>,
163
+ Iterable<Module>
164
+ ], void>;
165
+ beforeModuleIds: liteTapable.SyncHook<[Iterable<Module>]>;
166
+ finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
167
+ chunkHash: liteTapable.SyncHook<[Chunk, Hash]>;
168
+ chunkAsset: liteTapable.SyncHook<[Chunk, string]>;
169
+ processWarnings: liteTapable.SyncWaterfallHook<[WebpackError[]]>;
170
+ succeedModule: liteTapable.SyncHook<[Module]>;
171
+ stillValidModule: liteTapable.SyncHook<[Module]>;
172
+ statsPreset: liteTapable.HookMap<liteTapable.SyncHook<[Partial<StatsOptions>, CreateStatsOptionsContext]>>;
173
+ statsNormalize: liteTapable.SyncHook<[
174
+ Partial<StatsOptions>,
175
+ CreateStatsOptionsContext
176
+ ]>;
177
+ statsFactory: liteTapable.SyncHook<[StatsFactory, StatsOptions]>;
178
+ statsPrinter: liteTapable.SyncHook<[StatsPrinter, StatsOptions]>;
179
+ buildModule: liteTapable.SyncHook<[Module]>;
180
+ executeModule: liteTapable.SyncHook<[
181
+ ExecuteModuleArgument,
182
+ ExecuteModuleContext
183
+ ]>;
184
+ additionalTreeRuntimeRequirements: liteTapable.SyncHook<[
185
+ Chunk,
186
+ Set<string>
187
+ ]>;
188
+ runtimeRequirementInTree: liteTapable.HookMap<liteTapable.SyncBailHook<[Chunk, Set<string>], void>>;
189
+ runtimeModule: liteTapable.SyncHook<[RuntimeModule, Chunk]>;
190
+ seal: liteTapable.SyncHook<[]>;
191
+ afterSeal: liteTapable.AsyncSeriesHook<[], void>;
192
+ needAdditionalPass: liteTapable.SyncBailHook<[], boolean>;
193
+ }>;
194
+ name?: string;
195
+ startTime?: number;
196
+ endTime?: number;
197
+ compiler: Compiler;
198
+ resolverFactory: ResolverFactory;
199
+ inputFileSystem: InputFileSystem | null;
200
+ options: RspackOptionsNormalized;
201
+ outputOptions: OutputNormalized;
202
+ logging: Map<string, LogEntry[]>;
203
+ childrenCounters: Record<string, number>;
204
+ children: Compilation[];
205
+ chunkGraph: ChunkGraph;
206
+ moduleGraph: ModuleGraph;
207
+ fileSystemInfo: {
208
+ createSnapshot(): null;
209
+ };
210
+ needAdditionalPass: boolean;
211
+ [binding.COMPILATION_HOOKS_MAP_SYMBOL]: WeakMap<Compilation, NormalModuleCompilationHooks>;
212
+ constructor(compiler: Compiler, inner: JsCompilation);
213
+ get hash(): Readonly<string | null>;
214
+ get fullHash(): Readonly<string | null>;
215
+ /**
216
+ * Get a map of all assets.
217
+ */
218
+ get assets(): Record<string, Source>;
219
+ /**
220
+ * Get a map of all entrypoints.
221
+ */
222
+ get entrypoints(): ReadonlyMap<string, Entrypoint>;
223
+ get chunkGroups(): readonly ChunkGroup[];
224
+ /**
225
+ * Get the named chunk groups.
226
+ *
227
+ * Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
228
+ */
229
+ get namedChunkGroups(): ReadonlyMap<string, Readonly<ChunkGroup>>;
230
+ get modules(): ReadonlySet<Module>;
231
+ get builtModules(): ReadonlySet<Module>;
232
+ get chunks(): ReadonlySet<Chunk>;
233
+ /**
234
+ * Get the named chunks.
235
+ *
236
+ * Note: This is a proxy for webpack internal API, only method `get`, `keys`, `values` and `entries` are supported now.
237
+ */
238
+ get namedChunks(): ReadonlyMap<string, Readonly<binding.Chunk>>;
239
+ get entries(): Map<string, EntryData>;
240
+ get codeGenerationResults(): binding.CodeGenerationResults;
241
+ getCache(name: string): import("./lib/CacheFacade").CacheFacade;
242
+ createStatsOptions(statsValue: StatsValue | undefined, context?: CreateStatsOptionsContext): NormalizedStatsOptions;
243
+ createStatsFactory(options: StatsOptions): StatsFactory;
244
+ createStatsPrinter(options: StatsOptions): StatsPrinter;
245
+ /**
246
+ * Update an existing asset. Trying to update an asset that doesn't exist will throw an error.
247
+ */
248
+ updateAsset(filename: string, newSourceOrFunction: Source | ((source: Source) => Source), assetInfoUpdateOrFunction?: AssetInfo | ((assetInfo: AssetInfo) => AssetInfo | undefined)): void;
249
+ /**
250
+ * Emit an not existing asset. Trying to emit an asset that already exists will throw an error.
251
+ *
252
+ * @param file - file name
253
+ * @param source - asset source
254
+ * @param assetInfo - extra asset information
255
+ */
256
+ emitAsset(filename: string, source: Source, assetInfo?: AssetInfo): void;
257
+ deleteAsset(filename: string): void;
258
+ renameAsset(filename: string, newFilename: string): void;
259
+ /**
260
+ * Get an array of Asset
261
+ */
262
+ getAssets(): readonly Asset[];
263
+ getAsset(name: string): Readonly<Asset> | void;
264
+ /**
265
+ * Note: This is not a webpack public API, maybe removed in future.
266
+ *
267
+ * @internal
268
+ */
269
+ __internal__pushRspackDiagnostic(diagnostic: binding.JsRspackDiagnostic): void;
270
+ /**
271
+ * Note: This is not a webpack public API, maybe removed in future.
272
+ *
273
+ * @internal
274
+ */
275
+ __internal__pushDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void;
276
+ /**
277
+ * Note: This is not a webpack public API, maybe removed in future.
278
+ *
279
+ * @internal
280
+ */
281
+ __internal__pushDiagnostics(diagnostics: ExternalObject<'Diagnostic[]'>): void;
282
+ get errors(): RspackError[];
283
+ set errors(errors: RspackError[]);
284
+ get warnings(): RspackError[];
285
+ set warnings(warnings: RspackError[]);
286
+ getPath(filename: string, data?: PathData): string;
287
+ getPathWithInfo(filename: string, data?: PathData): binding.PathWithInfo;
288
+ getAssetPath(filename: string, data?: PathData): string;
289
+ getAssetPathWithInfo(filename: string, data?: PathData): binding.PathWithInfo;
290
+ getLogger(name: string | (() => string)): Logger;
291
+ fileDependencies: {
292
+ [Symbol.iterator](): Generator<string, void, unknown>;
293
+ has: (dep: string) => boolean;
294
+ add: (dep: string) => void;
295
+ addAll: (deps: Iterable<string>) => void;
296
+ delete: (dep: string) => boolean;
297
+ keys(): SetIterator<string>;
298
+ values(): SetIterator<string>;
299
+ entries(): SetIterator<[string, string]>;
300
+ readonly size: number;
301
+ };
302
+ get __internal__addedFileDependencies(): string[];
303
+ get __internal__removedFileDependencies(): string[];
304
+ get __internal__addedContextDependencies(): string[];
305
+ get __internal__removedContextDependencies(): string[];
306
+ get __internal__addedMissingDependencies(): string[];
307
+ get __internal__removedMissingDependencies(): string[];
308
+ contextDependencies: {
309
+ [Symbol.iterator](): Generator<string, void, unknown>;
310
+ has: (dep: string) => boolean;
311
+ add: (dep: string) => void;
312
+ addAll: (deps: Iterable<string>) => void;
313
+ delete: (dep: string) => boolean;
314
+ keys(): SetIterator<string>;
315
+ values(): SetIterator<string>;
316
+ entries(): SetIterator<[string, string]>;
317
+ readonly size: number;
318
+ };
319
+ missingDependencies: {
320
+ [Symbol.iterator](): Generator<string, void, unknown>;
321
+ has: (dep: string) => boolean;
322
+ add: (dep: string) => void;
323
+ addAll: (deps: Iterable<string>) => void;
324
+ delete: (dep: string) => boolean;
325
+ keys(): SetIterator<string>;
326
+ values(): SetIterator<string>;
327
+ entries(): SetIterator<[string, string]>;
328
+ readonly size: number;
329
+ };
330
+ buildDependencies: {
331
+ [Symbol.iterator](): Generator<string, void, unknown>;
332
+ has: (dep: string) => boolean;
333
+ add: (dep: string) => void;
334
+ addAll: (deps: Iterable<string>) => void;
335
+ delete: (dep: string) => boolean;
336
+ keys(): SetIterator<string>;
337
+ values(): SetIterator<string>;
338
+ entries(): SetIterator<[string, string]>;
339
+ readonly size: number;
340
+ };
341
+ getStats(): Stats;
342
+ createChildCompiler(name: string, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
343
+ rebuildModule(module: Module, f: (err: Error | null, module: Module | null) => void): void;
344
+ addRuntimeModule(chunk: Chunk, runtimeModule: RuntimeModule): void;
345
+ addInclude(context: string, dependency: ReturnType<typeof EntryPlugin.createDependency>, options: EntryOptions, callback: (err?: null | WebpackError, module?: Module) => void): void;
346
+ addEntry(context: string, dependency: ReturnType<typeof EntryPlugin.createDependency>, optionsOrName: EntryOptions | string, callback: (err?: null | WebpackError, module?: Module) => void): void;
347
+ getWarnings(): WebpackError[];
348
+ getErrors(): WebpackError[];
349
+ /**
350
+ * Get the `Source` of a given asset filename.
351
+ *
352
+ * Note: This is not a webpack public API, maybe removed in the future.
353
+ *
354
+ * @internal
355
+ */
356
+ __internal__getAssetSource(filename: string): Source | void;
357
+ /**
358
+ * Set the `Source` of an given asset filename.
359
+ *
360
+ * Note: This is not a webpack public API, maybe removed in future.
361
+ *
362
+ * @internal
363
+ */
364
+ __internal__setAssetSource(filename: string, source: Source): void;
365
+ /**
366
+ * Delete the `Source` of an given asset filename.
367
+ *
368
+ * Note: This is not a webpack public API, maybe removed in future.
369
+ *
370
+ * @internal
371
+ */
372
+ __internal__deleteAssetSource(filename: string): void;
373
+ /**
374
+ * Get a list of asset filenames.
375
+ *
376
+ * Note: This is not a webpack public API, maybe removed in future.
377
+ *
378
+ * @internal
379
+ */
380
+ __internal__getAssetFilenames(): string[];
381
+ /**
382
+ * Test if an asset exists.
383
+ *
384
+ * Note: This is not a webpack public API, maybe removed in future.
385
+ *
386
+ * @internal
387
+ */
388
+ __internal__hasAsset(name: string): boolean;
389
+ /**
390
+ * Note: This is not a webpack public API, maybe removed in future.
391
+ *
392
+ * @internal
393
+ */
394
+ __internal_getInner(): JsCompilation;
395
+ get __internal__shutdown(): boolean;
396
+ set __internal__shutdown(shutdown: boolean);
397
+ seal(): void;
398
+ unseal(): void;
399
+ static PROCESS_ASSETS_STAGE_ADDITIONAL: number;
400
+ static PROCESS_ASSETS_STAGE_PRE_PROCESS: number;
401
+ static PROCESS_ASSETS_STAGE_DERIVED: number;
402
+ static PROCESS_ASSETS_STAGE_ADDITIONS: number;
403
+ static PROCESS_ASSETS_STAGE_NONE: number;
404
+ static PROCESS_ASSETS_STAGE_OPTIMIZE: number;
405
+ static PROCESS_ASSETS_STAGE_OPTIMIZE_COUNT: number;
406
+ static PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY: number;
407
+ static PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE: number;
408
+ static PROCESS_ASSETS_STAGE_DEV_TOOLING: number;
409
+ static PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE: number;
410
+ static PROCESS_ASSETS_STAGE_SUMMARIZE: number;
411
+ static PROCESS_ASSETS_STAGE_OPTIMIZE_HASH: number;
412
+ static PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER: number;
413
+ static PROCESS_ASSETS_STAGE_ANALYSE: number;
414
+ static PROCESS_ASSETS_STAGE_REPORT: number;
415
+ }
416
+ export declare class EntryData {
417
+ dependencies: Dependency[];
418
+ includeDependencies: Dependency[];
419
+ options: binding.JsEntryOptions;
420
+ static __from_binding(binding: binding.JsEntryData): EntryData;
421
+ private constructor();
422
+ }
423
+ export declare class Entries implements Map<string, EntryData> {
424
+ #private;
425
+ constructor(data: binding.JsEntries);
426
+ clear(): void;
427
+ forEach(callback: (value: EntryData, key: string, map: Map<string, EntryData>) => void, thisArg?: any): void;
428
+ get size(): number;
429
+ entries(): ReturnType<Map<string, EntryData>['entries']>;
430
+ values(): ReturnType<Map<string, EntryData>['values']>;
431
+ [Symbol.iterator](): ReturnType<Map<string, EntryData>['entries']>;
432
+ readonly [Symbol.toStringTag] = "Map";
433
+ has(key: string): boolean;
434
+ set(key: string, value: EntryData): this;
435
+ delete(key: string): boolean;
436
+ get(key: string): EntryData | undefined;
437
+ keys(): ReturnType<Map<string, EntryData>['keys']>;
438
+ }
@@ -0,0 +1,226 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3bb53f36a5b8fc6bc1bd976ed7af161bd80/lib/Compiler.js
4
+ *
5
+ * MIT Licensed
6
+ * Author Tobias Koppers @sokra
7
+ * Copyright (c) JS Foundation and other contributors
8
+ * https://github.com/webpack/webpack/blob/main/LICENSE
9
+ */
10
+ import type binding from '@rspack/binding';
11
+ import * as liteTapable from '@rspack/lite-tapable';
12
+ import type Watchpack from '../compiled/watchpack';
13
+ import type { Source } from '../compiled/webpack-sources';
14
+ import type { Chunk } from './Chunk';
15
+ import type { CompilationParams } from './Compilation';
16
+ import { Compilation } from './Compilation';
17
+ import { ContextModuleFactory } from './ContextModuleFactory';
18
+ import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from './config';
19
+ import type { PlatformTargetProperties } from './config/target';
20
+ import type { FileSystemInfoEntry } from './FileSystemInfo';
21
+ import type { rspack } from './index';
22
+ import Cache from './lib/Cache';
23
+ import CacheFacade from './lib/CacheFacade';
24
+ import { Logger } from './logging/Logger';
25
+ import { NormalModuleFactory } from './NormalModuleFactory';
26
+ import { ResolverFactory } from './ResolverFactory';
27
+ import { RuleSetCompiler } from './RuleSetCompiler';
28
+ import { Stats } from './Stats';
29
+ import type { InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from './util/fs';
30
+ import { Watching } from './Watching';
31
+ export interface AssetEmittedInfo {
32
+ content: Buffer;
33
+ source: Source;
34
+ outputPath: string;
35
+ targetPath: string;
36
+ compilation: Compilation;
37
+ }
38
+ export type CompilerHooks = {
39
+ done: liteTapable.AsyncSeriesHook<Stats>;
40
+ afterDone: liteTapable.SyncHook<Stats>;
41
+ thisCompilation: liteTapable.SyncHook<[Compilation, CompilationParams]>;
42
+ compilation: liteTapable.SyncHook<[Compilation, CompilationParams]>;
43
+ invalid: liteTapable.SyncHook<[string | null, number]>;
44
+ compile: liteTapable.SyncHook<[CompilationParams]>;
45
+ normalModuleFactory: liteTapable.SyncHook<NormalModuleFactory>;
46
+ contextModuleFactory: liteTapable.SyncHook<ContextModuleFactory>;
47
+ initialize: liteTapable.SyncHook<[]>;
48
+ shouldEmit: liteTapable.SyncBailHook<[Compilation], boolean>;
49
+ /**
50
+ * Called when infrastructure logging is triggered, allowing plugins to intercept, modify, or handle log messages.
51
+ * If the hook returns `true`, the default infrastructure logging will be prevented.
52
+ * If it returns `undefined`, the default logging will proceed.
53
+ * @param name - The name of the logger
54
+ * @param type - The log type (e.g., 'log', 'warn', 'error', ...)
55
+ * @param args - An array of arguments passed to the logging method
56
+ */
57
+ infrastructureLog: liteTapable.SyncBailHook<[
58
+ string,
59
+ string,
60
+ any[]
61
+ ], true | void>;
62
+ beforeRun: liteTapable.AsyncSeriesHook<[Compiler]>;
63
+ run: liteTapable.AsyncSeriesHook<[Compiler]>;
64
+ emit: liteTapable.AsyncSeriesHook<[Compilation]>;
65
+ assetEmitted: liteTapable.AsyncSeriesHook<[string, AssetEmittedInfo]>;
66
+ afterEmit: liteTapable.AsyncSeriesHook<[Compilation]>;
67
+ failed: liteTapable.SyncHook<[Error]>;
68
+ shutdown: liteTapable.AsyncSeriesHook<[]>;
69
+ watchRun: liteTapable.AsyncSeriesHook<[Compiler]>;
70
+ watchClose: liteTapable.SyncHook<[]>;
71
+ environment: liteTapable.SyncHook<[]>;
72
+ afterEnvironment: liteTapable.SyncHook<[]>;
73
+ afterPlugins: liteTapable.SyncHook<[Compiler]>;
74
+ afterResolvers: liteTapable.SyncHook<[Compiler]>;
75
+ make: liteTapable.AsyncParallelHook<[Compilation]>;
76
+ beforeCompile: liteTapable.AsyncSeriesHook<[CompilationParams]>;
77
+ afterCompile: liteTapable.AsyncSeriesHook<[Compilation]>;
78
+ finishMake: liteTapable.AsyncSeriesHook<[Compilation]>;
79
+ entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
80
+ additionalPass: liteTapable.AsyncSeriesHook<[]>;
81
+ };
82
+ declare class Compiler {
83
+ #private;
84
+ hooks: CompilerHooks;
85
+ webpack: typeof rspack;
86
+ rspack: typeof rspack;
87
+ name?: string;
88
+ parentCompilation?: Compilation;
89
+ root: Compiler;
90
+ outputPath: string;
91
+ running: boolean;
92
+ idle: boolean;
93
+ resolverFactory: ResolverFactory;
94
+ infrastructureLogger: any;
95
+ watching?: Watching;
96
+ inputFileSystem: InputFileSystem | null;
97
+ intermediateFileSystem: IntermediateFileSystem | null;
98
+ outputFileSystem: OutputFileSystem | null;
99
+ watchFileSystem: WatchFileSystem | null;
100
+ records: Record<string, any[]>;
101
+ modifiedFiles?: ReadonlySet<string>;
102
+ removedFiles?: ReadonlySet<string>;
103
+ fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
104
+ contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
105
+ fsStartTime?: number;
106
+ watchMode: boolean;
107
+ context: string;
108
+ cache: Cache;
109
+ compilerPath: string;
110
+ options: RspackOptionsNormalized;
111
+ /**
112
+ * Whether to skip dropping Rust compiler instance to improve performance.
113
+ * This is an internal option api and could be removed or changed at any time.
114
+ * @internal
115
+ * true: Skip dropping Rust compiler instance.
116
+ * false: Drop Rust compiler instance when Compiler is garbage collected.
117
+ */
118
+ unsafeFastDrop: boolean;
119
+ /**
120
+ * Note: This is not a webpack public API, maybe removed in future.
121
+ * @internal
122
+ */
123
+ __internal_browser_require: (id: string) => unknown;
124
+ constructor(context: string, options: RspackOptionsNormalized);
125
+ get recordsInputPath(): never;
126
+ get recordsOutputPath(): never;
127
+ get managedPaths(): never;
128
+ get immutablePaths(): never;
129
+ get _lastCompilation(): Compilation | undefined;
130
+ get platform(): PlatformTargetProperties;
131
+ set platform(platform: PlatformTargetProperties);
132
+ /**
133
+ * Note: This is not a webpack public API, maybe removed in future.
134
+ * @internal
135
+ */
136
+ get __internal__builtinPlugins(): binding.BuiltinPlugin[];
137
+ /**
138
+ * Note: This is not a webpack public API, maybe removed in future.
139
+ * @internal
140
+ */
141
+ get __internal__ruleSet(): RuleSetCompiler;
142
+ /**
143
+ * @param name - cache name
144
+ * @returns the cache facade instance
145
+ */
146
+ getCache(name: string): CacheFacade;
147
+ /**
148
+ * @param name - name of the logger, or function called once to get the logger name
149
+ * @returns a logger with that name
150
+ */
151
+ getInfrastructureLogger(name: string | (() => string)): Logger;
152
+ /**
153
+ * @param watchOptions - the watcher's options
154
+ * @param handler - signals when the call finishes
155
+ * @returns a compiler watcher
156
+ */
157
+ watch(watchOptions: Watchpack.WatchOptions, handler: liteTapable.Callback<Error, Stats>): Watching;
158
+ /**
159
+ * @param callback - signals when the call finishes
160
+ * @param options - additional data like modifiedFiles, removedFiles
161
+ */
162
+ run(callback: liteTapable.Callback<Error, Stats>, options?: {
163
+ modifiedFiles?: ReadonlySet<string>;
164
+ removedFiles?: ReadonlySet<string>;
165
+ }): void;
166
+ runAsChild(callback: (err?: null | Error, entries?: Chunk[], compilation?: Compilation) => any): void;
167
+ purgeInputFileSystem(): void;
168
+ /**
169
+ * @param compilation - the compilation
170
+ * @param compilerName - the compiler's name
171
+ * @param compilerIndex - the compiler's index
172
+ * @param outputOptions - the output options
173
+ * @param plugins - the plugins to apply
174
+ * @returns a child compiler
175
+ */
176
+ createChildCompiler(compilation: Compilation, compilerName: string, compilerIndex: number, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
177
+ isChild(): boolean;
178
+ /**
179
+ * Create a compilation and run it, which is the basic method that `compiler.run` and `compiler.watch` depend on.
180
+ * TODO: make this method private in the next major release
181
+ * @private this method is only used in Rspack core
182
+ */
183
+ compile(callback: liteTapable.Callback<Error, Compilation>): void;
184
+ close(callback: (error?: Error | null) => void): void;
185
+ /**
186
+ * Note: This is not a webpack public API, maybe removed in future.
187
+ * @internal
188
+ */
189
+ __internal__rebuild(modifiedFiles?: ReadonlySet<string>, removedFiles?: ReadonlySet<string>, callback?: (error: Error | null) => void): void;
190
+ /**
191
+ * Note: This is not a webpack public API, maybe removed in future.
192
+ * @internal
193
+ */
194
+ __internal__create_compilation(native: binding.JsCompilation): Compilation;
195
+ /**
196
+ * Note: This is not a webpack public API, maybe removed in future.
197
+ * @internal
198
+ */
199
+ __internal__get_virtual_file_store(): binding.VirtualFileStore | null | undefined;
200
+ /**
201
+ * Note: This is not a webpack public API, maybe removed in future.
202
+ * @internal
203
+ */
204
+ __internal__registerBuiltinPlugin(plugin: binding.BuiltinPlugin): void;
205
+ /**
206
+ * Note: This is not a webpack public API, maybe removed in future.
207
+ * @internal
208
+ */
209
+ __internal__takeModuleExecutionResult(id: number): any;
210
+ /**
211
+ * Note: This is not a webpack public API, maybe removed in future.
212
+ * @internal
213
+ */
214
+ __internal__get_compilation(): Compilation | undefined;
215
+ /**
216
+ * Note: This is not a webpack public API, maybe removed in future.
217
+ * @internal
218
+ */
219
+ __internal__get_compilation_params(): CompilationParams | undefined;
220
+ /**
221
+ * Note: This is not a webpack public API, maybe removed in future.
222
+ * @internal
223
+ */
224
+ __internal__get_module_execution_results_map(): Map<number, any>;
225
+ }
226
+ export { Compiler };
@@ -0,0 +1 @@
1
+ export { ConcatenatedModule } from '@rspack/binding';
@@ -0,0 +1 @@
1
+ export { ContextModule } from '@rspack/binding';
@@ -0,0 +1,13 @@
1
+ import * as liteTapable from '@rspack/lite-tapable';
2
+ import type { ContextModuleFactoryAfterResolveResult, ContextModuleFactoryBeforeResolveResult } from './Module';
3
+ export declare class ContextModuleFactory {
4
+ hooks: {
5
+ beforeResolve: liteTapable.AsyncSeriesWaterfallHook<[
6
+ ContextModuleFactoryBeforeResolveResult
7
+ ], ContextModuleFactoryBeforeResolveResult | void>;
8
+ afterResolve: liteTapable.AsyncSeriesWaterfallHook<[
9
+ ContextModuleFactoryAfterResolveResult
10
+ ], ContextModuleFactoryAfterResolveResult | void>;
11
+ };
12
+ constructor();
13
+ }
@@ -0,0 +1,7 @@
1
+ import type { Diagnostics } from '@rspack/binding';
2
+ import type { RspackError } from './RspackError';
3
+ declare const $proxy: unique symbol;
4
+ export declare function createDiagnosticArray(adm: Diagnostics & {
5
+ [$proxy]?: RspackError[];
6
+ }): RspackError[];
7
+ export {};