@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
@@ -43,6 +43,12 @@ const {
43
43
  })
44
44
  worker.addEventListener('message', __wasmCreateOnMessageForFsProxy(__fs))
45
45
 
46
+ worker.addEventListener('error', (event) => {
47
+ if (event.data && typeof event.data === 'object' && event.data.type === 'error') {
48
+ window.dispatchEvent(new CustomEvent('napi-rs-worker-error', { detail: event.data }))
49
+ }
50
+ })
51
+
46
52
  return worker
47
53
  },
48
54
  overwriteImports(importObject) {
@@ -85,6 +91,7 @@ export const JsCompilation = __napiModule.exports.JsCompilation
85
91
  export const JsCompiler = __napiModule.exports.JsCompiler
86
92
  export const JsContextModuleFactoryAfterResolveData = __napiModule.exports.JsContextModuleFactoryAfterResolveData
87
93
  export const JsContextModuleFactoryBeforeResolveData = __napiModule.exports.JsContextModuleFactoryBeforeResolveData
94
+ export const JsCoordinator = __napiModule.exports.JsCoordinator
88
95
  export const JsDependencies = __napiModule.exports.JsDependencies
89
96
  export const JsEntries = __napiModule.exports.JsEntries
90
97
  export const JsExportsInfo = __napiModule.exports.JsExportsInfo
@@ -0,0 +1,22 @@
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
+ import { RspackBuiltinPlugin } from '../builtin-plugin/base';
3
+ import type { Compiler } from '../Compiler';
4
+ import { type NormalizedSharedOptions, type ShareScope } from './SharePlugin';
5
+ export type CollectSharedEntryPluginOptions = {
6
+ sharedOptions: NormalizedSharedOptions;
7
+ shareScope?: ShareScope;
8
+ };
9
+ export type ShareRequestsMap = Record<string, {
10
+ shareScope: string;
11
+ requests: [string, string][];
12
+ }>;
13
+ export declare class CollectSharedEntryPlugin extends RspackBuiltinPlugin {
14
+ name: BuiltinPluginName;
15
+ sharedOptions: NormalizedSharedOptions;
16
+ private _collectedEntries;
17
+ constructor(options: CollectSharedEntryPluginOptions);
18
+ getData(): ShareRequestsMap;
19
+ getFilename(): string;
20
+ apply(compiler: Compiler): void;
21
+ raw(): BuiltinPlugin;
22
+ }
@@ -1,9 +1,9 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import { RspackBuiltinPlugin } from '../builtin-plugin/base';
3
3
  import type { Compiler } from '../Compiler';
4
4
  export type ConsumeSharedPluginOptions = {
5
5
  consumes: Consumes;
6
- shareScope?: string;
6
+ shareScope?: string | string[];
7
7
  enhanced?: boolean;
8
8
  };
9
9
  export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
@@ -17,22 +17,35 @@ export type ConsumesConfig = {
17
17
  packageName?: string;
18
18
  requiredVersion?: false | string;
19
19
  shareKey?: string;
20
- shareScope?: string;
20
+ shareScope?: string | string[];
21
21
  singleton?: boolean;
22
22
  strictVersion?: boolean;
23
+ treeShakingMode?: 'server-calc' | 'runtime-infer';
23
24
  };
25
+ export declare function normalizeConsumeShareOptions(consumes: Consumes, shareScope?: string | string[]): [string, {
26
+ import: string | undefined;
27
+ shareScope: string | string[];
28
+ shareKey: string;
29
+ requiredVersion: string | false | undefined;
30
+ strictVersion: boolean;
31
+ packageName: string | undefined;
32
+ singleton: boolean;
33
+ eager: boolean;
34
+ treeShakingMode: "server-calc" | "runtime-infer" | undefined;
35
+ }][];
24
36
  export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
25
37
  name: BuiltinPluginName;
26
38
  _options: {
27
39
  consumes: [string, {
28
40
  import: string | undefined;
29
- shareScope: string;
41
+ shareScope: string | string[];
30
42
  shareKey: string;
31
43
  requiredVersion: string | false | undefined;
32
44
  strictVersion: boolean;
33
45
  packageName: string | undefined;
34
46
  singleton: boolean;
35
47
  eager: boolean;
48
+ treeShakingMode: "server-calc" | "runtime-infer" | undefined;
36
49
  }][];
37
50
  enhanced: boolean;
38
51
  };
@@ -0,0 +1,35 @@
1
+ import type { Compiler } from '../Compiler';
2
+ import type { LibraryOptions, Plugins } from '../config';
3
+ import { type ModuleFederationManifestPluginOptions } from '../container/ModuleFederationManifestPlugin';
4
+ import type { Shared, SharedConfig } from './SharePlugin';
5
+ export type MakeRequired<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
6
+ export interface IndependentSharePluginOptions {
7
+ name: string;
8
+ shared: Shared;
9
+ library?: LibraryOptions;
10
+ outputDir?: string;
11
+ plugins?: Plugins;
12
+ treeShaking?: boolean;
13
+ manifest?: ModuleFederationManifestPluginOptions;
14
+ injectTreeShakingUsedExports?: boolean;
15
+ treeShakingSharedExcludePlugins?: string[];
16
+ }
17
+ export type ShareFallback = Record<string, [string, string, string][]>;
18
+ export declare class IndependentSharedPlugin {
19
+ mfName: string;
20
+ shared: Shared;
21
+ library?: LibraryOptions;
22
+ sharedOptions: [string, SharedConfig][];
23
+ outputDir: string;
24
+ plugins: Plugins;
25
+ treeShaking?: boolean;
26
+ manifest?: ModuleFederationManifestPluginOptions;
27
+ buildAssets: ShareFallback;
28
+ injectTreeShakingUsedExports?: boolean;
29
+ treeShakingSharedExcludePlugins?: string[];
30
+ name: string;
31
+ constructor(options: IndependentSharePluginOptions);
32
+ apply(compiler: Compiler): void;
33
+ private createIndependentCompilers;
34
+ private createIndependentCompiler;
35
+ }
@@ -1,9 +1,10 @@
1
- import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName, type RawProvideOptions } from '../binding';
2
2
  import { RspackBuiltinPlugin } from '../builtin-plugin/base';
