@rspack/browser 2.0.0-beta.5 → 2.0.0-beta.6
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/builtin-loader/swc/types.d.ts +9 -1
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +2 -2
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/devServer.d.ts +96 -224
- package/dist/config/types.d.ts +2 -2
- package/dist/container/ContainerPlugin.d.ts +3 -2
- package/dist/container/ContainerReferencePlugin.d.ts +4 -3
- package/dist/container/ModuleFederationPlugin.d.ts +2 -1
- package/dist/container/ModuleFederationPluginV1.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +339 -123
- package/dist/napi-binding.d.ts +6 -5
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +2 -2
- package/dist/sharing/ConsumeSharedPlugin.d.ts +5 -5
- package/dist/sharing/ProvideSharedPlugin.d.ts +6 -5
- package/dist/sharing/SharePlugin.d.ts +9 -7
- package/dist/wasi-worker-browser.mjs +180 -67
- package/package.json +1 -1
package/dist/napi-binding.d.ts
CHANGED
|
@@ -1930,7 +1930,7 @@ export interface RawConsumeOptions {
|
|
|
1930
1930
|
import?: string
|
|
1931
1931
|
importResolved?: string
|
|
1932
1932
|
shareKey: string
|
|
1933
|
-
shareScope: string
|
|
1933
|
+
shareScope: string | Array<string>
|
|
1934
1934
|
requiredVersion?: string | false | undefined
|
|
1935
1935
|
packageName?: string
|
|
1936
1936
|
strictVersion: boolean
|
|
@@ -1946,7 +1946,7 @@ export interface RawConsumeSharedPluginOptions {
|
|
|
1946
1946
|
|
|
1947
1947
|
export interface RawContainerPluginOptions {
|
|
1948
1948
|
name: string
|
|
1949
|
-
shareScope: string
|
|
1949
|
+
shareScope: string | Array<string>
|
|
1950
1950
|
library: JsLibraryOptions
|
|
1951
1951
|
runtime?: false | string
|
|
1952
1952
|
filename?: string
|
|
@@ -1957,7 +1957,7 @@ export interface RawContainerPluginOptions {
|
|
|
1957
1957
|
export interface RawContainerReferencePluginOptions {
|
|
1958
1958
|
remoteType: string
|
|
1959
1959
|
remotes: Array<RawRemoteOptions>
|
|
1960
|
-
shareScope?: string
|
|
1960
|
+
shareScope?: string | Array<string>
|
|
1961
1961
|
enhanced: boolean
|
|
1962
1962
|
}
|
|
1963
1963
|
|
|
@@ -2256,6 +2256,7 @@ export interface RawExternalsPresets {
|
|
|
2256
2256
|
export interface RawExtractComments {
|
|
2257
2257
|
banner?: string | boolean
|
|
2258
2258
|
condition?: string
|
|
2259
|
+
conditionFlags?: string
|
|
2259
2260
|
}
|
|
2260
2261
|
|
|
2261
2262
|
export interface RawFallbackCacheGroupOptions {
|
|
@@ -2773,7 +2774,7 @@ export interface RawProgressPluginOptions {
|
|
|
2773
2774
|
export interface RawProvideOptions {
|
|
2774
2775
|
key: string
|
|
2775
2776
|
shareKey: string
|
|
2776
|
-
shareScope: string
|
|
2777
|
+
shareScope: string | Array<string>
|
|
2777
2778
|
version?: string | false | undefined
|
|
2778
2779
|
eager: boolean
|
|
2779
2780
|
singleton?: boolean
|
|
@@ -2794,7 +2795,7 @@ export interface RawRemoteAliasTarget {
|
|
|
2794
2795
|
export interface RawRemoteOptions {
|
|
2795
2796
|
key: string
|
|
2796
2797
|
external: Array<string>
|
|
2797
|
-
shareScope: string
|
|
2798
|
+
shareScope: string | Array<string>
|
|
2798
2799
|
}
|
|
2799
2800
|
|
|
2800
2801
|
export interface RawResolveOptions {
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type BuiltinPlugin, BuiltinPluginName } from '../binding';
|
|
2
2
|
import { RspackBuiltinPlugin } from '../builtin-plugin/base';
|
|
3
3
|
import type { Compiler } from '../Compiler';
|
|
4
|
-
import { type NormalizedSharedOptions } from './SharePlugin';
|
|
4
|
+
import { type NormalizedSharedOptions, type ShareScope } from './SharePlugin';
|
|
5
5
|
export type CollectSharedEntryPluginOptions = {
|
|
6
6
|
sharedOptions: NormalizedSharedOptions;
|
|
7
|
-
shareScope?:
|
|
7
|
+
shareScope?: ShareScope;
|
|
8
8
|
};
|
|
9
9
|
export type ShareRequestsMap = Record<string, {
|
|
10
10
|
shareScope: string;
|
|
@@ -3,7 +3,7 @@ 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,14 +17,14 @@ 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
23
|
treeShakingMode?: 'server-calc' | 'runtime-infer';
|
|
24
24
|
};
|
|
25
|
-
export declare function normalizeConsumeShareOptions(consumes: Consumes, shareScope?: string): [string, {
|
|
25
|
+
export declare function normalizeConsumeShareOptions(consumes: Consumes, shareScope?: string | string[]): [string, {
|
|
26
26
|
import: string | undefined;
|
|
27
|
-
shareScope: string;
|
|
27
|
+
shareScope: string | string[];
|
|
28
28
|
shareKey: string;
|
|
29
29
|
requiredVersion: string | false | undefined;
|
|
30
30
|
strictVersion: boolean;
|
|
@@ -38,7 +38,7 @@ export declare class ConsumeSharedPlugin extends RspackBuiltinPlugin {
|
|
|
38
38
|
_options: {
|
|
39
39
|
consumes: [string, {
|
|
40
40
|
import: string | undefined;
|
|
41
|
-
shareScope: string;
|
|
41
|
+
shareScope: string | string[];
|
|
42
42
|
shareKey: string;
|
|
43
43
|
requiredVersion: string | false | undefined;
|
|
44
44
|
strictVersion: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
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;
|
|
@@ -28,10 +29,10 @@ type ProvidesEnhancedExtraConfig = {
|
|
|
28
29
|
*/
|
|
29
30
|
treeShakingMode?: 'server-calc' | 'runtime-infer';
|
|
30
31
|
};
|
|
31
|
-
export declare function normalizeProvideShareOptions<Enhanced extends boolean = false>(options: Provides<Enhanced>, shareScope?:
|
|
32
|
+
export declare function normalizeProvideShareOptions<Enhanced extends boolean = false>(options: Provides<Enhanced>, shareScope?: ShareScope, enhanced?: boolean): [string, {
|
|
32
33
|
shareKey: string;
|
|
33
34
|
version: string | false | undefined;
|
|
34
|
-
shareScope:
|
|
35
|
+
shareScope: ShareScope;
|
|
35
36
|
eager: boolean;
|
|
36
37
|
} | {
|
|
37
38
|
singleton: boolean | undefined;
|
|
@@ -40,7 +41,7 @@ export declare function normalizeProvideShareOptions<Enhanced extends boolean =
|
|
|
40
41
|
treeShakingMode: "server-calc" | "runtime-infer" | undefined;
|
|
41
42
|
shareKey: string;
|
|
42
43
|
version: string | false | undefined;
|
|
43
|
-
shareScope:
|
|
44
|
+
shareScope: ShareScope;
|
|
44
45
|
eager: boolean;
|
|
45
46
|
}][];
|
|
46
47
|
export declare class ProvideSharedPlugin<Enhanced extends boolean = false> extends RspackBuiltinPlugin {
|
|
@@ -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
|
};
|
|
@@ -20,7 +22,7 @@ export type SharedConfig = {
|
|
|
20
22
|
packageName?: string;
|
|
21
23
|
requiredVersion?: false | string;
|
|
22
24
|
shareKey?: string;
|
|
23
|
-
shareScope?:
|
|
25
|
+
shareScope?: ShareScope;
|
|
24
26
|
singleton?: boolean;
|
|
25
27
|
strictVersion?: boolean;
|
|
26
28
|
version?: false | string;
|
|
@@ -31,7 +33,7 @@ export declare function normalizeSharedOptions(shared: Shared): NormalizedShared
|
|
|
31
33
|
export declare function createProvideShareOptions(normalizedSharedOptions: NormalizedSharedOptions): {
|
|
32
34
|
[x: string]: {
|
|
33
35
|
shareKey: string;
|
|
34
|
-
shareScope:
|
|
36
|
+
shareScope: ShareScope | undefined;
|
|
35
37
|
version: string | false | undefined;
|
|
36
38
|
eager: boolean | undefined;
|
|
37
39
|
singleton: boolean | undefined;
|
|
@@ -44,7 +46,7 @@ export declare function createConsumeShareOptions(normalizedSharedOptions: Norma
|
|
|
44
46
|
[x: string]: {
|
|
45
47
|
import: string | false | undefined;
|
|
46
48
|
shareKey: string;
|
|
47
|
-
shareScope:
|
|
49
|
+
shareScope: ShareScope | undefined;
|
|
48
50
|
requiredVersion: string | false | undefined;
|
|
49
51
|
strictVersion: boolean | undefined;
|
|
50
52
|
singleton: boolean | undefined;
|
|
@@ -54,12 +56,12 @@ export declare function createConsumeShareOptions(normalizedSharedOptions: Norma
|
|
|
54
56
|
};
|
|
55
57
|
}[];
|
|
56
58
|
export declare class SharePlugin {
|
|
57
|
-
_shareScope:
|
|
59
|
+
_shareScope: ShareScope | undefined;
|
|
58
60
|
_consumes: {
|
|
59
61
|
[x: string]: {
|
|
60
62
|
import: string | false | undefined;
|
|
61
63
|
shareKey: string;
|
|
62
|
-
shareScope:
|
|
64
|
+
shareScope: ShareScope | undefined;
|
|
63
65
|
requiredVersion: string | false | undefined;
|
|
64
66
|
strictVersion: boolean | undefined;
|
|
65
67
|
singleton: boolean | undefined;
|
|
@@ -71,7 +73,7 @@ export declare class SharePlugin {
|
|
|
71
73
|
_provides: {
|
|
72
74
|
[x: string]: {
|
|
73
75
|
shareKey: string;
|
|
74
|
-
shareScope:
|
|
76
|
+
shareScope: ShareScope | undefined;
|
|
75
77
|
version: string | false | undefined;
|
|
76
78
|
eager: boolean | undefined;
|
|
77
79
|
singleton: boolean | undefined;
|