@rspack-canary/core 1.7.0-canary-b303a917-20251231130755 → 1.7.1-canary-fc0b6db3-20251231173810

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 (182) hide show
  1. package/dist/BuildInfo.d.ts +4 -4
  2. package/dist/Chunk.d.ts +3 -3
  3. package/dist/ChunkGraph.d.ts +3 -3
  4. package/dist/Chunks.d.ts +2 -2
  5. package/dist/Compilation.d.ts +40 -40
  6. package/dist/Compiler.d.ts +25 -23
  7. package/dist/ConcatenatedModule.d.ts +1 -1
  8. package/dist/ContextModule.d.ts +1 -1
  9. package/dist/ContextModuleFactory.d.ts +2 -2
  10. package/dist/Diagnostics.d.ts +2 -2
  11. package/dist/Entrypoint.d.ts +1 -1
  12. package/dist/ExecuteModulePlugin.d.ts +1 -1
  13. package/dist/ExportsInfo.d.ts +2 -2
  14. package/dist/ExternalModule.d.ts +1 -1
  15. package/dist/FileSystem.d.ts +3 -3
  16. package/dist/Module.d.ts +6 -6
  17. package/dist/ModuleGraph.d.ts +3 -3
  18. package/dist/MultiCompiler.d.ts +8 -8
  19. package/dist/MultiStats.d.ts +3 -3
  20. package/dist/MultiWatching.d.ts +3 -3
  21. package/dist/NativeWatchFileSystem.d.ts +5 -5
  22. package/dist/NormalModule.d.ts +6 -6
  23. package/dist/NormalModuleFactory.d.ts +4 -4
  24. package/dist/Resolver.d.ts +2 -2
  25. package/dist/ResolverFactory.d.ts +3 -3
  26. package/dist/RspackError.d.ts +2 -2
  27. package/dist/RuntimeGlobals.d.ts +2 -2
  28. package/dist/RuntimeModule.d.ts +4 -4
  29. package/dist/Stats.d.ts +4 -4
  30. package/dist/VirtualModulesPlugin.d.ts +1 -1
  31. package/dist/Watching.d.ts +5 -5
  32. package/dist/builtin-loader/index.d.ts +1 -1
  33. package/dist/builtin-loader/swc/collectTypeScriptInfo.d.ts +1 -1
  34. package/dist/builtin-loader/swc/index.d.ts +5 -5
  35. package/dist/builtin-loader/swc/types.d.ts +10 -8
  36. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/{WarnCaseSensitiveModulesPlugin.d.ts → CaseSensitivePlugin.d.ts} +1 -1
  38. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +5 -10
  39. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +2 -2
  40. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
  42. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +2 -2
  43. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  44. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
  45. package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +3 -3
  47. package/dist/builtin-plugin/EntryPlugin.d.ts +3 -3
  48. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/ExternalsPlugin.d.ts +3 -3
  52. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
  53. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +3 -3
  54. package/dist/builtin-plugin/HttpUriPlugin.d.ts +4 -4
  55. package/dist/builtin-plugin/IgnorePlugin.d.ts +4 -4
  56. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +6 -6
  57. package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +2 -2
  59. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
  60. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
  61. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
  62. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
  63. package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/ProgressPlugin.d.ts +2 -2
  66. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -8
  67. package/dist/builtin-plugin/RslibPlugin.d.ts +2 -2
  68. package/dist/builtin-plugin/RstestPlugin.d.ts +2 -2
  69. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  70. package/dist/builtin-plugin/RuntimePlugin.d.ts +5 -5
  71. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  72. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +4 -4
  73. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +5 -5
  74. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -3
  75. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +3 -3
  76. package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
  77. package/dist/builtin-plugin/base.d.ts +3 -3
  78. package/dist/builtin-plugin/css-extract/index.d.ts +7 -7
  79. package/dist/builtin-plugin/css-extract/loader.d.ts +2 -2
  80. package/dist/builtin-plugin/css-extract/utils.d.ts +1 -1
  81. package/dist/builtin-plugin/html-plugin/hooks.d.ts +4 -4
  82. package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
  83. package/dist/builtin-plugin/html-plugin/options.d.ts +6 -6
  84. package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -5
  85. package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
  86. package/dist/builtin-plugin/index.d.ts +84 -88
  87. package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +1 -1
  88. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
  89. package/dist/config/adapter.d.ts +7 -7
  90. package/dist/config/adapterRuleUse.d.ts +16 -16
  91. package/dist/config/browserslistTargetHandler.d.ts +1 -1
  92. package/dist/config/defaults.d.ts +11 -2
  93. package/dist/config/devServer.d.ts +32 -32
  94. package/dist/config/index.d.ts +5 -5
  95. package/dist/config/normalization.d.ts +9 -9
  96. package/dist/config/target.d.ts +7 -7
  97. package/dist/config/types.d.ts +75 -74
  98. package/dist/container/ContainerPlugin.d.ts +4 -4
  99. package/dist/container/ContainerReferencePlugin.d.ts +4 -4
  100. package/dist/container/ModuleFederationManifestPlugin.d.ts +3 -3
  101. package/dist/container/ModuleFederationPlugin.d.ts +6 -6
  102. package/dist/container/ModuleFederationPluginV1.d.ts +5 -5
  103. package/dist/container/index.d.ts +4 -4
  104. package/dist/cssExtractHmr.js +19 -19
  105. package/dist/cssExtractLoader.js +16 -16
  106. package/dist/exports.d.ts +76 -74
  107. package/dist/index.d.ts +3 -3
  108. package/dist/index.js +1892 -1943
  109. package/dist/lib/AbstractMethodError.d.ts +1 -1
  110. package/dist/lib/Cache.d.ts +2 -2
  111. package/dist/lib/CacheFacade.d.ts +3 -3
  112. package/dist/lib/DllPlugin.d.ts +1 -1
  113. package/dist/lib/DllReferencePlugin.d.ts +5 -5
  114. package/dist/lib/EntryOptionPlugin.d.ts +2 -2
  115. package/dist/lib/EnvironmentPlugin.d.ts +1 -1
  116. package/dist/lib/HookWebpackError.d.ts +2 -2
  117. package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
  118. package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
  119. package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
  120. package/dist/lib/WebpackError.d.ts +3 -3
  121. package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
  122. package/dist/lib/cache/getLazyHashedEtag.d.ts +1 -1
  123. package/dist/lib/cache/mergeEtags.d.ts +1 -1
  124. package/dist/loader-runner/ModuleError.d.ts +1 -1
  125. package/dist/loader-runner/index.d.ts +3 -3
  126. package/dist/loader-runner/loadLoader.d.ts +2 -2
  127. package/dist/loader-runner/service.d.ts +8 -8
  128. package/dist/loader-runner/utils.d.ts +3 -3
  129. package/dist/loader-runner/worker.d.ts +3 -3
  130. package/dist/logging/createConsoleLogger.d.ts +4 -4
  131. package/dist/moduleFederationDefaultRuntime.js +1 -1
  132. package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
  133. package/dist/node/NodeTemplatePlugin.d.ts +1 -1
  134. package/dist/node/NodeWatchFileSystem.d.ts +3 -3
  135. package/dist/node/nodeConsole.d.ts +2 -2
  136. package/dist/rspack.d.ts +15 -6
  137. package/dist/rspackOptionsApply.d.ts +1 -1
  138. package/dist/sharing/ConsumeSharedPlugin.d.ts +3 -3
  139. package/dist/sharing/ProvideSharedPlugin.d.ts +4 -4
  140. package/dist/sharing/SharePlugin.d.ts +1 -1
  141. package/dist/sharing/ShareRuntimePlugin.d.ts +3 -3
  142. package/dist/stats/DefaultStatsFactoryPlugin.d.ts +15 -15
  143. package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
  144. package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
  145. package/dist/stats/StatsFactory.d.ts +5 -5
  146. package/dist/stats/StatsPrinter.d.ts +3 -3
  147. package/dist/stats/statsFactoryUtils.d.ts +5 -5
  148. package/dist/swc.d.ts +2 -2
  149. package/dist/taps/compilation.d.ts +2 -2
  150. package/dist/taps/compiler.d.ts +1 -1
  151. package/dist/taps/contextModuleFactory.d.ts +1 -1
  152. package/dist/taps/index.d.ts +6 -6
  153. package/dist/taps/javascriptModules.d.ts +1 -1
  154. package/dist/taps/normalModuleFactory.d.ts +1 -1
  155. package/dist/taps/types.d.ts +3 -3
  156. package/dist/trace/index.d.ts +4 -4
  157. package/dist/trace/traceHookPlugin.d.ts +1 -1
  158. package/dist/util/SplitChunkSize.d.ts +1 -1
  159. package/dist/util/createHash.d.ts +1 -1
  160. package/dist/util/createReadonlyMap.d.ts +1 -1
  161. package/dist/util/fs.d.ts +14 -14
  162. package/dist/util/hash/wasm-hash.d.ts +1 -1
  163. package/dist/util/identifier.d.ts +1 -1
  164. package/dist/util/index.d.ts +2 -1
  165. package/dist/util/source.d.ts +2 -2
  166. package/dist/util/validateConfig.d.ts +1 -1
  167. package/dist/worker.js +111 -111
  168. package/hot/dev-server.js +64 -64
  169. package/hot/emitter.js +11 -11
  170. package/hot/lazy-compilation-node.js +41 -41
  171. package/hot/lazy-compilation-web.js +52 -52
  172. package/hot/log-apply-result.js +36 -36
  173. package/hot/log.js +30 -30
  174. package/hot/only-dev-server.js +92 -92
  175. package/hot/poll.js +31 -31
  176. package/hot/signal.js +53 -53
  177. package/module.d.ts +215 -215
  178. package/package.json +4 -4
  179. package/dist/builtin-plugin/rsc/Coordinator.d.ts +0 -8
  180. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +0 -10
  181. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +0 -10
  182. package/dist/builtin-plugin/rsc/index.d.ts +0 -15