3
3
  import type { Compiler } from '../Compiler';
4
+ import type { ShareScope } from './SharePlugin';
4
5
  export type ProvideSharedPluginOptions<Enhanced extends boolean = false> = {
5
6
  provides: Provides<Enhanced>;
6
- shareScope?: string;
7
+ shareScope?: ShareScope;
7
8
  enhanced?: Enhanced;
8
9
  };
9
10
  export type Provides<Enhanced extends boolean> = (ProvidesItem | ProvidesObject<Enhanced>)[] | ProvidesObject<Enhanced>;
@@ -15,7 +16,7 @@ export type ProvidesConfig<Enhanced extends boolean> = Enhanced extends true ? P
15
16
  type ProvidesV1Config = {
16
17
  eager?: boolean;
17
18
  shareKey: string;
18
- shareScope?: string;
19
+ shareScope?: ShareScope;
19
20
  version?: false | string;
20
21
  };
21
22
  type ProvidesEnhancedConfig = ProvidesV1Config & ProvidesEnhancedExtraConfig;
@@ -23,7 +24,26 @@ type ProvidesEnhancedExtraConfig = {
23
24
  singleton?: boolean;
24
25
  strictVersion?: boolean;
25
26
  requiredVersion?: false | string;
27
+ /**
28
+ * Tree shaking strategy for the shared module.
29
+ */
30
+ treeShakingMode?: 'server-calc' | 'runtime-infer';
26
31
  };
