@rspack-debug/browser 0.0.0-alpha.0 → 1.6.4

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 (252) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +15 -0
  3. package/dist/BuildInfo.d.ts +17 -0
  4. package/dist/Chunk.d.ts +16 -0
  5. package/dist/ChunkGraph.d.ts +9 -0
  6. package/dist/Chunks.d.ts +12 -0
  7. package/dist/CodeGenerationResults.d.ts +1 -0
  8. package/dist/Compilation.d.ts +417 -0
  9. package/dist/Compiler.d.ts +223 -0
  10. package/dist/ConcatenatedModule.d.ts +1 -0
  11. package/dist/ContextModule.d.ts +1 -0
  12. package/dist/ContextModuleFactory.d.ts +13 -0
  13. package/dist/Diagnostics.d.ts +7 -0
  14. package/dist/Entrypoint.d.ts +2 -0
  15. package/dist/ErrorHelpers.d.ts +3 -0
  16. package/dist/ExecuteModulePlugin.d.ts +4 -0
  17. package/dist/ExportsInfo.d.ts +20 -0
  18. package/dist/ExternalModule.d.ts +1 -0
  19. package/dist/FileSystem.d.ts +54 -0
  20. package/dist/FileSystemInfo.d.ts +5 -0
  21. package/dist/Module.d.ts +42 -0
  22. package/dist/ModuleGraph.d.ts +19 -0
  23. package/dist/ModuleTypeConstants.d.ts +8 -0
  24. package/dist/MultiCompiler.d.ts +82 -0
  25. package/dist/MultiStats.d.ts +23 -0
  26. package/dist/MultiWatching.d.ts +27 -0
  27. package/dist/NativeWatchFileSystem.d.ts +23 -0
  28. package/dist/NormalModule.d.ts +15 -0
  29. package/dist/NormalModuleFactory.d.ts +23 -0
  30. package/dist/Resolver.d.ts +30 -0
  31. package/dist/ResolverFactory.d.ts +17 -0
  32. package/dist/RspackError.d.ts +12 -0
  33. package/dist/RuleSetCompiler.d.ts +9 -0
  34. package/dist/RuntimeGlobals.d.ts +328 -0
  35. package/dist/RuntimeModule.d.ts +32 -0
  36. package/dist/Stats.d.ts +17 -0
  37. package/dist/Template.d.ts +77 -0
  38. package/dist/VirtualModulesPlugin.d.ts +12 -0
  39. package/dist/Watching.d.ts +56 -0
  40. package/dist/binding.d.ts +8 -0
  41. package/dist/browser/BrowserHttpImportEsmPlugin.d.ts +48 -0
  42. package/dist/browser/BrowserRequirePlugin.d.ts +38 -0
  43. package/dist/browser/buffer.d.ts +1 -0
  44. package/dist/browser/fs.d.ts +13 -0
  45. package/dist/browser/index.d.ts +11 -0
  46. package/dist/browser/service.d.ts +25 -0
  47. package/dist/builtin-loader/index.d.ts +1 -0
  48. package/dist/builtin-loader/lightningcss/index.d.ts +117 -0
  49. package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +21 -0
  50. package/dist/builtin-loader/swc/index.d.ts +5 -0
  51. package/dist/builtin-loader/swc/pluginImport.d.ts +33 -0
  52. package/dist/builtin-loader/swc/types.d.ts +83 -0
  53. package/dist/builtin-plugin/APIPlugin.d.ts +9 -0
  54. package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +9 -0
  55. package/dist/builtin-plugin/AssetModulesPlugin.d.ts +9 -0
  56. package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +9 -0
  57. package/dist/builtin-plugin/BannerPlugin.d.ts +40 -0
  58. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +14 -0
  59. package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +9 -0
  60. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +59 -0
  61. package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +9 -0
  62. package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +9 -0
  63. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +14 -0
  64. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +21 -0
  65. package/dist/builtin-plugin/CssModulesPlugin.d.ts +9 -0
  66. package/dist/builtin-plugin/DataUriPlugin.d.ts +9 -0
  67. package/dist/builtin-plugin/DefinePlugin.d.ts +16 -0
  68. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +7 -0
  69. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +7 -0
  70. package/dist/builtin-plugin/DllEntryPlugin.d.ts +12 -0
  71. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +11 -0
  72. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +12 -0
  73. package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +9 -0
  74. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +25 -0
  75. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +11 -0
  76. package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +9 -0
  77. package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +9 -0
  78. package/dist/builtin-plugin/EntryPlugin.d.ts +32 -0
  79. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +11 -0
  80. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +11 -0
  81. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +10 -0
  82. package/dist/builtin-plugin/ExternalsPlugin.d.ts +12 -0
  83. package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +9 -0
  84. package/dist/builtin-plugin/FileUriPlugin.d.ts +9 -0
  85. package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +9 -0
  86. package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +9 -0
  87. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +9 -0
  88. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +7 -0
  89. package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +9 -0
  90. package/dist/builtin-plugin/HttpUriPlugin.d.ts +36 -0
  91. package/dist/builtin-plugin/IgnorePlugin.d.ts +19 -0
  92. package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +9 -0
  93. package/dist/builtin-plugin/InlineExportsPlugin.d.ts +9 -0
  94. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +15 -0
  95. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +10 -0
  96. package/dist/builtin-plugin/JsonModulesPlugin.d.ts +9 -0
  97. package/dist/builtin-plugin/LibManifestPlugin.d.ts +17 -0
  98. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +32 -0
  99. package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +14 -0
  100. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +9 -0
  101. package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +9 -0
  102. package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +9 -0
  103. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +7 -0
  104. package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +9 -0
  105. package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +9 -0
  106. package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +9 -0
  107. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +7 -0
  108. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +7 -0
  109. package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +9 -0
  110. package/dist/builtin-plugin/NodeTargetPlugin.d.ts +9 -0
  111. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +10 -0
  112. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +10 -0
  113. package/dist/builtin-plugin/ProgressPlugin.d.ts +11 -0
  114. package/dist/builtin-plugin/ProvidePlugin.d.ts +10 -0
  115. package/dist/builtin-plugin/RealContentHashPlugin.d.ts +9 -0
  116. package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +9 -0
  117. package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +9 -0
  118. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +49 -0
  119. package/dist/builtin-plugin/RslibPlugin.d.ts +11 -0
  120. package/dist/builtin-plugin/RstestPlugin.d.ts +11 -0
  121. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +11 -0
  122. package/dist/builtin-plugin/RuntimePlugin.d.ts +28 -0
  123. package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -0
  124. package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +19 -0
  125. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +11 -0
  126. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +11 -0
  127. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +39 -0
  128. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +215 -0
  129. package/dist/builtin-plugin/URLPlugin.d.ts +9 -0
  130. package/dist/builtin-plugin/WarnCaseSensitiveModulesPlugin.d.ts +9 -0
  131. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +7 -0
  132. package/dist/builtin-plugin/WorkerPlugin.d.ts +13 -0
  133. package/dist/builtin-plugin/base.d.ts +45 -0
  134. package/dist/builtin-plugin/css-extract/index.d.ts +24 -0
  135. package/dist/builtin-plugin/css-extract/loader.d.ts +21 -0
  136. package/dist/builtin-plugin/css-extract/utils.d.ts +6 -0
  137. package/dist/builtin-plugin/html-plugin/hooks.d.ts +32 -0
  138. package/dist/builtin-plugin/html-plugin/index.d.ts +2 -0
  139. package/dist/builtin-plugin/html-plugin/options.d.ts +82 -0
  140. package/dist/builtin-plugin/html-plugin/plugin.d.ts +24 -0
  141. package/dist/builtin-plugin/html-plugin/taps.d.ts +2 -0
  142. package/dist/builtin-plugin/index.d.ts +84 -0
  143. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +10 -0
  144. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -0
  145. package/dist/config/adapter.d.ts +8 -0
  146. package/dist/config/adapterRuleUse.d.ts +391 -0
  147. package/dist/config/browserslistTargetHandler.d.ts +15 -0
  148. package/dist/config/defaults.d.ts +4 -0
  149. package/dist/config/devServer.d.ts +314 -0
  150. package/dist/config/index.d.ts +5 -0
  151. package/dist/config/normalization.d.ts +169 -0
  152. package/dist/config/target.d.ts +89 -0
  153. package/dist/config/types.d.ts +2383 -0
  154. package/dist/container/ContainerPlugin.d.ts +40 -0
  155. package/dist/container/ContainerReferencePlugin.d.ts +33 -0
  156. package/dist/container/ModuleFederationManifestPlugin.d.ts +37 -0
  157. package/dist/container/ModuleFederationPlugin.d.ts +15 -0
  158. package/dist/container/ModuleFederationPluginV1.d.ts +22 -0
  159. package/dist/container/ModuleFederationRuntimePlugin.d.ts +12 -0
  160. package/dist/container/index.d.ts +4 -0
  161. package/dist/container/options.d.ts +3 -0
  162. package/dist/error/ConcurrentCompilationError.d.ts +14 -0
  163. package/dist/exports.d.ts +166 -0
  164. package/dist/index.d.ts +10 -0
  165. package/dist/index.mjs +66931 -0
  166. package/dist/index.mjs.LICENSE.txt +19 -0
  167. package/dist/lib/AbstractMethodError.d.ts +23 -0
  168. package/dist/lib/Cache.d.ts +65 -0
  169. package/dist/lib/CacheFacade.d.ts +139 -0
  170. package/dist/lib/DllPlugin.d.ts +42 -0
  171. package/dist/lib/DllReferencePlugin.d.ts +119 -0
  172. package/dist/lib/EntryOptionPlugin.d.ts +33 -0
  173. package/dist/lib/EnvironmentPlugin.d.ts +22 -0
  174. package/dist/lib/HookWebpackError.d.ts +40 -0
  175. package/dist/lib/IgnoreWarningsPlugin.d.ts +25 -0
  176. package/dist/lib/LoaderOptionsPlugin.d.ts +28 -0
  177. package/dist/lib/LoaderTargetPlugin.d.ts +24 -0
  178. package/dist/lib/ModuleFilenameHelpers.d.ts +53 -0
  179. package/dist/lib/WebpackError.d.ts +21 -0
  180. package/dist/lib/cache/MemoryCachePlugin.d.ts +5 -0
  181. package/dist/lib/cache/getLazyHashedEtag.d.ts +35 -0
  182. package/dist/lib/cache/mergeEtags.d.ts +17 -0
  183. package/dist/loader-runner/LoaderLoadingError.d.ts +13 -0
  184. package/dist/loader-runner/ModuleError.d.ts +13 -0
  185. package/dist/loader-runner/index.d.ts +34 -0
  186. package/dist/loader-runner/loadLoader.d.ts +12 -0
  187. package/dist/loader-runner/service.d.ts +71 -0
  188. package/dist/loader-runner/utils.d.ts +7 -0
  189. package/dist/loader-runner/worker.d.ts +14 -0
  190. package/dist/logging/Logger.d.ts +61 -0
  191. package/dist/logging/createConsoleLogger.d.ts +35 -0
  192. package/dist/logging/truncateArgs.d.ts +16 -0
  193. package/dist/napi-binding.d.ts +3128 -0
  194. package/dist/node/NodeEnvironmentPlugin.d.ts +10 -0
  195. package/dist/node/NodeTemplatePlugin.d.ts +18 -0
  196. package/dist/node/NodeWatchFileSystem.d.ts +18 -0
  197. package/dist/node/nodeConsole.d.ts +15 -0
  198. package/dist/rspack.d.ts +16 -0
  199. package/dist/rspack.wasi-browser.js +125 -0
  200. package/dist/rspackOptionsApply.d.ts +4 -0
  201. package/dist/runtime/cssExtractHmr.d.ts +4 -0
  202. package/dist/runtime/moduleFederationDefaultRuntime.d.ts +2 -0
  203. package/dist/sharing/ConsumeSharedPlugin.d.ts +41 -0
  204. package/dist/sharing/ProvideSharedPlugin.d.ts +34 -0
  205. package/dist/sharing/SharePlugin.d.ts +51 -0
  206. package/dist/sharing/ShareRuntimePlugin.d.ts +9 -0
  207. package/dist/sharing/utils.d.ts +1 -0
  208. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +20 -0
  209. package/dist/stats/DefaultStatsPresetPlugin.d.ts +4 -0
  210. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +13 -0
  211. package/dist/stats/StatsFactory.d.ts +57 -0
  212. package/dist/stats/StatsPrinter.d.ts +57 -0
  213. package/dist/stats/statsFactoryUtils.d.ts +341 -0
  214. package/dist/swc.d.ts +7 -0
  215. package/dist/taps/compilation.d.ts +8 -0
  216. package/dist/taps/compiler.d.ts +2 -0
  217. package/dist/taps/contextModuleFactory.d.ts +2 -0
  218. package/dist/taps/index.d.ts +6 -0
  219. package/dist/taps/javascriptModules.d.ts +2 -0
  220. package/dist/taps/normalModuleFactory.d.ts +2 -0
  221. package/dist/taps/types.d.ts +11 -0
  222. package/dist/trace/index.d.ts +46 -0
  223. package/dist/trace/traceHookPlugin.d.ts +5 -0
  224. package/dist/util/ArrayQueue.d.ts +45 -0
  225. package/dist/util/AsyncTask.d.ts +7 -0
  226. package/dist/util/MergeCaller.d.ts +10 -0
  227. package/dist/util/SizeFormatHelpers.d.ts +10 -0
  228. package/dist/util/SplitChunkSize.d.ts +5 -0
  229. package/dist/util/assertNotNil.d.ts +1 -0
  230. package/dist/util/assetCondition.d.ts +2 -0
  231. package/dist/util/asyncLib.d.ts +54 -0
  232. package/dist/util/bindingVersionCheck.d.ts +5 -0
  233. package/dist/util/cleverMerge.d.ts +24 -0
  234. package/dist/util/comparators.d.ts +16 -0
  235. package/dist/util/createHash.d.ts +16 -0
  236. package/dist/util/createReadonlyMap.d.ts +1 -0
  237. package/dist/util/fake.d.ts +9 -0
  238. package/dist/util/fs.d.ts +375 -0
  239. package/dist/util/hash/index.d.ts +26 -0
  240. package/dist/util/hash/md4.d.ts +11 -0
  241. package/dist/util/hash/wasm-hash.d.ts +51 -0
  242. package/dist/util/hash/xxhash64.d.ts +11 -0
  243. package/dist/util/identifier.d.ts +31 -0
  244. package/dist/util/index.d.ts +8 -0
  245. package/dist/util/memoize.d.ts +2 -0
  246. package/dist/util/runtime.d.ts +2 -0
  247. package/dist/util/smartGrouping.d.ts +21 -0
  248. package/dist/util/source.d.ts +6 -0
  249. package/dist/util/validateConfig.d.ts +5 -0
  250. package/dist/wasi-worker-browser.mjs +23591 -0
  251. package/dist/wasi-worker-browser.mjs.LICENSE.txt +12 -0
  252. package/package.json +48 -9
