@rspack-debug/browser 2.0.0-canary-20260116 → 2.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/BuildInfo.d.ts +3 -3
  2. package/dist/Chunk.d.ts +3 -3
  3. package/dist/ChunkGraph.d.ts +2 -2
  4. package/dist/Chunks.d.ts +2 -2
  5. package/dist/Compilation.d.ts +6 -3
  6. package/dist/Compiler.d.ts +5 -2
  7. package/dist/ConcatenatedModule.d.ts +1 -1
  8. package/dist/ContextModule.d.ts +1 -1
  9. package/dist/Diagnostics.d.ts +1 -1
  10. package/dist/Entrypoint.d.ts +1 -1
  11. package/dist/ExportsInfo.d.ts +1 -1
  12. package/dist/ExternalModule.d.ts +1 -1
  13. package/dist/FileSystem.d.ts +2 -2
  14. package/dist/Module.d.ts +3 -3
  15. package/dist/ModuleGraph.d.ts +2 -1
  16. package/dist/NativeWatchFileSystem.d.ts +1 -1
  17. package/dist/NormalModule.d.ts +2 -3
  18. package/dist/NormalModuleFactory.d.ts +1 -1
  19. package/dist/Resolver.d.ts +1 -1
  20. package/dist/ResolverFactory.d.ts +1 -1
  21. package/dist/RspackError.d.ts +2 -2
  22. package/dist/RuntimeGlobals.d.ts +2 -2
  23. package/dist/RuntimeModule.d.ts +1 -1
  24. package/dist/browser/BrowserRequirePlugin.d.ts +1 -1
  25. package/dist/browser/fs.d.ts +1 -1
  26. package/dist/browser/middleware.d.ts +1 -0
  27. package/dist/builtin-loader/lightningcss/index.d.ts +11 -9
  28. package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
  29. package/dist/builtin-loader/swc/index.d.ts +2 -2
  30. package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
  31. package/dist/builtin-loader/swc/types.d.ts +36 -1
  32. package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
  33. package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
  34. package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
  35. package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
  36. package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
  37. package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
  38. package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
  39. package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
  40. package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
  41. package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
  42. package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +5 -1
  43. package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
  44. package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
  46. package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
  47. package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
  48. package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
  49. package/dist/builtin-plugin/HttpUriPlugin.d.ts +1 -1
  50. package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
  51. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  52. package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +5 -4
  53. package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
  54. package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
  55. package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
  56. package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
  57. package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
  58. package/dist/builtin-plugin/ProgressPlugin.d.ts +5 -4
  59. package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
  60. package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
  61. package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
  62. package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
  63. package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
  64. package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
  65. package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
  66. package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
  67. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -2
  68. package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
  69. package/dist/builtin-plugin/WorkerPlugin.d.ts +2 -1
  70. package/dist/builtin-plugin/base.d.ts +1 -1
  71. package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
  72. package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
  73. package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
  74. package/dist/builtin-plugin/index.d.ts +2 -0
  75. package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
  76. package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
  77. package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
  78. package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +39 -0
  79. package/dist/builtin-plugin/rsc/index.d.ts +24 -0
  80. package/dist/checkNodeVersion.d.ts +1 -0
  81. package/dist/config/adapter.d.ts +1 -1
  82. package/dist/config/adapterRuleUse.d.ts +3 -2
  83. package/dist/config/defaults.d.ts +4 -2
  84. package/dist/config/devServer.d.ts +102 -237
  85. package/dist/config/normalization.d.ts +2 -3
  86. package/dist/config/target.d.ts +14 -11
  87. package/dist/config/types.d.ts +152 -63
  88. package/dist/container/ContainerPlugin.d.ts +4 -3
  89. package/dist/container/ContainerReferencePlugin.d.ts +5 -4
  90. package/dist/container/ModuleFederationManifestPlugin.d.ts +11 -4
  91. package/dist/container/ModuleFederationPlugin.d.ts +20 -1
  92. package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
  93. package/dist/container/ModuleFederationRuntimePlugin.d.ts +4 -0
  94. package/dist/exports.d.ts +13 -10
  95. package/dist/index.d.ts +2 -1
  96. package/dist/index.js +43927 -8544
  97. package/dist/index.js.LICENSE.txt +7 -0
  98. package/dist/lib/DllReferencePlugin.d.ts +1 -1
  99. package/dist/lib/WebpackError.d.ts +1 -1
  100. package/dist/loader-runner/index.d.ts +1 -1
  101. package/dist/loader-runner/worker.d.ts +1 -1
  102. package/dist/napi-binding.d.ts +248 -101
  103. package/dist/rspack.wasi-browser.js +7 -0
  104. package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
  105. package/dist/sharing/ConsumeSharedPlugin.d.ts +17 -4
  106. package/dist/sharing/IndependentSharedPlugin.d.ts +35 -0
  107. package/dist/sharing/ProvideSharedPlugin.d.ts +23 -3
  108. package/dist/sharing/SharePlugin.d.ts +43 -5
  109. package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
  110. package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
  111. package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
  112. package/dist/sharing/TreeShakingSharedPlugin.d.ts +16 -0
  113. package/dist/sharing/utils.d.ts +1 -0
  114. package/dist/stats/StatsFactory.d.ts +1 -1
  115. package/dist/stats/statsFactoryUtils.d.ts +2 -2
  116. package/dist/swc.d.ts +2 -2
  117. package/dist/taps/compilation.d.ts +1 -1
  118. package/dist/taps/types.d.ts +1 -1
  119. package/dist/util/SplitChunkSize.d.ts +1 -1
  120. package/dist/util/createHash.d.ts +1 -1
  121. package/dist/util/source.d.ts +1 -1
  122. package/dist/util/supportsColor.d.ts +6 -0
  123. package/dist/util/targetsVersion.d.ts +2 -0
  124. package/dist/wasi-worker-browser.mjs +26464 -22498
  125. package/package.json +6 -7
  126. package/dist/builtin-loader/index.d.ts +0 -1
  127. package/dist/rslib-runtime.js +0 -58