32
+ export declare function normalizeProvideShareOptions<Enhanced extends boolean = false>(options: Provides<Enhanced>, shareScope?: ShareScope, enhanced?: boolean): [string, {
33
+ shareKey: string;
34
+ version: string | false | undefined;
35
+ shareScope: ShareScope;
36
+ eager: boolean;
37
+ } | {
38
+ singleton: boolean | undefined;
39
+ requiredVersion: string | false | undefined;
40
+ strictVersion: boolean | undefined;
41
+ treeShakingMode: "server-calc" | "runtime-infer" | undefined;
42
+ shareKey: string;
43
+ version: string | false | undefined;
44
+ shareScope: ShareScope;
45
+ eager: boolean;
46
+ }][];
27
47
  export declare class ProvideSharedPlugin<Enhanced extends boolean = false> extends RspackBuiltinPlugin {
28
48
  name: BuiltinPluginName;
29
49
  _provides: [string, Omit<RawProvideOptions, 'key'>][];
@@ -1,6 +1,8 @@
1
1
  import type { Compiler } from '../Compiler';
2
+ export type ShareScope = string | string[];
3
+ export declare function validateShareScope(shareScope: ShareScope, enhanced: boolean, pluginName: string): void;
2
4
  export type SharePluginOptions = {
3
- shareScope?: string;
5
+ shareScope?: ShareScope;
4
6
  shared: Shared;
5
7
  enhanced: boolean;
6
8
  };
@@ -9,43 +11,79 @@ export type SharedItem = string;
9
11
  export type SharedObject = {
10
12
  [k: string]: SharedConfig | SharedItem;
11
13
  };
14
+ export type TreeShakingConfig = {
15
+ usedExports?: string[];
16
+ mode?: 'server-calc' | 'runtime-infer';
17
+ filename?: string;
18
+ };
12
19
  export type SharedConfig = {
13
20
  eager?: boolean;
14
21
  import?: false | SharedItem;
15
22
  packageName?: string;
16
23
  requiredVersion?: false | string;
17
24
  shareKey?: string;
18
- shareScope?: string;
25
+ shareScope?: ShareScope;
19
26
  singleton?: boolean;
20
27
  strictVersion?: boolean;
21
28
  version?: false | string;
29
+ treeShaking?: TreeShakingConfig;
22
30
  };
31
+ export type NormalizedSharedOptions = [string, SharedConfig][];
32
+ export declare function normalizeSharedOptions(shared: Shared): NormalizedSharedOptions;
33
+ export declare function createProvideShareOptions(normalizedSharedOptions: NormalizedSharedOptions): {
34
+ [x: string]: {
35
+ shareKey: string;
36
+ shareScope: ShareScope | undefined;
37
+ version: string | false | undefined;
38
+ eager: boolean | undefined;
39
+ singleton: boolean | undefined;
40
+ requiredVersion: string | false | undefined;
41
+ strictVersion: boolean | undefined;
42
+ treeShakingMode: "server-calc" | "runtime-infer" | undefined;
43
+ };
44
+ }[];
45
+ export declare function createConsumeShareOptions(normalizedSharedOptions: NormalizedSharedOptions): {
46
+ [x: string]: {
47
+ import: string | false | undefined;
48
+ shareKey: string;
49
+ shareScope: ShareScope | undefined;
50
+ requiredVersion: string | false | undefined;
51
+ strictVersion: boolean | undefined;
52
+ singleton: boolean | undefined;
53
+ packageName: string | undefined;
54
+ eager: boolean | undefined;
55
+ treeShakingMode: "server-calc" | "runtime-infer" | undefined;
56
+ };
57
+ }[];
23
58
  export declare class SharePlugin {
24
- _shareScope: string | undefined;
59
+ _shareScope: ShareScope | undefined;
25
60
  _consumes: {
26
61
  [x: string]: {
27
62
  import: string | false | undefined;
28
63
  shareKey: string;
29
- shareScope: string | undefined;
64
+ shareScope: ShareScope | undefined;
30
65
  requiredVersion: string | false | undefined;
31
66
  strictVersion: boolean | undefined;
32
67
  singleton: boolean | undefined;
33
68
  packageName: string | undefined;
34
69
  eager: boolean | undefined;
70
+ treeShakingMode: "server-calc" | "runtime-infer" | undefined;
35
71
  };
36
72
  }[];
37
73
  _provides: {
38
74
  [x: string]: {
39
75
  shareKey: string;
40
- shareScope: string | undefined;
76
+ shareScope: ShareScope | undefined;
41
77
  version: string | false | undefined;
42
78
  eager: boolean | undefined;
43
79
  singleton: boolean | undefined;
44
80
  requiredVersion: string | false | undefined;
45
81
  strictVersion: boolean | undefined;
82
+ treeShakingMode: "server-calc" | "runtime-infer" | undefined;
46
83
  };
47
84
  }[];
48
85
  _enhanced: boolean;
86
+ _sharedOptions: NormalizedSharedOptions;
49
87
  constructor(options: SharePluginOptions);
50
88
  apply(compiler: Compiler): void;
51
89
  }
@@ -1,4 +1,4 @@
1
- import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
1
+ import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
2
2
  import { RspackBuiltinPlugin } from '../builtin-plugin/base';
3
3
  import type { Compiler } from '../Compiler';
4
4
  export declare class ShareRuntimePlugin extends RspackBuiltinPlugin {
@@ -0,0 +1,23 @@
1
+ import { type BuiltinPlugin, BuiltinPluginName, type RawSharedContainerPluginOptions } from '../binding';
2
+ import { RspackBuiltinPlugin } from '../builtin-plugin/base';
3
+ import type { Compiler } from '../Compiler';
4
+ import type { LibraryOptions } from '../config';
5
+ export type SharedContainerPluginOptions = {
6
+ mfName: string;
7
+ shareName: string;
8
+ version: string;
9
+ request: string;
10
+ library?: LibraryOptions;
11
+ independentShareFileName?: string;
12
+ };
13
+ export declare class SharedContainerPlugin extends RspackBuiltinPlugin {
14
+ name: BuiltinPluginName;
15
+ filename: string;
16
+ _options: RawSharedContainerPluginOptions;
17
+ _shareName: string;
18
+ _globalName: string;
19
+ constructor(options: SharedContainerPluginOptions);
20
+ getData(): (string | undefined)[];
21
+ raw(compiler: Compiler): BuiltinPlugin;
22
+ apply(compiler: Compiler): void;
23
+ }
@@ -0,0 +1,14 @@
1
+ import type { BuiltinPlugin } from '../binding';
2
+ import { BuiltinPluginName } from '../binding';
3
+ import { RspackBuiltinPlugin } from '../builtin-plugin/base';
4
+ import { type ModuleFederationManifestPluginOptions } from '../container/ModuleFederationManifestPlugin';
5
+ import type { NormalizedSharedOptions } from './SharePlugin';
6
+ export declare class SharedUsedExportsOptimizerPlugin extends RspackBuiltinPlugin {
7
+ name: BuiltinPluginName;
8
+ private sharedOptions;
9
+ private injectTreeShakingUsedExports;
10
+ private manifestOptions;
11
+ constructor(sharedOptions: NormalizedSharedOptions, injectTreeShakingUsedExports?: boolean, manifestOptions?: ModuleFederationManifestPluginOptions);
12
+ private buildOptions;
13
+ raw(): BuiltinPlugin | undefined;
14
+ }
@@ -0,0 +1,16 @@
1
+ import type { Compiler } from '../Compiler';
2
+ import type { ModuleFederationPluginOptions } from '../container/ModuleFederationPlugin';
3
+ export interface TreeshakingSharedPluginOptions {
4
+ mfConfig: ModuleFederationPluginOptions;
5
+ secondary?: boolean;
6
+ }
7
+ export declare class TreeShakingSharedPlugin {
8
+ mfConfig: ModuleFederationPluginOptions;
9
+ outputDir: string;
10
+ secondary?: boolean;
11
+ private _independentSharePlugin?;
12
+ name: string;
13
+ constructor(options: TreeshakingSharedPluginOptions);
14
+ apply(compiler: Compiler): void;
15
+ get buildAssets(): import("./IndependentSharedPlugin").ShareFallback;
16
+ }
@@ -1 +1,2 @@
1
1
  export declare function isRequiredVersion(str: string): boolean;
2
+ export declare const encodeName: (name: string, prefix?: string, withExt?: boolean) => string;
@@ -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 { JsStats, JsStatsCompilation, JsStatsError } from '@rspack/binding';
10
+ import type { JsStats, JsStatsCompilation, JsStatsError } from '../binding';
11
11
  import { HookMap, SyncBailHook, SyncWaterfallHook } from '@rspack/lite-tapable';
12
12
  import type { Compilation } from '../Compilation';
13
13
  import { type GroupConfig } from '../util/smartGrouping';
@@ -1,5 +1,5 @@
1
- import type binding from '@rspack/binding';
2
- import type { JsOriginRecord } from '@rspack/binding';
1
+ import type binding from '../binding';
2
+ import type { JsOriginRecord } from '../binding';
3
3
  import type { Compilation } from '../Compilation';
4
4
  import type { StatsOptions } from '../config';
5
5
  import type { StatsFactory, StatsFactoryContext } from './StatsFactory';
package/dist/swc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { TransformOutput } from '@rspack/binding';
1
+ import type { TransformOutput } from './binding';
2
2
  import type { JsMinifyOptions, Options as TransformOptions } from '@swc/types';
3
- export type { TransformOutput, TransformOptions, JsMinifyOptions };
3
+ export type { JsMinifyOptions, TransformOptions, TransformOutput };
4
4
  export declare function minify(source: string, options?: JsMinifyOptions): Promise<TransformOutput>;
5
5
  export declare function minifySync(source: string, options?: JsMinifyOptions): TransformOutput;
6
6
  export declare function transform(source: string, options?: TransformOptions): Promise<TransformOutput>;
@@ -1,4 +1,4 @@
1
- import binding from '@rspack/binding';
1
+ import binding from '../binding';
2
2
  import type { CreatePartialRegisters } from './types';
3
3
  export declare class CodeGenerationResult {
4
4
  #private;
@@ -1,4 +1,4 @@
1
- import type binding from '@rspack/binding';
1
+ import type binding from '../binding';
2
2
  import type * as liteTapable from '@rspack/lite-tapable';
3
3
  import type { Compiler } from '../Compiler';
4
4
  type CreateHookMapRegisterTaps = <H extends liteTapable.Hook<any, any, any>>(registerKind: binding.RegisterJsTapKind, getHookMap: () => liteTapable.HookMap<H>, createTap: (queried: liteTapable.QueriedHookMap<H>) => any) => (stages: number[]) => binding.JsTap[];
@@ -1,4 +1,4 @@
1
- import type { RawSplitChunkSizes } from '@rspack/binding';
1
+ import type { RawSplitChunkSizes } from '../binding';
2
2
  declare class JsSplitChunkSizes {
3
3
  static __to_binding(sizes?: number | Record<string, number>): number | RawSplitChunkSizes | undefined;
4
4
  }
@@ -13,4 +13,4 @@ import Hash from './hash';
13
13
  * @param algorithm the algorithm name or a constructor creating a hash
14
14
  * @returns the hash
15
15
  */
16
- export declare const createHash: (algorithm: "debug" | "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;
16
+ export declare const createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;
@@ -1,4 +1,4 @@
1
- import type { JsSource } from '@rspack/binding';
1
+ import type { JsSource } from '../binding';
2
2
  import { type Source } from 'webpack-sources';
3
3
  export declare class SourceAdapter {
4
4
  static fromBinding(source: JsSource): Source;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Whether the current environment supports color output (TTY, FORCE_COLOR, NO_COLOR, etc.).
3
+ * Used as the default for stats.colors when not explicitly set.
4
+ * @see https://github.com/web-infra-dev/rspack/issues/9353
5
+ */
6
+ export declare function isStatsColorSupported(): boolean;
@@ -0,0 +1,2 @@
1
+ export declare function encodeVersion(version: string): number | null;
2
+ export declare function decodeVersion(n: number): string;