@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.
- package/dist/BuildInfo.d.ts +3 -3
- package/dist/Chunk.d.ts +3 -3
- package/dist/ChunkGraph.d.ts +2 -2
- package/dist/Chunks.d.ts +2 -2
- package/dist/Compilation.d.ts +6 -3
- package/dist/Compiler.d.ts +5 -2
- package/dist/ConcatenatedModule.d.ts +1 -1
- package/dist/ContextModule.d.ts +1 -1
- package/dist/Diagnostics.d.ts +1 -1
- package/dist/Entrypoint.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +1 -1
- package/dist/FileSystem.d.ts +2 -2
- package/dist/Module.d.ts +3 -3
- package/dist/ModuleGraph.d.ts +2 -1
- package/dist/NativeWatchFileSystem.d.ts +1 -1
- package/dist/NormalModule.d.ts +2 -3
- package/dist/NormalModuleFactory.d.ts +1 -1
- package/dist/Resolver.d.ts +1 -1
- package/dist/ResolverFactory.d.ts +1 -1
- package/dist/RspackError.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/RuntimeModule.d.ts +1 -1
- package/dist/browser/BrowserRequirePlugin.d.ts +1 -1
- package/dist/browser/fs.d.ts +1 -1
- package/dist/browser/middleware.d.ts +1 -0
- package/dist/builtin-loader/lightningcss/index.d.ts +11 -9
- package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
- package/dist/builtin-loader/swc/index.d.ts +2 -2
- package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +36 -1
- package/dist/builtin-plugin/BannerPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +1 -1
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +1 -1
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EntryPlugin.d.ts +1 -1
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +5 -1
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +1 -1
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +1 -1
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +1 -1
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +1 -1
- package/dist/builtin-plugin/IgnorePlugin.d.ts +1 -1
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +5 -4
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +1 -1
- package/dist/builtin-plugin/ProgressPlugin.d.ts +5 -4
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +2 -2
- package/dist/builtin-plugin/RslibPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RstestPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +1 -1
- package/dist/builtin-plugin/RuntimePlugin.d.ts +1 -1
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +2 -1
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +1 -1
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +3 -2
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +1 -1
- package/dist/builtin-plugin/WorkerPlugin.d.ts +2 -1
- package/dist/builtin-plugin/base.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/index.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +1 -1
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +3 -3
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +39 -0
- package/dist/builtin-plugin/rsc/index.d.ts +24 -0
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/adapter.d.ts +1 -1
- package/dist/config/adapterRuleUse.d.ts +3 -2
- package/dist/config/defaults.d.ts +4 -2
- package/dist/config/devServer.d.ts +102 -237
- package/dist/config/normalization.d.ts +2 -3
- package/dist/config/target.d.ts +14 -11
- package/dist/config/types.d.ts +152 -63
- package/dist/container/ContainerPlugin.d.ts +4 -3
- package/dist/container/ContainerReferencePlugin.d.ts +5 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +11 -4
- package/dist/container/ModuleFederationPlugin.d.ts +20 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +4 -0
- package/dist/exports.d.ts +13 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +43927 -8544
- package/dist/index.js.LICENSE.txt +7 -0
- package/dist/lib/DllReferencePlugin.d.ts +1 -1
- package/dist/lib/WebpackError.d.ts +1 -1
- package/dist/loader-runner/index.d.ts +1 -1
- package/dist/loader-runner/worker.d.ts +1 -1
- package/dist/napi-binding.d.ts +248 -101
- package/dist/rspack.wasi-browser.js +7 -0
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +17 -4
- package/dist/sharing/IndependentSharedPlugin.d.ts +35 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +23 -3
- package/dist/sharing/SharePlugin.d.ts +43 -5
- package/dist/sharing/ShareRuntimePlugin.d.ts +1 -1
- package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +16 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/dist/stats/StatsFactory.d.ts +1 -1
- package/dist/stats/statsFactoryUtils.d.ts +2 -2
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/types.d.ts +1 -1
- package/dist/util/SplitChunkSize.d.ts +1 -1
- package/dist/util/createHash.d.ts +1 -1
- package/dist/util/source.d.ts +1 -1
- package/dist/util/supportsColor.d.ts +6 -0
- package/dist/util/targetsVersion.d.ts +2 -0
- package/dist/wasi-worker-browser.mjs +26464 -22498
- package/package.json +6 -7
- package/dist/builtin-loader/index.d.ts +0 -1
- 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 '
|
|
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 '
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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:
|
|
59
|
+
_shareScope: ShareScope | undefined;
|
|
25
60
|
_consumes: {
|
|
26
61
|
[x: string]: {
|
|
27
62
|
import: string | false | undefined;
|
|
28
63
|
shareKey: string;
|
|
29
|
-
shareScope:
|
|
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:
|
|
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 '
|
|
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
|
+
}
|
package/dist/sharing/utils.d.ts
CHANGED
|
@@ -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 '
|
|
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 '
|
|
2
|
-
import type { JsOriginRecord } from '
|
|
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 '
|
|
1
|
+
import type { TransformOutput } from './binding';
|
|
2
2
|
import type { JsMinifyOptions, Options as TransformOptions } from '@swc/types';
|
|
3
|
-
export type {
|
|
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>;
|
package/dist/taps/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type binding from '
|
|
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[];
|
|
@@ -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: "
|
|
16
|
+
export declare const createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => Hash)) => Hash;
|
package/dist/util/source.d.ts
CHANGED
|
@@ -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;
|