@@ -1,7 +1,7 @@
1
- import binding from '@rspack/binding';
1
+ import binding from './binding';
2
2
  import type { Source } from 'webpack-sources';
3
3
  declare const $assets: unique symbol;
4
- declare module '@rspack/binding' {
4
+ declare module './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 './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 './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 './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 './binding';
@@ -1,9 +1,9 @@
1
1
  import type { RuntimeSpec } from './util/runtime';
2
- declare module '@rspack/binding' {
2
+ declare module './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 './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 './binding';
2
+ declare module './binding' {
3
3
  interface Chunks {
4
4
  [Symbol.iterator](): SetIterator<Chunk>;
5
5
  entries(): SetIterator<[Chunk, Chunk]>;
@@ -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 { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
11
- import binding from '@rspack/binding';
12
- export type { AssetInfo } from '@rspack/binding';
10
+ import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from './binding';
11
+ import binding from './binding';
12
+ export type { AssetInfo } from './binding';
13
13
  import * as liteTapable from '@rspack/lite-tapable';
14
14
  import type { Source } from 'webpack-sources';
15
15
  import type { EntryOptions, EntryPlugin } from './builtin-plugin';
@@ -162,6 +162,7 @@ export declare class Compilation {
162
162
  Iterable<Chunk>,
163
163
  Iterable<Module>
164
164
  ], void>;
165
+ beforeModuleIds: liteTapable.SyncHook<[Iterable<Module>]>;
165
166
  finishModules: liteTapable.AsyncSeriesHook<[Iterable<Module>], void>;
166
167
  chunkHash: liteTapable.SyncHook<[Chunk, Hash]>;
167
168
  chunkAsset: liteTapable.SyncHook<[Chunk, string]>;
@@ -432,6 +433,8 @@ export declare class Entries implements Map<string, EntryData> {
432
433
  has(key: string): boolean;
433
434
  set(key: string, value: EntryData): this;
434
435
  delete(key: string): boolean;
436
+ getOrInsert(key: string, defaultValue: EntryData): EntryData;
437
+ getOrInsertComputed(key: string, callback: (key: string) => EntryData): EntryData;
435
438
  get(key: string): EntryData | undefined;
436
439
  keys(): ReturnType<Map<string, EntryData>['keys']>;
437
440
  }
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type binding from '@rspack/binding';
10
+ import type binding from './binding';
11
11
  import * as liteTapable from '@rspack/lite-tapable';
12
12
  import type Watchpack from 'watchpack';
13
13
  import type { Source } from 'webpack-sources';
@@ -16,7 +16,7 @@ import type { CompilationParams } from './Compilation';
16
16
  import { Compilation } from './Compilation';
17
17
  import { ContextModuleFactory } from './ContextModuleFactory';
18
18
  import type { EntryNormalized, OutputNormalized, RspackOptionsNormalized, RspackPluginInstance } from './config';
19
- import type { PlatformTargetProperties } from './config/target';
19
+ import type { ExtractedTargetProperties, PlatformTargetProperties } from './config/target';
20
20
  import type { FileSystemInfoEntry } from './FileSystemInfo';
21
21
  import type { rspack } from './index';
22
22
  import Cache from './lib/Cache';
@@ -79,6 +79,7 @@ export type CompilerHooks = {
79
79
  entryOption: liteTapable.SyncBailHook<[string, EntryNormalized], any>;
80
80
  additionalPass: liteTapable.AsyncSeriesHook<[]>;
81
81
  };
82
+ export declare const GET_COMPILER_ID: unique symbol;
82
83
  declare class Compiler {
83
84
  #private;
84
85
  hooks: CompilerHooks;
@@ -129,6 +130,8 @@ declare class Compiler {
129
130
  get _lastCompilation(): Compilation | undefined;
130
131
  get platform(): PlatformTargetProperties;
131
132
  set platform(platform: PlatformTargetProperties);
133
+ get target(): ExtractedTargetProperties;
134
+ set target(target: ExtractedTargetProperties);
132
135
  /**
133
136
  * Note: This is not a webpack public API, maybe removed in future.
134
137
  * @internal
@@ -1 +1 @@
1
- export { ConcatenatedModule } from '@rspack/binding';
1
+ export { ConcatenatedModule } from './binding';
@@ -1 +1 @@
1
- export { ContextModule } from '@rspack/binding';
1
+ export { ContextModule } from './binding';
@@ -1,4 +1,4 @@
1
- import type { Diagnostics } from '@rspack/binding';
1
+ import type { Diagnostics } from './binding';
2
2
  import type { RspackError } from './RspackError';
3
3
  declare const $proxy: unique symbol;
4
4
  export declare function createDiagnosticArray(adm: Diagnostics & {
@@ -1,2 +1,2 @@
1
- import type { ChunkGroup } from '@rspack/binding';
1
+ import type { ChunkGroup } from './binding';
2
2
  export type Entrypoint = ChunkGroup;
@@ -1,4 +1,4 @@
1
- import type { JsExportsInfo } from '@rspack/binding';
1
+ import type { JsExportsInfo } from './binding';
2
2
  import type { RuntimeSpec } from './util/runtime';
3
3
  /**
4
4
  * Unused: 0
@@ -1 +1 @@
1
- export { ExternalModule } from '@rspack/binding';
1
+ export { ExternalModule } from './binding';
@@ -1,4 +1,4 @@
1
- import type { NodeFsStats, ThreadsafeNodeFS } from '@rspack/binding';
1
+ import type { NodeFsStats, ThreadsafeNodeFS } from './binding';
2
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>;
@@ -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, ThreadsafeIntermediateNodeFS, ThreadsafeOutputNodeFS, };
package/dist/Module.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import binding, { type AssetInfo } from '@rspack/binding';
1
+ import binding, { type AssetInfo } from './binding';
2
2
  import type { Source } from 'webpack-sources';
3
3
  import type { ResourceData } from './Resolver';
4
4
  import './BuildInfo';
@@ -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 './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 './binding';
@@ -1,4 +1,4 @@
1
- import type { Dependency, JsModuleGraph, ModuleGraphConnection } from '@rspack/binding';
1
+ import type { Dependency, JsModuleGraph, ModuleGraphConnection } from './binding';
2
2
  import { ExportsInfo } from './ExportsInfo';
3
3
  import type { Module } from './Module';
4
4
  export default class ModuleGraph {
@@ -7,6 +7,7 @@ export default class ModuleGraph {
7
7
  constructor(binding: JsModuleGraph);
8
8
  getModule(dependency: Dependency): Module | null;
9
9
  getResolvedModule(dependency: Dependency): Module | null;
10
+ getUsedExports(module: Module, runtime: string | string[]): string[] | boolean | null;
10
11
  getParentModule(dependency: Dependency): Module | null;
11
12
  getIssuer(module: Module): Module | null;
12
13
  getExportsInfo(module: Module): ExportsInfo;
@@ -1,4 +1,4 @@
1
- import binding from '@rspack/binding';
1
+ import binding from './binding';
2
2
  import type Watchpack from 'watchpack';
3
3
  import type { FileSystemInfoEntry, InputFileSystem, Watcher, WatchFileSystem } from './util/fs';
4
4
  export default class NativeWatchFileSystem implements WatchFileSystem {
@@ -4,12 +4,11 @@ import type { LoaderContext } from './config';
4
4
  import type { Module } from './Module';
5
5
  export interface NormalModuleCompilationHooks {
6
6
  loader: liteTapable.SyncHook<[LoaderContext, Module]>;
7
- readResourceForScheme: any;
8
7
  readResource: liteTapable.HookMap<liteTapable.AsyncSeriesBailHook<[LoaderContext], string | Buffer>>;
9
8
  }
10
- declare module '@rspack/binding' {
9
+ declare module './binding' {
11
10
  interface NormalModuleConstructor {
12
11
  getCompilationHooks(compilation: Compilation): NormalModuleCompilationHooks;
13
12
  }
14
13
  }
15
- export { NormalModule } from '@rspack/binding';
14
+ export { NormalModule } from './binding';
@@ -1,4 +1,4 @@
1
- import type binding from '@rspack/binding';
1
+ import type binding from './binding';
2
2
  import * as liteTapable from '@rspack/lite-tapable';
3
3
  import type { ResolveData, ResourceDataWithData } from './Module';
4
4
  import type { ResolveOptionsWithDependencyType, ResolverFactory } from './ResolverFactory';
@@ -1,4 +1,4 @@
1
- import type binding from '@rspack/binding';
1
+ import type binding from './binding';
2
2
  import type { ResolveCallback } from './config/adapterRuleUse';
3
3
  export type ResolveContext = {
4
4
  contextDependencies?: {
@@ -1,4 +1,4 @@
1
- import binding from '@rspack/binding';
1
+ import binding from './binding';
2
2
  import { type Resolve } from './config';
3
3
  import { Resolver } from './Resolver';
4
4
  export type ResolveOptionsWithDependencyType = Resolve & {
@@ -1,5 +1,5 @@
1
- import type binding from '@rspack/binding';
2
- export type { RspackError } from '@rspack/binding';
1
+ import type binding from './binding';
2
+ export type { RspackError } from './binding';
3
3
  export type RspackSeverity = binding.JsRspackSeverity;
4
4
  export declare class NonErrorEmittedError extends Error {
5
5
  constructor(error: Error);
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { JsRuntimeGlobals } from '@rspack/binding';
10
+ import type { JsRuntimeGlobals } from './binding';
11
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;
@@ -352,5 +352,5 @@ export declare enum RuntimeVariable {
352
352
  }
353
353
  export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
354
354
  export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
355
- declare const DefaultRuntimeGlobals: Record<"publicPath" | "chunkName" | "moduleId" | "module" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
355
+ declare const DefaultRuntimeGlobals: Record<"module" | "publicPath" | "chunkName" | "moduleId" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
356
356
  export { DefaultRuntimeGlobals as RuntimeGlobals };
@@ -1,4 +1,4 @@
1
- import type { JsAddingRuntimeModule, JsRuntimeModule, JsSource } from '@rspack/binding';
1
+ import type { JsAddingRuntimeModule, JsRuntimeModule, JsSource } from './binding';
2
2
  import type { Chunk } from './Chunk';
3
3
  import type { ChunkGraph } from './ChunkGraph';
4
4
  import type { Compilation } from './Compilation';
@@ -31,7 +31,7 @@ export declare class BrowserRequirePlugin {
31
31
  * This is an unsafe way to execute code in the browser using `new Function`.
32
32
  * It is your responsibility to ensure that your application is not vulnerable to attacks due to this function.
33
33
  */
34
- static unsafeExecute: ((code: string, runtime: CommonJsRuntime) => void) | undefined;
34
+ static unsafeExecute: (code: string, runtime: CommonJsRuntime) => void;
35
35
  constructor(options: BrowserRequirePluginOptions);
36
36
  apply(compiler: Compiler): void;
37
37
  }
@@ -10,4 +10,4 @@ declare const readFileSync: (file: import("memfs/lib/core").TFileId, options?: i
10
10
  (path: import("memfs/lib/node/types/misc").PathLike, options: import("memfs/lib/node/types/options").IReaddirOptions | string, callback: import("memfs/lib/node/types/misc").TCallback<import("memfs/lib/encoding").TDataOut[] | import("memfs/lib/node/Dirent").Dirent[]>): any;
11
11
  }, watch: (path: import("memfs/lib/node/types/misc").PathLike, options?: import("memfs/lib/node/volume").IWatchOptions | string, listener?: (eventType: string, filename: string) => void) => import("memfs/lib/node/volume").FSWatcher;
12
12
  export default fs;
13
- export { readFileSync, readdirSync, lstat, existsSync, readdir, watch };
13
+ export { existsSync, lstat, readdir, readdirSync, readFileSync, watch };
@@ -0,0 +1 @@
1
+ export declare const lazyCompilationMiddleware: () => never;
@@ -1,3 +1,4 @@
1
+ import type { GetLoaderOptions } from '../../config/adapterRuleUse';
1
2
  /**
2
3
  MIT License
3
4
 
@@ -49,15 +50,15 @@ export declare enum Features {
49
50
  Color = 64512
50
51
  }
51
52
  export interface Targets {
52
- android?: number;
53
- chrome?: number;
54
- edge?: number;
55
- firefox?: number;
56
- ie?: number;
57
- ios_saf?: number;
58
- opera?: number;
59
- safari?: number;
60
- samsung?: number;
53
+ android?: string;
54
+ chrome?: string;
55
+ edge?: string;
56
+ firefox?: string;
57
+ ie?: string;
58
+ ios_saf?: string;
59
+ opera?: string;
60
+ safari?: string;
61
+ samsung?: string;
61
62
  }
62
63
  export interface Drafts {
63
64
  /** Whether to enable @custom-media rules. */
@@ -110,3 +111,4 @@ export type LoaderOptions = {
110
111
  pseudoClasses?: PseudoClasses;
111
112
  unusedSymbols?: string[];
112
113
  };
114
+ export declare const getLightningcssLoaderOptions: GetLoaderOptions;
@@ -0,0 +1,4 @@
1
+ import type binding from '../../binding';
2
+ import type { Targets } from './index';
3
+ export declare function encodeTargets(targets: Targets): binding.RawLightningCssBrowsers;
4
+ export declare function defaultTargetsFromRspackTargets(targets: Record<string, string>): binding.RawLightningCssBrowsers;
@@ -1,5 +1,5 @@
1
+ import type { GetLoaderOptions } from '../../config/adapterRuleUse';
1
2
  export type { CollectTypeScriptInfoOptions } from './collectTypeScriptInfo';
2
- export { resolveCollectTypeScriptInfo } from './collectTypeScriptInfo';
3
3
  export type { PluginImportOptions } from './pluginImport';
4
- export { resolvePluginImport } from './pluginImport';
5
4
  export type { SwcLoaderEnvConfig, SwcLoaderEsParserConfig, SwcLoaderJscConfig, SwcLoaderModuleConfig, SwcLoaderOptions, SwcLoaderParserConfig, SwcLoaderTransformConfig, SwcLoaderTsParserConfig, } from './types';
5
+ export declare const getSwcLoaderOptions: GetLoaderOptions;
@@ -29,5 +29,5 @@ type PluginImportConfig = {
29
29
  };
30
30
  type PluginImportOptions = PluginImportConfig[];
31
31
  declare function resolvePluginImport(pluginImport: PluginImportOptions): RawPluginImportConfig[] | undefined;
32
- export { resolvePluginImport };
33
32
  export type { PluginImportOptions };
33
+ export { resolvePluginImport };
@@ -8,21 +8,55 @@ export type SwcLoaderParserConfig = ParserConfig;
8
8
  export type SwcLoaderEsParserConfig = EsParserConfig;
9
9
  export type SwcLoaderTsParserConfig = TsParserConfig;
10
10
  export type SwcLoaderTransformConfig = TransformConfig;
11
- export type SwcLoaderOptions = Config & {
11
+ type SwcLoaderCommonOptions = Omit<Config, 'jsc'> & {
12
12
  isModule?: boolean | 'unknown';
13
13
  /**
14
14
  * Collects information from TypeScript's AST for consumption by subsequent Rspack processes,
15
15
  * providing better TypeScript development experience and smaller output bundle size.
16
16
  */
17
17
  collectTypeScriptInfo?: CollectTypeScriptInfoOptions;
18
+ /**
19
+ * Ported from [babel-plugin-import](https://github.com/umijs/babel-plugin-import),
20
+ * used to transform imports for modular component libraries.
21
+ */
22
+ transformImport?: PluginImportOptions;
18
23
  /**
19
24
  * Experimental features provided by Rspack.
20
25
  * @experimental
21
26
  */
22
27
  rspackExperiments?: {
28
+ /**
29
+ * @deprecated Use top-level `transformImport` instead.
30
+ */
23
31
  import?: PluginImportOptions;
32
+ /**
33
+ * Enable React Server Components support.
34
+ */
35
+ reactServerComponents?: boolean | ReactServerComponentsOptions;
24
36
  };
25
37
  };
38
+ export type SwcLoaderOptions = (SwcLoaderCommonOptions & {
39
+ /**
40
+ * When set to `"auto"`, `builtin:swc-loader` infers `jsc.parser` from the resource extension.
41
+ * This is useful when one rule needs to handle mixed module types such as `.js`, `.jsx`, `.ts`, and `.tsx`.
42
+ * @default false
43
+ */
44
+ detectSyntax?: false;
45
+ jsc?: JscConfig;
46
+ }) | (SwcLoaderCommonOptions & {
47
+ detectSyntax: 'auto';
48
+ jsc?: Omit<JscConfig, 'parser'> & {
49
+ parser?: Partial<ParserConfig>;
50
+ };
51
+ });
52
+ export interface ReactServerComponentsOptions {
53
+ /**
54
+ * Whether to disable the compile-time check that reports errors when React
55
+ * client-only APIs (e.g. `useState`, `useEffect`) are imported in server
56
+ * components. Defaults to `false`.
57
+ */
58
+ disableClientApiChecks?: boolean;
59
+ }
26
60
  export interface TerserCompressOptions {
27
61
  arguments?: boolean;
28
62
  arrows?: boolean;
@@ -81,3 +115,4 @@ export interface TerserCompressOptions {
81
115
  const_to_let?: boolean;
82
116
  module?: boolean;
83
117
  }
118
+ export {};
@@ -1,4 +1,4 @@
1
- import { type Chunk } from '@rspack/binding';
1
+ import { type Chunk } from '../binding';
2
2
  export type Rule = string | RegExp;
3
3
  export type Rules = Rule[] | Rule;
4
4
  export type BannerFunction = (args: {
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import type { Compilation } from '../Compilation';
3
3
  import type { Compiler } from '../Compiler';
4
4
  import type { Module } from '../Module';
@@ -1,4 +1,4 @@
1
- import { type RawCopyPattern } from '@rspack/binding';
1
+ import { type RawCopyPattern } from '../binding';
2
2
  export type CopyRspackPluginOptions = {
3
3
  /** An array of objects that describe the copy operations to be performed. */
4
4
  patterns: (string | (Pick<RawCopyPattern, 'from'> & Partial<Omit<RawCopyPattern, 'from'>>))[];
@@ -1,4 +1,4 @@
1
- import binding from '@rspack/binding';
1
+ import binding from '../binding';
2
2
  export interface CssChunkingPluginOptions {
3
3
  strict?: boolean;
4
4
  minSize?: number;
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import { RspackBuiltinPlugin } from './base';
3
3
  export declare class DeterministicChunkIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import { RspackBuiltinPlugin } from './base';
3
3
  export declare class DeterministicModuleIdsPlugin extends RspackBuiltinPlugin {
4
4
  name: BuiltinPluginName;
@@ -1,4 +1,4 @@
1
- import { type RawDllReferenceAgencyPluginOptions } from '@rspack/binding';
1
+ import { type RawDllReferenceAgencyPluginOptions } from '../binding';
2
2
  export type DllReferenceAgencyPluginOptions = RawDllReferenceAgencyPluginOptions;
3
3
  export declare const DllReferenceAgencyPlugin: {
4
4
  new (options: RawDllReferenceAgencyPluginOptions): {
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import type { Compiler } from '../Compiler';
3
3
  import type { EntryDynamicNormalized } from '../config';
4
4
  import { RspackBuiltinPlugin } from './base';
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import type { Compiler, LibraryType } from '..';
3
3
  import { RspackBuiltinPlugin } from './base';
4
4
  export declare class EnableLibraryPlugin extends RspackBuiltinPlugin {
@@ -1,4 +1,4 @@
1
- import { EntryDependency, type JsEntryOptions } from '@rspack/binding';
1
+ import { EntryDependency, type JsEntryOptions } from '../binding';
2
2
  import type { EntryDescriptionNormalized } from '../config';
3
3
  /**
4
4
  * Options for the `EntryPlugin`.
@@ -1,11 +1,15 @@
1
1
  import type { Compiler } from '../Compiler';
2
+ import type { OptimizationSplitChunksOptions, RspackOptionsNormalized } from '../config';
3
+ export declare function applyLimits(options: RspackOptionsNormalized): void;
2
4
  export declare class EsmLibraryPlugin {
3
5
  static PLUGIN_NAME: string;
4
- options?: {
6
+ options: {
5
7
  preserveModules?: string;
8
+ splitChunks?: OptimizationSplitChunksOptions | false;
6
9
  };
7
10
  constructor(options?: {
8
11
  preserveModules?: string;
12
+ splitChunks?: OptimizationSplitChunksOptions | false;
9
13
  });
10
14
  apply(compiler: Compiler): void;
11
15
  }
@@ -0,0 +1,9 @@
1
+ export declare const EsmNodeTargetPlugin: {
2
+ new (): {
3
+ name: string;
4
+ _args: [];
5
+ affectedHooks: keyof import("..").CompilerHooks | undefined;
6
+ raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
7
+ apply(compiler: import("..").Compiler): void;
8
+ };
9
+ };
@@ -1,4 +1,4 @@
1
- import { type RawEvalDevToolModulePluginOptions } from '@rspack/binding';
1
+ import { type RawEvalDevToolModulePluginOptions } from '../binding';
2
2
  export type { RawEvalDevToolModulePluginOptions as EvalDevToolModulePluginOptions };
3
3
  export declare const EvalDevToolModulePlugin: {
4
4
  new (options: RawEvalDevToolModulePluginOptions): {
@@ -1,4 +1,4 @@
1
- import { type SourceMapDevToolPluginOptions } from '@rspack/binding';
1
+ import { type SourceMapDevToolPluginOptions } from '../binding';
2
2
  export declare const EvalSourceMapDevToolPlugin: {
3
3
  new (options: SourceMapDevToolPluginOptions): {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import type { Externals } from '..';
3
3
  import { RspackBuiltinPlugin } from './base';
4
4
  export declare class ExternalsPlugin extends RspackBuiltinPlugin {
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import { RspackBuiltinPlugin } from './base';
3
3
  export declare class FlagDependencyUsagePlugin extends RspackBuiltinPlugin {
4
4
  private global;
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import type { Compiler } from '../Compiler';
3
3
  import { RspackBuiltinPlugin } from './base';
4
4
  export declare class HotModuleReplacementPlugin extends RspackBuiltinPlugin {
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName, type RawHttpUriPluginOptions } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName, type RawHttpUriPluginOptions } from '../binding';
2
2
  import type { Compiler } from '../Compiler';
3
3
  import { RspackBuiltinPlugin } from './base';
4
4
  export type HttpUriPluginOptionsAllowedUris = (string | RegExp)[];
@@ -1,4 +1,4 @@
1
- import { type RawIgnorePluginOptions } from '@rspack/binding';
1
+ import { type RawIgnorePluginOptions } from '../binding';
2
2
  export type IgnorePluginOptions = {
3
3
  /** A RegExp to test the resource against. */
4
4
  resourceRegExp: NonNullable<RawIgnorePluginOptions['resourceRegExp']>;
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import * as liteTapable from '@rspack/lite-tapable';
3
3
  import type { Chunk } from '../Chunk';
4
4
  import { type Compilation } from '../Compilation';
@@ -1,4 +1,5 @@
1
- import { type Drafts, type FeatureOptions, type NonStandard, type PseudoClasses } from '../builtin-loader/lightningcss';
1
+ import { type Drafts, type FeatureOptions, type NonStandard, type PseudoClasses, type Targets } from '../builtin-loader/lightningcss';
2
+ import type { Compiler } from '../Compiler';
2
3
  import type { AssetConditions } from '../util/assetCondition';
3
4
  export type LightningCssMinimizerRspackPluginOptions = {
4
5
  test?: AssetConditions;
@@ -7,7 +8,7 @@ export type LightningCssMinimizerRspackPluginOptions = {
7
8
  removeUnusedLocalIdents?: boolean;
8
9
  minimizerOptions?: {
9
10
  errorRecovery?: boolean;
10
- targets?: string[] | string;
11
+ targets?: string[] | string | Targets;
11
12
  include?: FeatureOptions;
12
13
  exclude?: FeatureOptions;
13
14
  drafts?: Drafts;
@@ -21,7 +22,7 @@ export declare const LightningCssMinimizerRspackPlugin: {
21
22
  name: string;
22
23
  _args: [options?: LightningCssMinimizerRspackPluginOptions | undefined];
23
24
  affectedHooks: keyof import("..").CompilerHooks | undefined;
24
- raw(compiler: import("..").Compiler): import("../binding").BuiltinPlugin;
25
- apply(compiler: import("..").Compiler): void;
25
+ raw(compiler: Compiler): import("../binding").BuiltinPlugin;
26
+ apply(compiler: Compiler): void;
26
27
  };
27
28
  };