@@ -1,7 +1,7 @@
1
- import binding from "@rspack/binding";
2
- import type { Source } from "../compiled/webpack-sources";
1
+ import binding from '@rspack/binding';
2
+ import type { Source } from '../compiled/webpack-sources';
3
3
  declare const $assets: unique symbol;
4
- declare module "@rspack/binding" {
4
+ declare module '@rspack/binding' {
5
5
  interface Assets {
6
6
  [$assets]: Record<string, Source>;
7
7
  }
@@ -13,5 +13,5 @@ declare module "@rspack/binding" {
13
13
  buildDependencies: Set<string>;
14
14
  }
15
15
  }
16
- export type { BuildInfo } from "@rspack/binding";
16
+ export type { BuildInfo } from '@rspack/binding';
17
17
  export declare const commitCustomFieldsToRust: (buildInfo: binding.BuildInfo) => void;
package/dist/Chunk.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { type ChunkGroup } from "@rspack/binding";
1
+ import { type ChunkGroup } from '@rspack/binding';
2
2
  interface ChunkMaps {
3
3
  hash: Record<string | number, string>;
4
4
  contentHash: Record<string | number, Record<string, string>>;
5
5
  name: Record<string | number, string>;
6
6
  }
7
- declare module "@rspack/binding" {
7
+ declare module '@rspack/binding' {
8
8
  interface Chunk {
9
9
  readonly files: ReadonlySet<string>;
10
10
  readonly runtime: ReadonlySet<string>;
@@ -13,4 +13,4 @@ declare module "@rspack/binding" {
13
13
  getChunkMaps(realHash: boolean): ChunkMaps;
14
14
  }
15
15
  }
16
- export { Chunk } from "@rspack/binding";
16
+ export { Chunk } from '@rspack/binding';
@@ -1,9 +1,9 @@
1
- import type { RuntimeSpec } from "./util/runtime";
2
- declare module "@rspack/binding" {
1
+ import type { RuntimeSpec } from './util/runtime';
2
+ declare module '@rspack/binding' {
3
3
  interface ChunkGraph {
4
4
  getModuleChunksIterable(module: Module): Iterable<Chunk>;
5
5
  getOrderedChunkModulesIterable(chunk: Chunk, compareFn: (a: Module, b: Module) => number): Iterable<Module>;
6
6
  getModuleHash(module: Module, runtime: RuntimeSpec): string | null;
7
7
  }
8
8
  }
9
- export { ChunkGraph } from "@rspack/binding";
9
+ export { ChunkGraph } from '@rspack/binding';
package/dist/Chunks.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Chunks } from "@rspack/binding";
2
- declare module "@rspack/binding" {
1
+ import { Chunks } from '@rspack/binding';
2
+ declare module '@rspack/binding' {
3
3
  interface Chunks {
4
4
  [Symbol.iterator](): SetIterator<Chunk>;
5
5
  entries(): SetIterator<[Chunk, Chunk]>;
@@ -7,37 +7,37 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation, JsRuntimeModule } 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";
10
+ import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation, JsRuntimeModule } 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
41
  export type Assets = Record<string, Source>;
42
42
  export interface Asset {
43
43
  name: string;
@@ -99,7 +99,7 @@ export interface KnownNormalizedStatsOptions {
99
99
  groupAssetsByExtension: boolean;
100
100
  assetsSpace: number;
101
101
  excludeAssets: ((value: string, asset: StatsAsset) => boolean)[];
102
- excludeModules: ((name: string, module: StatsModule, type: "module" | "chunk" | "root-of-chunk" | "nested") => boolean)[];
102
+ excludeModules: ((name: string, module: StatsModule, type: 'module' | 'chunk' | 'root-of-chunk' | 'nested') => boolean)[];
103
103
  warningsFilter: ((warning: StatsError, textValue: string) => boolean)[];
104
104
  cachedModules: boolean;
105
105
  orphanModules: boolean;
@@ -111,7 +111,7 @@ export interface KnownNormalizedStatsOptions {
111
111
  groupModulesByPath: boolean;
112
112
  groupModulesByExtension: boolean;
113
113
  groupModulesByType: boolean;
114
- entrypoints: boolean | "auto";
114
+ entrypoints: boolean | 'auto';
115
115
  chunkGroups: boolean;
116
116
  chunkGroupAuxiliary: boolean;
117
117
  chunkGroupChildren: boolean;
@@ -119,7 +119,7 @@ export interface KnownNormalizedStatsOptions {
119
119
  modulesSpace: number;
120
120
  chunkModulesSpace: number;
121
121
  nestedModulesSpace: number;
122
- logging: false | "none" | "error" | "warn" | "info" | "log" | "verbose";
122
+ logging: false | 'none' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
123
123
  loggingDebug: ((value: string) => boolean)[];
124
124
  loggingTrace: boolean;
125
125
  chunkModules: boolean;
@@ -271,13 +271,13 @@ export declare class Compilation {
271
271
  *
272
272
  * @internal
273
273
  */
274
- __internal__pushDiagnostic(diagnostic: ExternalObject<"Diagnostic">): void;
274
+ __internal__pushDiagnostic(diagnostic: ExternalObject<'Diagnostic'>): void;
275
275
  /**
276
276
  * Note: This is not a webpack public API, maybe removed in future.
277
277
  *
278
278
  * @internal
279
279
  */
280
- __internal__pushDiagnostics(diagnostics: ExternalObject<"Diagnostic[]">): void;
280
+ __internal__pushDiagnostics(diagnostics: ExternalObject<'Diagnostic[]'>): void;
281
281
  get errors(): RspackError[];
282
282
  set errors(errors: RspackError[]);
283
283
  get warnings(): RspackError[];
@@ -425,13 +425,13 @@ export declare class Entries implements Map<string, EntryData> {
425
425
  clear(): void;
426
426
  forEach(callback: (value: EntryData, key: string, map: Map<string, EntryData>) => void, thisArg?: any): void;
427
427
  get size(): number;
428
- entries(): ReturnType<Map<string, EntryData>["entries"]>;
429
- values(): ReturnType<Map<string, EntryData>["values"]>;
430
- [Symbol.iterator](): ReturnType<Map<string, EntryData>["entries"]>;
428
+ entries(): ReturnType<Map<string, EntryData>['entries']>;
429
+ values(): ReturnType<Map<string, EntryData>['values']>;
430
+ [Symbol.iterator](): ReturnType<Map<string, EntryData>['entries']>;
431
431
  readonly [Symbol.toStringTag] = "Map";
432
432
  has(key: string): boolean;
433
433
  set(key: string, value: EntryData): this;
434
434
  delete(key: string): boolean;
435
435
  get(key: string): EntryData | undefined;
436
- keys(): ReturnType<Map<string, EntryData>["keys"]>;
436
+ keys(): ReturnType<Map<string, EntryData>['keys']>;
437
437
  }
@@ -7,26 +7,27 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
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 { FileSystemInfoEntry } from "./FileSystemInfo";
20
- import { rspack } from "./index";
21
- import Cache from "./lib/Cache";
22
- import CacheFacade from "./lib/CacheFacade";
23
- import { Logger } from "./logging/Logger";
24
- import { NormalModuleFactory } from "./NormalModuleFactory";
25
- import { ResolverFactory } from "./ResolverFactory";
26
- import { RuleSetCompiler } from "./RuleSetCompiler";
27
- import { Stats } from "./Stats";
28
- import type { InputFileSystem, IntermediateFileSystem, OutputFileSystem, WatchFileSystem } from "./util/fs";
29
- import { Watching } from "./Watching";
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 { 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';
30
31
  export interface AssetEmittedInfo {
31
32
  content: Buffer;
32
33
  source: Source;
@@ -78,7 +79,6 @@ export type CompilerHooks = {
78
79
  entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
79
80
  additionalPass: liteTapable.AsyncSeriesHook<[]>;
80
81
  };
81
- export declare const GET_COMPILER_ID: unique symbol;
82
82
  declare class Compiler {
83
83
  #private;
84
84
  hooks: CompilerHooks;
@@ -100,8 +100,8 @@ declare class Compiler {
100
100
  records: Record<string, any[]>;
101
101
  modifiedFiles?: ReadonlySet<string>;
102
102
  removedFiles?: ReadonlySet<string>;
103
- fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
104
- contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | "ignore" | null>;
103
+ fileTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
104
+ contextTimestamps?: ReadonlyMap<string, FileSystemInfoEntry | 'ignore' | null>;
105
105
  fsStartTime?: number;
106
106
  watchMode: boolean;
107
107
  context: string;
@@ -127,6 +127,8 @@ declare class Compiler {
127
127
  get managedPaths(): never;
128
128
  get immutablePaths(): never;
129
129
  get _lastCompilation(): Compilation | undefined;
130
+ get platform(): PlatformTargetProperties;
131
+ set platform(platform: PlatformTargetProperties);
130
132
  /**
131
133
  * Note: This is not a webpack public API, maybe removed in future.
132
134
  * @internal
@@ -1 +1 @@
1
- export { ConcatenatedModule } from "@rspack/binding";
1
+ export { ConcatenatedModule } from '@rspack/binding';
@@ -1 +1 @@
1
- export { ContextModule } from "@rspack/binding";
1
+ export { ContextModule } from '@rspack/binding';
@@ -1,5 +1,5 @@
1
- import * as liteTapable from "@rspack/lite-tapable";
2
- import type { ContextModuleFactoryAfterResolveResult, ContextModuleFactoryBeforeResolveResult } from "./Module";
1
+ import * as liteTapable from '@rspack/lite-tapable';
2
+ import type { ContextModuleFactoryAfterResolveResult, ContextModuleFactoryBeforeResolveResult } from './Module';
3
3
  export declare class ContextModuleFactory {
4
4
  hooks: {
5
5
  beforeResolve: liteTapable.AsyncSeriesWaterfallHook<[
@@ -1,5 +1,5 @@
1
- import type { Diagnostics } from "@rspack/binding";
2
- import type { RspackError } from "./RspackError";
1
+ import type { Diagnostics } from '@rspack/binding';
2
+ import type { RspackError } from './RspackError';
3
3
  declare const $proxy: unique symbol;
4
4
  export declare function createDiagnosticArray(adm: Diagnostics & {
5
5
  [$proxy]?: RspackError[];
@@ -1,2 +1,2 @@
1
- import type { ChunkGroup } from "@rspack/binding";
1
+ import type { ChunkGroup } from '@rspack/binding';
2
2
  export type Entrypoint = ChunkGroup;
@@ -1,4 +1,4 @@
1
- import type { Compiler } from "./Compiler";
1
+ import type { Compiler } from './Compiler';
2
2
  export default class ExecuteModulePlugin {
3
3
  apply(compiler: Compiler): void;
4
4
  }
@@ -1,5 +1,5 @@
1
- import type { JsExportsInfo } from "@rspack/binding";
2
- import type { RuntimeSpec } from "./util/runtime";
1
+ import type { JsExportsInfo } from '@rspack/binding';
2
+ import type { RuntimeSpec } from './util/runtime';
3
3
  /**
4
4
  * Unused: 0
5
5
  * OnlyPropertiesUsed: 1
@@ -1 +1 @@
1
- export { ExternalModule } from "@rspack/binding";
1
+ export { ExternalModule } from '@rspack/binding';
@@ -1,5 +1,5 @@
1
- import type { NodeFsStats, ThreadsafeNodeFS } from "@rspack/binding";
2
- import { type InputFileSystem, type IntermediateFileSystem, type OutputFileSystem } from "./util/fs";
1
+ import type { NodeFsStats, ThreadsafeNodeFS } from '@rspack/binding';
2
+ import { type InputFileSystem, type IntermediateFileSystem, type OutputFileSystem } from './util/fs';
3
3
  declare class ThreadsafeInputNodeFS implements ThreadsafeNodeFS {
4
4
  writeFile: (name: string, content: Buffer) => Promise<void>;
5
5
  removeFile: (name: string) => Promise<void>;
@@ -51,4 +51,4 @@ declare class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
51
51
  constructor(fs?: IntermediateFileSystem);
52
52
  static __to_binding(fs?: IntermediateFileSystem): ThreadsafeIntermediateNodeFS;
53
53
  }
54
- export { ThreadsafeInputNodeFS, ThreadsafeOutputNodeFS, ThreadsafeIntermediateNodeFS };
54
+ export { ThreadsafeInputNodeFS, ThreadsafeOutputNodeFS, ThreadsafeIntermediateNodeFS, };
package/dist/Module.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import binding, { type AssetInfo } from "@rspack/binding";
2
- import type { Source } from "../compiled/webpack-sources";
3
- import type { ResourceData } from "./Resolver";
4
- import "./BuildInfo";
1
+ import binding, { type AssetInfo } from '@rspack/binding';
2
+ import type { Source } from '../compiled/webpack-sources';
3
+ import type { ResourceData } from './Resolver';
4
+ import './BuildInfo';
5
5
  export type ResourceDataWithData = ResourceData & {
6
6
  data?: Record<string, any>;
7
7
  };
@@ -32,11 +32,11 @@ export declare class ContextModuleFactoryAfterResolveData {
32
32
  private constructor();
33
33
  }
34
34
  export type ContextModuleFactoryAfterResolveResult = false | ContextModuleFactoryAfterResolveData;
35
- declare module "@rspack/binding" {
35
+ declare module '@rspack/binding' {
36
36
  interface Module {
37
37
  identifier(): string;
38
38
  originalSource(): Source | null;
39
39
  emitFile(filename: string, source: Source, assetInfo?: AssetInfo): void;
40
40
  }
41
41
  }
42
- export { Module } from "@rspack/binding";
42
+ export { Module } from '@rspack/binding';
@@ -1,6 +1,6 @@
1
- import type { Dependency, JsModuleGraph, ModuleGraphConnection } from "@rspack/binding";
2
- import { ExportsInfo } from "./ExportsInfo";
3
- import type { Module } from "./Module";
1
+ import type { Dependency, JsModuleGraph, ModuleGraphConnection } from '@rspack/binding';
2
+ import { ExportsInfo } from './ExportsInfo';
3
+ import type { Module } from './Module';
4
4
  export default class ModuleGraph {
5
5
  #private;
6
6
  static __from_binding(binding: JsModuleGraph): ModuleGraph;
@@ -7,12 +7,12 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import * as liteTapable from "@rspack/lite-tapable";
11
- import type { CompilationParams, Compiler, CompilerHooks, RspackOptions } from ".";
12
- import type { WatchOptions } from "./config";
13
- import MultiStats from "./MultiStats";
14
- import MultiWatching from "./MultiWatching";
15
- import type { InputFileSystem, IntermediateFileSystem, WatchFileSystem } from "./util/fs";
10
+ import * as liteTapable from '@rspack/lite-tapable';
11
+ import type { CompilationParams, Compiler, CompilerHooks, RspackOptions } from '.';
12
+ import type { WatchOptions } from './config';
13
+ import MultiStats from './MultiStats';
14
+ import MultiWatching from './MultiWatching';
15
+ import type { InputFileSystem, IntermediateFileSystem, WatchFileSystem } from './util/fs';
16
16
  export interface MultiCompilerOptions {
17
17
  /**
18
18
  * how many Compilers are allows to run at the same time in parallel
@@ -35,7 +35,7 @@ export declare class MultiCompiler {
35
35
  /**
36
36
  * @see {@link CompilerHooks['infrastructureLog']}
37
37
  */
38
- infrastructureLog: liteTapable.MultiHook<CompilerHooks["infrastructureLog"]>;
38
+ infrastructureLog: liteTapable.MultiHook<CompilerHooks['infrastructureLog']>;
39
39
  };
40
40
  _options: MultiCompilerOptions;
41
41
  running: boolean;
@@ -49,7 +49,7 @@ export declare class MultiCompiler {
49
49
  get watchFileSystem(): WatchFileSystem;
50
50
  get intermediateFileSystem(): IntermediateFileSystem;
51
51
  set inputFileSystem(value: InputFileSystem);
52
- set outputFileSystem(value: typeof import("fs"));
52
+ set outputFileSystem(value: typeof import('fs'));
53
53
  set watchFileSystem(value: WatchFileSystem);
54
54
  set intermediateFileSystem(value: IntermediateFileSystem);
55
55
  getInfrastructureLogger(name: string): import("./logging/Logger").Logger;
@@ -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 { MultiStatsOptions, StatsPresets } from "./config";
11
- import type { Stats } from "./Stats";
12
- import type { StatsCompilation } from "./stats/statsFactoryUtils";
10
+ import type { MultiStatsOptions, StatsPresets } from './config';
11
+ import type { Stats } from './Stats';
12
+ import type { StatsCompilation } from './stats/statsFactoryUtils';
13
13
  export default class MultiStats {
14
14
  #private;
15
15
  stats: Stats[];
@@ -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 { Callback } from "@rspack/lite-tapable";
11
- import type { MultiCompiler } from "./MultiCompiler";
12
- import type { Watching } from "./Watching";
10
+ import type { Callback } from '@rspack/lite-tapable';
11
+ import type { MultiCompiler } from './MultiCompiler';
12
+ import type { Watching } from './Watching';
13
13
  declare class MultiWatching {
14
14
  watchings: Watching[];
15
15
  compiler: MultiCompiler;
@@ -1,6 +1,6 @@
1
- import binding from "@rspack/binding";
2
- import type Watchpack from "../compiled/watchpack";
3
- import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from "./util/fs";
1
+ import binding from '@rspack/binding';
2
+ import type Watchpack from '../compiled/watchpack';
3
+ import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from './util/fs';
4
4
  export default class NativeWatchFileSystem implements WatchFileSystem {
5
5
  #private;
6
6
  constructor(inputFileSystem: InputFileSystem);
@@ -13,9 +13,9 @@ export default class NativeWatchFileSystem implements WatchFileSystem {
13
13
  }, missing: Iterable<string> & {
14
14
  added?: Iterable<string>;
15
15
  removed?: Iterable<string>;
16
- }, 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;
16
+ }, 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;
17
17
  getNativeWatcher(options: Watchpack.WatchOptions): binding.NativeWatcher;
18
- triggerEvent(kind: "change" | "remove" | "create", path: string): void;
18
+ triggerEvent(kind: 'change' | 'remove' | 'create', path: string): void;
19
19
  formatWatchDependencies(dependencies: Iterable<string> & {
20
20
  added?: Iterable<string>;
21
21
  removed?: Iterable<string>;
@@ -1,15 +1,15 @@
1
- import * as liteTapable from "@rspack/lite-tapable";
2
- import type { Compilation } from "./Compilation";
3
- import type { LoaderContext } from "./config";
4
- import type { Module } from "./Module";
1
+ import * as liteTapable from '@rspack/lite-tapable';
2
+ import type { Compilation } from './Compilation';
3
+ import type { LoaderContext } from './config';
4
+ import type { Module } from './Module';
5
5
  export interface NormalModuleCompilationHooks {
6
6
  loader: liteTapable.SyncHook<[LoaderContext, Module]>;
7
7
  readResourceForScheme: any;
8
8
  readResource: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[LoaderContext], string | Buffer>>;
9
9
  }
10
- declare module "@rspack/binding" {
10
+ declare module '@rspack/binding' {
11
11
  interface NormalModuleConstructor {
12
12
  getCompilationHooks(compilation: Compilation): NormalModuleCompilationHooks;
13
13
  }
14
14
  }
15
- export { NormalModule } from "@rspack/binding";
15
+ export { NormalModule } from '@rspack/binding';
@@ -1,7 +1,7 @@
1
- import type binding from "@rspack/binding";
2
- import * as liteTapable from "@rspack/lite-tapable";
3
- import type { ResolveData, ResourceDataWithData } from "./Module";
4
- import type { ResolveOptionsWithDependencyType, ResolverFactory } from "./ResolverFactory";
1
+ import type binding from '@rspack/binding';
2
+ import * as liteTapable from '@rspack/lite-tapable';
3
+ import type { ResolveData, ResourceDataWithData } from './Module';
4
+ import type { ResolveOptionsWithDependencyType, ResolverFactory } from './ResolverFactory';
5
5
  export type NormalModuleCreateData = binding.JsNormalModuleFactoryCreateModuleArgs & {
6
6
  settings: {};
7
7
  };
@@ -1,5 +1,5 @@
1
- import type binding from "@rspack/binding";
2
- import type { ResolveCallback } from "./config/adapterRuleUse";
1
+ import type binding from '@rspack/binding';
2
+ import type { ResolveCallback } from './config/adapterRuleUse';
3
3
  export type ResolveContext = {
4
4
  contextDependencies?: {
5
5
  add: (context: string) => void;
@@ -1,6 +1,6 @@
1
- import binding from "@rspack/binding";
2
- import { type Resolve } from "./config";
3
- import { Resolver } from "./Resolver";
1
+ import binding from '@rspack/binding';
2
+ import { type Resolve } from './config';
3
+ import { Resolver } from './Resolver';
4
4
  export type ResolveOptionsWithDependencyType = Resolve & {
5
5
  dependencyType?: string;
6
6
  resolveToContext?: boolean;
@@ -1,5 +1,5 @@
1
- import type binding from "@rspack/binding";
2
- export type { RspackError } from "@rspack/binding";
1
+ import type binding from '@rspack/binding';
2
+ export type { RspackError } from '@rspack/binding';
3
3
  export type RspackSeverity = binding.JsRspackSeverity;
4
4
  export declare class NonErrorEmittedError extends Error {
5
5
  constructor(error: Error);
@@ -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 { JsRuntimeGlobals } from "@rspack/binding";
11
- import type { RspackOptionsNormalized } from "./config";
10
+ import type { JsRuntimeGlobals } from '@rspack/binding';
11
+ import type { RspackOptionsNormalized } from './config';
12
12
  export declare function __from_binding_runtime_globals(runtimeRequirements: JsRuntimeGlobals, compilerRuntimeGlobals: Record<string, string>): Set<string>;
13
13
  export declare function __to_binding_runtime_globals(runtimeRequirements: Set<string>, compilerRuntimeGlobals: Record<string, string>): JsRuntimeGlobals;
14
14
  declare enum RuntimeGlobals {
@@ -1,7 +1,7 @@
1
- import type { JsAddingRuntimeModule } from "@rspack/binding";
2
- import type { Chunk } from "./Chunk";
3
- import type { ChunkGraph } from "./ChunkGraph";
4
- import type { Compilation } from "./Compilation";
1
+ import type { JsAddingRuntimeModule } from '@rspack/binding';
2
+ import type { Chunk } from './Chunk';
3
+ import type { ChunkGraph } from './ChunkGraph';
4
+ import type { Compilation } from './Compilation';
5
5
  export declare enum RuntimeModuleStage {
6
6
  NORMAL = 0,
7
7
  BASIC = 5,
package/dist/Stats.d.ts CHANGED
@@ -1,7 +1,7 @@
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";
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
5
  export declare class Stats {
6
6
  #private;
7
7
  constructor(compilation: Compilation);
@@ -1,4 +1,4 @@
1
- import type { Compiler } from "./Compiler";
1
+ import type { Compiler } from './Compiler';
2
2
  export declare class VirtualModulesPlugin {
3
3
  #private;
4
4
  constructor(modules?: Record<string, string>);
@@ -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 { 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";
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
15
  export declare class Watching {
16
16
  #private;
17
17
  watcher?: Watcher;
@@ -1 +1 @@
1
- export * from "./swc";
1
+ export * from './swc';
@@ -13,7 +13,7 @@ export type CollectTypeScriptInfoOptions = {
13
13
  * inlining optimizations for them.
14
14
  * @default false
15
15
  */
16
- exportedEnum?: boolean | "const-only";
16
+ exportedEnum?: boolean | 'const-only';
17
17
  };
18
18
  export declare function resolveCollectTypeScriptInfo(options: CollectTypeScriptInfoOptions): {
19
19
  typeExports: boolean | undefined;