@@ -0,0 +1,17 @@
1
+ import binding from "./binding";
2
+ import { type Resolve } from "./config";
3
+ import { Resolver } from "./Resolver";
4
+ export type ResolveOptionsWithDependencyType = Resolve & {
5
+ dependencyType?: string;
6
+ resolveToContext?: boolean;
7
+ };
8
+ export type WithOptions = {
9
+ withOptions: (options: ResolveOptionsWithDependencyType) => ResolverWithOptions;
10
+ };
11
+ export type ResolverWithOptions = Resolver & WithOptions;
12
+ export declare class ResolverFactory {
13
+ #private;
14
+ static __to_binding(resolver_factory: ResolverFactory): binding.JsResolverFactory;
15
+ constructor(pnp: boolean, resolveOptions: Resolve, loaderResolveOptions: Resolve);
16
+ get(type: string, resolveOptions?: ResolveOptionsWithDependencyType): ResolverWithOptions;
17
+ }
@@ -0,0 +1,12 @@
1
+ import type binding from "./binding";
2
+ export type { RspackError } from "./binding";
3
+ export type RspackSeverity = binding.JsRspackSeverity;
4
+ export declare class NonErrorEmittedError extends Error {
5
+ constructor(error: Error);
6
+ }
7
+ export declare class DeadlockRiskError extends Error {
8
+ constructor(message: string);
9
+ }
10
+ export declare class ValidationError extends Error {
11
+ constructor(message: string);
12
+ }
@@ -0,0 +1,9 @@
1
+ declare class RuleSetCompiler {
2
+ references: Map<string, any>;
3
+ /**
4
+ * builtin references that should be serializable and passed to Rust.
5
+ */
6
+ builtinReferences: Map<string, any>;
7
+ constructor();
8
+ }
9
+ export { RuleSetCompiler };
@@ -0,0 +1,328 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/v5.88.2/lib/RuntimeGlobals.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 { JsRuntimeGlobals } from "./binding";
11
+ export declare function __from_binding_runtime_globals(runtimeRequirements: JsRuntimeGlobals): Set<string>;
12
+ export declare function __to_binding_runtime_globals(runtimeRequirements: Set<string>): JsRuntimeGlobals;
13
+ export declare const RuntimeGlobals: {
14
+ /**
15
+ * the internal require function
16
+ */
17
+ readonly require: "__webpack_require__";
18
+ /**
19
+ * access to properties of the internal require function/object
20
+ */
21
+ readonly requireScope: "__webpack_require__.*";
22
+ /**
23
+ * the internal exports object
24
+ */
25
+ readonly exports: "__webpack_exports__";
26
+ /**
27
+ * top-level this need to be the exports object
28
+ */
29
+ readonly thisAsExports: "top-level-this-exports";
30
+ /**
31
+ * runtime need to return the exports of the last entry module
32
+ */
33
+ readonly returnExportsFromRuntime: "return-exports-from-runtime";
34
+ /**
35
+ * the internal module object
36
+ */
37
+ readonly module: "module";
38
+ /**
39
+ * the internal module object
40
+ */
41
+ readonly moduleId: "module.id";
42
+ /**
43
+ * the internal module object
44
+ */
45
+ readonly moduleLoaded: "module.loaded";
46
+ /**
47
+ * the bundle public path
48
+ */
49
+ readonly publicPath: "__webpack_require__.p";
50
+ /**
51
+ * the module id of the entry point
52
+ */
53
+ readonly entryModuleId: "__webpack_require__.s";
54
+ /**
55
+ * the module cache
56
+ */
57
+ readonly moduleCache: "__webpack_require__.c";
58
+ /**
59
+ * the module functions
60
+ */
61
+ readonly moduleFactories: "__webpack_require__.m";
62
+ /**
63
+ * the module functions, with only write access
64
+ */
65
+ readonly moduleFactoriesAddOnly: "__webpack_require__.m (add only)";
66
+ /**
67
+ * the chunk ensure function
68
+ */
69
+ readonly ensureChunk: "__webpack_require__.e";
70
+ /**
71
+ * an object with handlers to ensure a chunk
72
+ */
73
+ readonly ensureChunkHandlers: "__webpack_require__.f";
74
+ /**
75
+ * a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
76
+ */
77
+ readonly ensureChunkIncludeEntries: "__webpack_require__.f (include entries)";
78
+ /**
79
+ * the chunk prefetch function
80
+ */
81
+ readonly prefetchChunk: "__webpack_require__.E";
82
+ /**
83
+ * an object with handlers to prefetch a chunk
84
+ */
85
+ readonly prefetchChunkHandlers: "__webpack_require__.F";
86
+ /**
87
+ * the chunk preload function
88
+ */
89
+ readonly preloadChunk: "__webpack_require__.G";
90
+ /**
91
+ * an object with handlers to preload a chunk
92
+ */
93
+ readonly preloadChunkHandlers: "__webpack_require__.H";
94
+ /**
95
+ * the exported property define getters function
96
+ */
97
+ readonly definePropertyGetters: "__webpack_require__.d";
98
+ /**
99
+ * define compatibility on export
100
+ */
101
+ readonly makeNamespaceObject: "__webpack_require__.r";
102
+ /**
103
+ * create a fake namespace object
104
+ */
105
+ readonly createFakeNamespaceObject: "__webpack_require__.t";
106
+ /**
107
+ * compatibility get default export
108
+ */
109
+ readonly compatGetDefaultExport: "__webpack_require__.n";
110
+ /**
111
+ * ES modules decorator
112
+ */
113
+ readonly harmonyModuleDecorator: "__webpack_require__.hmd";
114
+ /**
115
+ * node.js module decorator
116
+ */
117
+ readonly nodeModuleDecorator: "__webpack_require__.nmd";
118
+ /**
119
+ * the webpack hash
120
+ */
121
+ readonly getFullHash: "__webpack_require__.h";
122
+ /**
123
+ * an object containing all installed WebAssembly.Instance export objects keyed by module id
124
+ */
125
+ readonly wasmInstances: "__webpack_require__.w";
126
+ /**
127
+ * instantiate a wasm instance from module exports object, id, hash and importsObject
128
+ */
129
+ readonly instantiateWasm: "__webpack_require__.v";
130
+ /**
131
+ * the uncaught error handler for the webpack runtime
132
+ */
133
+ readonly uncaughtErrorHandler: "__webpack_require__.oe";
134
+ /**
135
+ * the script nonce
136
+ */
137
+ readonly scriptNonce: "__webpack_require__.nc";
138
+ /**
139
+ * function to load a script tag.
140
+ * Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
141
+ * done function is called when loading has finished or timeout occurred.
142
+ * It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
143
+ */
144
+ readonly loadScript: "__webpack_require__.l";
145
+ /**
146
+ * function to promote a string to a TrustedScript using webpack's Trusted
147
+ * Types policy
148
+ * Arguments: (script: string) =\> TrustedScript
149
+ */
150
+ readonly createScript: "__webpack_require__.ts";
151
+ /**
152
+ * function to promote a string to a TrustedScriptURL using webpack's Trusted
153
+ * Types policy
154
+ * Arguments: (url: string) =\> TrustedScriptURL
155
+ */
156
+ readonly createScriptUrl: "__webpack_require__.tu";
157
+ /**
158
+ * function to return webpack's Trusted Types policy
159
+ * Arguments: () =\> TrustedTypePolicy
160
+ */
161
+ readonly getTrustedTypesPolicy: "__webpack_require__.tt";
162
+ /**
163
+ * a flag when a chunk has a fetch priority
164
+ */
165
+ readonly hasFetchPriority: "has fetch priority";
166
+ /**
167
+ * the chunk name of the chunk with the runtime
168
+ */
169
+ readonly chunkName: "__webpack_require__.cn";
170
+ /**
171
+ * the runtime id of the current runtime
172
+ */
173
+ readonly runtimeId: "__webpack_require__.j";
174
+ /**
175
+ * the filename of the script part of the chunk
176
+ */
177
+ readonly getChunkScriptFilename: "__webpack_require__.u";
178
+ /**
179
+ * the filename of the css part of the chunk
180
+ */
181
+ readonly getChunkCssFilename: "__webpack_require__.k";
182
+ /**
183
+ * a flag when a module/chunk/tree has css modules
184
+ */
185
+ readonly hasCssModules: "has css modules";
186
+ /**
187
+ * the filename of the script part of the hot update chunk
188
+ */
189
+ readonly getChunkUpdateScriptFilename: "__webpack_require__.hu";
190
+ /**
191
+ * the filename of the css part of the hot update chunk
192
+ */
193
+ readonly getChunkUpdateCssFilename: "__webpack_require__.hk";
194
+ /**
195
+ * startup signal from runtime
196
+ * This will be called when the runtime chunk has been loaded.
197
+ */
198
+ readonly startup: "__webpack_require__.x";
199
+ /**
200
+ * @deprecated
201
+ * creating a default startup function with the entry modules
202
+ */
203
+ readonly startupNoDefault: "__webpack_require__.x (no default handler)";
204
+ /**
205
+ * startup signal from runtime but only used to add logic after the startup
206
+ */
207
+ readonly startupOnlyAfter: "__webpack_require__.x (only after)";
208
+ /**
209
+ * startup signal from runtime but only used to add sync logic before the startup
210
+ */
211
+ readonly startupOnlyBefore: "__webpack_require__.x (only before)";
212
+ /**
213
+ * global callback functions for installing chunks
214
+ */
215
+ readonly chunkCallback: "webpackChunk";
216
+ /**
217
+ * method to startup an entrypoint with needed chunks.
218
+ * Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
219
+ * Returns the exports of the module or a Promise
220
+ */
221
+ readonly startupEntrypoint: "__webpack_require__.X";
222
+ /**
223
+ * register deferred code, which will run when certain
224
+ * chunks are loaded.
225
+ * Signature: (chunkIds: Id[], fn: () =\> any, priority: int \>= 0 = 0) =\> any
226
+ * Returned value will be returned directly when all chunks are already loaded
227
+ * When (priority & 1) it will wait for all other handlers with lower priority to
228
+ * be executed before itself is executed
229
+ */
230
+ readonly onChunksLoaded: "__webpack_require__.O";
231
+ /**
232
+ * method to install a chunk that was loaded somehow
233
+ * Signature: (\{ id, ids, modules, runtime \}) =\> void
234
+ */
235
+ readonly externalInstallChunk: "__webpack_require__.C";
236
+ /**
237
+ * interceptor for module executions
238
+ */
239
+ readonly interceptModuleExecution: "__webpack_require__.i";
240
+ /**
241
+ * the global object
242
+ */
243
+ readonly global: "__webpack_require__.g";
244
+ /**
245
+ * an object with all share scopes
246
+ */
247
+ readonly shareScopeMap: "__webpack_require__.S";
248
+ /**
249
+ * The sharing init sequence function (only runs once per share scope).
250
+ * Has one argument, the name of the share scope.
251
+ * Creates a share scope if not existing
252
+ */
253
+ readonly initializeSharing: "__webpack_require__.I";
254
+ /**
255
+ * The current scope when getting a module from a remote
256
+ */
257
+ readonly currentRemoteGetScope: "__webpack_require__.R";
258
+ /**
259
+ * the filename of the HMR manifest
260
+ */
261
+ readonly getUpdateManifestFilename: "__webpack_require__.hmrF";
262
+ /**
263
+ * function downloading the update manifest
264
+ */
265
+ readonly hmrDownloadManifest: "__webpack_require__.hmrM";
266
+ /**
267
+ * array with handler functions to download chunk updates
268
+ */
269
+ readonly hmrDownloadUpdateHandlers: "__webpack_require__.hmrC";
270
+ /**
271
+ * object with all hmr module data for all modules
272
+ */
273
+ readonly hmrModuleData: "__webpack_require__.hmrD";
274
+ /**
275
+ * array with handler functions when a module should be invalidated
276
+ */
277
+ readonly hmrInvalidateModuleHandlers: "__webpack_require__.hmrI";
278
+ /**
279
+ * the prefix for storing state of runtime modules when hmr is enabled
280
+ */
281
+ readonly hmrRuntimeStatePrefix: "__webpack_require__.hmrS";
282
+ /**
283
+ * the AMD define function
284
+ */
285
+ readonly amdDefine: "__webpack_require__.amdD";
286
+ /**
287
+ * the AMD options
288
+ */
289
+ readonly amdOptions: "__webpack_require__.amdO";
290
+ /**
291
+ * the System polyfill object
292
+ */
293
+ readonly system: "__webpack_require__.System";
294
+ /**
295
+ * the shorthand for Object.prototype.hasOwnProperty
296
+ * using of it decreases the compiled bundle size
297
+ */
298
+ readonly hasOwnProperty: "__webpack_require__.o";
299
+ /**
300
+ * the System.register context object
301
+ */
302
+ readonly systemContext: "__webpack_require__.y";
303
+ /**
304
+ * the baseURI of current document
305
+ */
306
+ readonly baseURI: "__webpack_require__.b";
307
+ /**
308
+ * a RelativeURL class when relative URLs are used
309
+ */
310
+ readonly relativeUrl: "__webpack_require__.U";
311
+ /**
312
+ * Creates an async module. The body function must be a async function.
313
+ * "module.exports" will be decorated with an AsyncModulePromise.
314
+ * The body function will be called.
315
+ * To handle async dependencies correctly do this: "([a, b, c] = await handleDependencies([a, b, c]));".
316
+ * If "hasAwaitAfterDependencies" is truthy, "handleDependencies()" must be called at the end of the body function.
317
+ * Signature: function(
318
+ * module: Module,
319
+ * body: (handleDependencies: (deps: AsyncModulePromise[]) =\> Promise\<any[]\> & () =\> void,
320
+ * hasAwaitAfterDependencies?: boolean
321
+ * ) =\> void
322
+ */
323
+ readonly asyncModule: "__webpack_require__.a";
324
+ readonly asyncModuleExportSymbol: "__webpack_require__.aE";
325
+ readonly makeDeferredNamespaceObject: "__webpack_require__.z";
326
+ readonly makeDeferredNamespaceObjectSymbol: "__webpack_require__.zS";
327
+ };
328
+ export declare const isReservedRuntimeGlobal: (r: string) => boolean;
@@ -0,0 +1,32 @@
1
+ import type { JsAddingRuntimeModule } from "./binding";
2
+ import type { Chunk } from "./Chunk";
3
+ import type { ChunkGraph } from "./ChunkGraph";
4
+ import type { Compilation } from "./Compilation";
5
+ export declare enum RuntimeModuleStage {
6
+ NORMAL = 0,
7
+ BASIC = 5,
8
+ ATTACH = 10,
9
+ TRIGGER = 20
10
+ }
11
+ export declare class RuntimeModule {
12
+ static STAGE_NORMAL: RuntimeModuleStage;
13
+ static STAGE_BASIC: RuntimeModuleStage;
14
+ static STAGE_ATTACH: RuntimeModuleStage;
15
+ static STAGE_TRIGGER: RuntimeModuleStage;
16
+ static __to_binding(module: RuntimeModule): JsAddingRuntimeModule;
17
+ private _name;
18
+ private _stage;
19
+ fullHash: boolean;
20
+ dependentHash: boolean;
21
+ protected chunk: Chunk | null;
22
+ protected compilation: Compilation | null;
23
+ protected chunkGraph: ChunkGraph | null;
24
+ constructor(name: string, stage?: RuntimeModuleStage);
25
+ attach(compilation: Compilation, chunk: Chunk, chunkGraph: ChunkGraph): void;
26
+ get name(): string;
27
+ get stage(): RuntimeModuleStage;
28
+ identifier(): string;
29
+ readableIdentifier(): string;
30
+ shouldIsolate(): boolean;
31
+ generate(): string;
32
+ }
@@ -0,0 +1,17 @@
1
+ import type { Compilation } from "./Compilation";
2
+ import type { StatsOptions, StatsValue } from "./config";
3
+ import type { StatsCompilation } from "./stats/statsFactoryUtils";
4
+ export type { StatsAsset, StatsChunk, StatsCompilation, StatsError, StatsModule } from "./stats/statsFactoryUtils";
5
+ export declare class Stats {
6
+ #private;
7
+ constructor(compilation: Compilation);
8
+ get compilation(): Compilation;
9
+ get hash(): Readonly<string | null>;
10
+ get startTime(): number | undefined;
11
+ get endTime(): number | undefined;
12
+ hasErrors(): boolean;
13
+ hasWarnings(): boolean;
14
+ toJson(opts?: StatsValue, forToString?: boolean): StatsCompilation;
15
+ toString(opts?: StatsValue): string;
16
+ }
17
+ export declare function normalizeStatsPreset(options?: StatsValue): StatsOptions;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/Template.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
+ declare class Template {
11
+ /**
12
+ *
13
+ * @param fn a runtime function (.runtime.js) "template"
14
+ * @returns the updated and normalized function string
15
+ */
16
+ static getFunctionContent(fn: Function): string;
17
+ /**
18
+ * @param str the string converted to identifier
19
+ * @returns created identifier
20
+ */
21
+ static toIdentifier(str: any): string;
22
+ /**
23
+ *
24
+ * @param str string to be converted to commented in bundle code
25
+ * @returns returns a commented version of string
26
+ */
27
+ static toComment(str: string): string;
28
+ /**
29
+ *
30
+ * @param str string to be converted to "normal comment"
31
+ * @returns returns a commented version of string
32
+ */
33
+ static toNormalComment(str: string): string;
34
+ /**
35
+ * @param str string path to be normalized
36
+ * @returns normalized bundle-safe path
37
+ */
38
+ static toPath(str: string): string;
39
+ /**
40
+ * @param num number to convert to ident
41
+ * @returns returns single character ident
42
+ */
43
+ static numberToIdentifier(num: number): string;
44
+ /**
45
+ * @param num number to convert to ident
46
+ * @returns returns single character ident
47
+ */
48
+ static numberToIdentifierContinuation(num: number): string;
49
+ /**
50
+ *
51
+ * @param s string to convert to identity
52
+ * @returns converted identity
53
+ */
54
+ static indent(s: string | string[]): string;
55
+ /**
56
+ *
57
+ * @param s string to create prefix for
58
+ * @param prefix prefix to compose
59
+ * @returns returns new prefix string
60
+ */
61
+ static prefix(s: string | string[], prefix: string): string;
62
+ /**
63
+ *
64
+ * @param str string or string collection
65
+ * @returns returns a single string from array
66
+ */
67
+ static asString(str: string | string[]): string;
68
+ /**
69
+ * @param modules a collection of modules to get array bounds for
70
+ * @returns returns the upper and lower array bounds
71
+ * or false if not every module has a number based id
72
+ */
73
+ static getModulesArrayBounds(modules: {
74
+ id: string | number;
75
+ }[]): [number, number] | false;
76
+ }
77
+ export { Template };
@@ -0,0 +1,12 @@
1
+ import type { Compiler } from "./Compiler";
2
+ export declare class VirtualModulesPlugin {
3
+ #private;
4
+ constructor(modules?: Record<string, string>);
5
+ apply(compiler: Compiler): void;
6
+ writeModule(filePath: string, contents: string): void;
7
+ private getVirtualFileStore;
8
+ static __internal__take_virtual_files(compiler: Compiler): {
9
+ path: string;
10
+ content: string;
11
+ }[] | undefined;
12
+ }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * The following code is modified based on
3
+ * https://github.com/webpack/webpack/blob/4b4ca3b/lib/Watching.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 { Callback } from "@rspack/lite-tapable";
11
+ import type { Compiler } from ".";
12
+ import { Stats } from ".";
13
+ import type { WatchOptions } from "./config";
14
+ import type { Watcher } from "./util/fs";
15
+ export declare class Watching {
16
+ #private;
17
+ watcher?: Watcher;
18
+ pausedWatcher?: Watcher;
19
+ compiler: Compiler;
20
+ handler: Callback<Error, Stats>;
21
+ callbacks: Callback<Error, void>[];
22
+ watchOptions: WatchOptions;
23
+ lastWatcherStartTime: number;
24
+ running: boolean;
25
+ blocked: boolean;
26
+ isBlocked: () => boolean;
27
+ onChange: () => void;
28
+ onInvalid: () => void;
29
+ invalid: boolean;
30
+ startTime?: number;
31
+ suspended: boolean;
32
+ constructor(compiler: Compiler, watchOptions: WatchOptions, handler: Callback<Error, Stats>);
33
+ watch(files: Iterable<string> & {
34
+ added?: Iterable<string>;
35
+ removed?: Iterable<string>;
36
+ }, dirs: Iterable<string> & {
37
+ added?: Iterable<string>;
38
+ removed?: Iterable<string>;
39
+ }, missing: Iterable<string> & {
40
+ added?: Iterable<string>;
41
+ removed?: Iterable<string>;
42
+ }): void;
43
+ close(callback?: () => void): void;
44
+ invalidate(callback?: Callback<Error, void>): void;
45
+ /**
46
+ * @internal This is not a public API yet, still unstable, might change in the future
47
+ */
48
+ invalidateWithChangesAndRemovals(changedFiles?: Set<string>, removedFiles?: Set<string>, callback?: Callback<Error, void>): void;
49
+ /**
50
+ * The reason why this is _done instead of #done, is that in Webpack,
51
+ * it will rewrite this function to another function
52
+ */
53
+ private _done;
54
+ suspend(): void;
55
+ resume(): void;
56
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * We manually create binding.d.ts and re-export everything of the dts generated by napi to fix the cjs-esm interop
3
+ */
4
+
5
+ import * as binding from "./napi-binding";
6
+
7
+ export * from "./napi-binding"
8
+ export default binding;
@@ -0,0 +1,48 @@
1
+ import type { Compiler } from ".";
2
+ interface ResolvedRequest {
3
+ request: string;
4
+ issuer: string;
5
+ packageName: string;
6
+ }
7
+ interface ProcessedRequest extends ResolvedRequest {
8
+ url: URL;
9
+ }
10
+ interface BrowserHttpImportPluginOptions {
11
+ /**
12
+ * ESM CDN domain
13
+ */
14
+ domain: string | ((resolvedRequest: ResolvedRequest) => string);
15
+ /**
16
+ * Specify ESM CDN URL for dependencies.
17
+ * If a record is provided, it will be used to map package names to their CDN URLs.
18
+ *
19
+ * Once this function resolves a dependency, other options are ignored.
20
+ */
21
+ dependencyUrl?: Record<string, string | undefined> | ((resolvedRequest: ResolvedRequest) => string | undefined);
22
+ /**
23
+ * Specify versions for dependencies.
24
+ * Default to "latest" if not specified.
25
+ */
26
+ dependencyVersions?: Record<string, string | undefined>;
27
+ /**
28
+ * You can attach additional queries supported by the CDN to the `request.url`.
29
+ *
30
+ * For example, to specify the external dependencies under esm.sh, you can do:
31
+ *
32
+ * `request.url.searchParams.set("external", "react,react-dom")`
33
+ */
34
+ postprocess?: (request: ProcessedRequest) => void;
35
+ }
36
+ /**
37
+ * Convert imports of dependencies in node modules to http imports from esm cdn.
38
+ */
39
+ export declare class BrowserHttpImportEsmPlugin {
40
+ private options;
41
+ constructor(options: BrowserHttpImportPluginOptions);
42
+ apply(compiler: Compiler): void;
43
+ private resolveWithUrlIssuer;
44
+ private resolveNodeModule;
45
+ private parameterize;
46
+ private isNodeModule;
47
+ }
48
+ export {};
@@ -0,0 +1,38 @@
1
+ import type { Compiler } from "../Compiler";
2
+ type BrowserRequire = typeof Compiler.prototype.__internal_browser_require;
3
+ /**
4
+ * Represents the runtime context for CommonJS modules in a browser environment.
5
+ */
6
+ interface CommonJsRuntime {
7
+ module: any;
8
+ exports: any;
9
+ require: BrowserRequire;
10
+ }
11
+ interface BrowserRequirePluginOptions {
12
+ /**
13
+ * This function defines how to execute CommonJS code.
14
+ */
15
+ execute?: (code: string, runtime: CommonJsRuntime) => void;
16
+ /**
17
+ * This option provides a direct mapping from the module specifier to the module content, similar to the mechanism of a virtual module.
18
+ * If this option is not provided or the mapping result is undefined, it will fallback to resolving from memfs and run `execute`.
19
+ */
20
+ modules?: Record<string, unknown> | ((id: string) => unknown);
21
+ }
22
+ /**
23
+ * This plugin inject browser-compatible `require` function to the `Compiler`.
24
+ * 1. This plugin makes it possible to use custom loaders in browser by providing a virtual module mechanism.
25
+ * 2. This plugin resolves the JavaScript in the memfs with Node.js resolution algorithm rather than in the host filesystem.
26
+ * 3. This plugin transform ESM to CommonJS which will be executed with a user-defined `execute` function.
27
+ */
28
+ export declare class BrowserRequirePlugin {
29
+ private options;
30
+ /**
31
+ * This is an unsafe way to execute code in the browser using `new Function`.
32
+ * It is your responsibility to ensure that your application is not vulnerable to attacks due to this function.
33
+ */
34
+ static unsafeExecute: ((code: string, runtime: CommonJsRuntime) => void) | undefined;
35
+ constructor(options: BrowserRequirePluginOptions);
36
+ apply(compiler: Compiler): void;
37
+ }
38
+ export {};
@@ -0,0 +1 @@
1
+ export { Buffer } from "@napi-rs/wasm-runtime/fs";