@rspack/browser 2.0.5 → 2.0.7
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/612.js +69 -0
- package/dist/RuntimeGlobals.d.ts +52 -48
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +6 -0
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +11 -0
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
- package/dist/builtin-plugin/index.d.ts +2 -0
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +2 -2
- package/dist/config/normalization.d.ts +1 -0
- package/dist/config/types.d.ts +41 -20
- package/dist/exports.d.ts +7 -3
- package/dist/index.js +497 -347
- package/dist/napi-binding.d.ts +57 -6
- package/dist/rspack.wasm32-wasi.wasm +0 -0
- package/dist/sharing/IndependentSharedPlugin.d.ts +3 -0
- package/dist/sharing/SharedContainerPlugin.d.ts +1 -1
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +4 -1
- package/package.json +3 -3
package/dist/napi-binding.d.ts
CHANGED
|
@@ -334,7 +334,7 @@ export declare class JsCompilation {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
export declare class JsCompiler {
|
|
337
|
-
constructor(compilerPath: string, options: RawOptions, builtinPlugins:
|
|
337
|
+
constructor(compilerPath: string, options: RawOptions, builtinPlugins: BuiltinPlugin[], registerJsTaps: RegisterJsTaps, outputFilesystem: ThreadsafeNodeFS, intermediateFilesystem: ThreadsafeNodeFS | undefined | null, inputFilesystem: ThreadsafeNodeFS | undefined | null, resolverFactoryReference: JsResolverFactory, unsafeFastDrop: boolean, platform: RawCompilerPlatform)
|
|
338
338
|
setNonSkippableRegisters(kinds: Array<RegisterJsTapKind>): void
|
|
339
339
|
/** Build with the given option passed to the constructor */
|
|
340
340
|
build(callback: (err: null | Error) => void): void
|
|
@@ -566,6 +566,7 @@ export declare enum BuiltinPluginName {
|
|
|
566
566
|
NamedModuleIdsPlugin = 'NamedModuleIdsPlugin',
|
|
567
567
|
NaturalModuleIdsPlugin = 'NaturalModuleIdsPlugin',
|
|
568
568
|
DeterministicModuleIdsPlugin = 'DeterministicModuleIdsPlugin',
|
|
569
|
+
SyncModuleIdsPlugin = 'SyncModuleIdsPlugin',
|
|
569
570
|
HashedModuleIdsPlugin = 'HashedModuleIdsPlugin',
|
|
570
571
|
NaturalChunkIdsPlugin = 'NaturalChunkIdsPlugin',
|
|
571
572
|
NamedChunkIdsPlugin = 'NamedChunkIdsPlugin',
|
|
@@ -616,6 +617,7 @@ export declare enum BuiltinPluginName {
|
|
|
616
617
|
RstestPlugin = 'RstestPlugin',
|
|
617
618
|
RslibPlugin = 'RslibPlugin',
|
|
618
619
|
CircularModulesInfoPlugin = 'CircularModulesInfoPlugin',
|
|
620
|
+
CircularCheckRspackPlugin = 'CircularCheckRspackPlugin',
|
|
619
621
|
CircularDependencyRspackPlugin = 'CircularDependencyRspackPlugin',
|
|
620
622
|
URLPlugin = 'URLPlugin',
|
|
621
623
|
JsLoaderRspackPlugin = 'JsLoaderRspackPlugin',
|
|
@@ -1917,6 +1919,14 @@ export interface RawCacheOptionsPersistent {
|
|
|
1917
1919
|
readonly?: boolean
|
|
1918
1920
|
}
|
|
1919
1921
|
|
|
1922
|
+
export interface RawCircularCheckRspackPluginOptions {
|
|
1923
|
+
failOnError?: boolean
|
|
1924
|
+
exclude?: RegExp
|
|
1925
|
+
include?: RegExp
|
|
1926
|
+
onDetected?: (module: Module, paths: string[]) => void
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
/** Deprecated. Use `RawCircularCheckRspackPluginOptions` instead. */
|
|
1920
1930
|
export interface RawCircularDependencyRspackPluginOptions {
|
|
1921
1931
|
failOnError?: boolean
|
|
1922
1932
|
exclude?: RegExp
|
|
@@ -2093,6 +2103,20 @@ export interface RawCopyRspackPluginOptions {
|
|
|
2093
2103
|
patterns: Array<RawCopyPattern>
|
|
2094
2104
|
}
|
|
2095
2105
|
|
|
2106
|
+
export interface RawCssAutoOrModuleParserOptions {
|
|
2107
|
+
namedExports?: boolean
|
|
2108
|
+
url?: boolean
|
|
2109
|
+
import?: boolean
|
|
2110
|
+
resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
|
|
2111
|
+
animation?: boolean
|
|
2112
|
+
container?: boolean
|
|
2113
|
+
customIdents?: boolean
|
|
2114
|
+
dashedIdents?: boolean
|
|
2115
|
+
function?: boolean
|
|
2116
|
+
grid?: boolean
|
|
2117
|
+
pure?: boolean
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2096
2120
|
export interface RawCssChunkingPluginOptions {
|
|
2097
2121
|
strict?: boolean
|
|
2098
2122
|
minSize?: number
|
|
@@ -2142,8 +2166,11 @@ export interface RawCssModuleParserOptions {
|
|
|
2142
2166
|
import?: boolean
|
|
2143
2167
|
resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
|
|
2144
2168
|
animation?: boolean
|
|
2169
|
+
container?: boolean
|
|
2145
2170
|
customIdents?: boolean
|
|
2146
2171
|
dashedIdents?: boolean
|
|
2172
|
+
function?: boolean
|
|
2173
|
+
grid?: boolean
|
|
2147
2174
|
}
|
|
2148
2175
|
|
|
2149
2176
|
export interface RawCssParserOptions {
|
|
@@ -2151,9 +2178,15 @@ export interface RawCssParserOptions {
|
|
|
2151
2178
|
url?: boolean
|
|
2152
2179
|
import?: boolean
|
|
2153
2180
|
resolveImport?: boolean | ((context: { url: string, media: string | undefined, resourcePath: string, supports: string | undefined, layer: string | undefined }) => boolean)
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
export interface RawDeterministicModuleIdsPluginOptions {
|
|
2184
|
+
context?: string
|
|
2185
|
+
test?: (module: Module) => boolean
|
|
2186
|
+
maxLength?: number
|
|
2187
|
+
salt?: number
|
|
2188
|
+
fixedLength?: boolean
|
|
2189
|
+
failOnConflict?: boolean
|
|
2157
2190
|
}
|
|
2158
2191
|
|
|
2159
2192
|
export interface RawDllEntryPluginOptions {
|
|
@@ -2240,6 +2273,7 @@ export interface RawExperiments {
|
|
|
2240
2273
|
useInputFileSystem?: false | Array<RegExp>
|
|
2241
2274
|
css?: boolean
|
|
2242
2275
|
deferImport: boolean
|
|
2276
|
+
sourceImport: boolean
|
|
2243
2277
|
pureFunctions: boolean
|
|
2244
2278
|
}
|
|
2245
2279
|
|
|
@@ -2444,6 +2478,7 @@ export interface RawJavascriptParserOptions {
|
|
|
2444
2478
|
commonjsMagicComments?: boolean
|
|
2445
2479
|
commonjs?: boolean | { exports?: boolean | 'skipInEsm' }
|
|
2446
2480
|
deferImport?: boolean
|
|
2481
|
+
sourceImport?: boolean
|
|
2447
2482
|
/**
|
|
2448
2483
|
* This option is experimental in Rspack only and subject to change or be removed anytime.
|
|
2449
2484
|
* @experimental
|
|
@@ -2507,6 +2542,7 @@ export interface RawLazyCompilationOption {
|
|
|
2507
2542
|
entries: boolean
|
|
2508
2543
|
imports: boolean
|
|
2509
2544
|
client: string
|
|
2545
|
+
reservedExternals: Array<string>
|
|
2510
2546
|
}
|
|
2511
2547
|
|
|
2512
2548
|
export interface RawLibManifestPluginOptions {
|
|
@@ -2654,6 +2690,7 @@ export interface RawModuleRule {
|
|
|
2654
2690
|
issuer?: RawRuleSetCondition
|
|
2655
2691
|
issuerLayer?: RawRuleSetCondition
|
|
2656
2692
|
dependency?: RawRuleSetCondition
|
|
2693
|
+
phase?: RawRuleSetCondition
|
|
2657
2694
|
scheme?: RawRuleSetCondition
|
|
2658
2695
|
mimetype?: RawRuleSetCondition
|
|
2659
2696
|
oneOf?: Array<RawModuleRule>
|
|
@@ -2784,9 +2821,9 @@ export interface RawParserOptions {
|
|
|
2784
2821
|
type: "asset" | "css" | "css/auto" | "css/global" | "css/module" | "javascript" | "javascript/auto" | "javascript/dynamic" | "javascript/esm" | "json"
|
|
2785
2822
|
asset?: RawAssetParserOptions
|
|
2786
2823
|
css?: RawCssParserOptions
|
|
2787
|
-
cssAuto?:
|
|
2824
|
+
cssAuto?: RawCssAutoOrModuleParserOptions
|
|
2788
2825
|
cssGlobal?: RawCssModuleParserOptions
|
|
2789
|
-
cssModule?:
|
|
2826
|
+
cssModule?: RawCssAutoOrModuleParserOptions
|
|
2790
2827
|
javascript?: RawJavascriptParserOptions
|
|
2791
2828
|
json?: RawJsonParserOptions
|
|
2792
2829
|
}
|
|
@@ -3073,6 +3110,20 @@ export interface RawSwcJsMinimizerRspackPluginOptions {
|
|
|
3073
3110
|
minimizerOptions: RawSwcJsMinimizerOptions
|
|
3074
3111
|
}
|
|
3075
3112
|
|
|
3113
|
+
export declare enum RawSyncModuleIdsPluginMode {
|
|
3114
|
+
Read = 'read',
|
|
3115
|
+
Create = 'create',
|
|
3116
|
+
Merge = 'merge',
|
|
3117
|
+
Update = 'update'
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
export interface RawSyncModuleIdsPluginOptions {
|
|
3121
|
+
path: string
|
|
3122
|
+
context?: string
|
|
3123
|
+
test?: (module: Module) => boolean
|
|
3124
|
+
mode?: 'read' | 'create' | 'merge' | 'update'
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3076
3127
|
export interface RawToOptions {
|
|
3077
3128
|
context: string
|
|
3078
3129
|
absoluteFilename?: string
|
|
Binary file
|
|
@@ -13,6 +13,7 @@ export interface IndependentSharePluginOptions {
|
|
|
13
13
|
manifest?: ModuleFederationManifestPluginOptions;
|
|
14
14
|
injectTreeShakingUsedExports?: boolean;
|
|
15
15
|
treeShakingSharedExcludePlugins?: string[];
|
|
16
|
+
onBuildAssets?: (buildAssets: ShareFallback) => void;
|
|
16
17
|
}
|
|
17
18
|
export type ShareFallback = Record<string, [string, string, string][]>;
|
|
18
19
|
export declare class IndependentSharedPlugin {
|
|
@@ -27,9 +28,11 @@ export declare class IndependentSharedPlugin {
|
|
|
27
28
|
buildAssets: ShareFallback;
|
|
28
29
|
injectTreeShakingUsedExports?: boolean;
|
|
29
30
|
treeShakingSharedExcludePlugins?: string[];
|
|
31
|
+
onBuildAssets?: (buildAssets: ShareFallback) => void;
|
|
30
32
|
name: string;
|
|
31
33
|
constructor(options: IndependentSharePluginOptions);
|
|
32
34
|
apply(compiler: Compiler): void;
|
|
35
|
+
private prepareBuildAssets;
|
|
33
36
|
private createIndependentCompilers;
|
|
34
37
|
private createIndependentCompiler;
|
|
35
38
|
}
|
|
@@ -17,7 +17,7 @@ export declare class SharedContainerPlugin extends RspackBuiltinPlugin {
|
|
|
17
17
|
_shareName: string;
|
|
18
18
|
_globalName: string;
|
|
19
19
|
constructor(options: SharedContainerPluginOptions);
|
|
20
|
-
getData():
|
|
20
|
+
getData(): [string, string, string];
|
|
21
21
|
raw(compiler: Compiler): BuiltinPlugin;
|
|
22
22
|
apply(compiler: Compiler): void;
|
|
23
23
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import type { Compiler } from '../Compiler';
|
|
2
2
|
import type { ModuleFederationPluginOptions } from '../container/ModuleFederationPlugin';
|
|
3
|
+
import { type ShareFallback } from './IndependentSharedPlugin';
|
|
3
4
|
export interface TreeshakingSharedPluginOptions {
|
|
4
5
|
mfConfig: ModuleFederationPluginOptions;
|
|
5
6
|
secondary?: boolean;
|
|
7
|
+
onBuildAssets?: (buildAssets: ShareFallback) => void;
|
|
6
8
|
}
|
|
7
9
|
export declare class TreeShakingSharedPlugin {
|
|
8
10
|
mfConfig: ModuleFederationPluginOptions;
|
|
9
11
|
outputDir: string;
|
|
10
12
|
secondary?: boolean;
|
|
13
|
+
onBuildAssets?: (buildAssets: ShareFallback) => void;
|
|
11
14
|
private _independentSharePlugin?;
|
|
12
15
|
name: string;
|
|
13
16
|
constructor(options: TreeshakingSharedPluginOptions);
|
|
14
17
|
apply(compiler: Compiler): void;
|
|
15
|
-
get buildAssets():
|
|
18
|
+
get buildAssets(): ShareFallback;
|
|
16
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/browser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Rspack for running in the browser. This is still in early stage and may not follow the semver.",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@emnapi/core": "1.10.0",
|
|
33
33
|
"@emnapi/runtime": "1.10.0",
|
|
34
34
|
"@napi-rs/wasm-runtime": "1.1.4",
|
|
35
|
-
"@rspack/lite-tapable": "1.1.
|
|
35
|
+
"@rspack/lite-tapable": "1.1.2",
|
|
36
36
|
"@swc/types": "0.1.26",
|
|
37
|
-
"memfs": "4.57.
|
|
37
|
+
"memfs": "4.57.6",
|
|
38
38
|
"webpack-sources": "3.3.4"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|