@rspack/core 1.0.8 → 1.0.10
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/Chunk.d.ts +2 -1
- package/dist/Chunk.js +8 -0
- package/dist/Compilation.d.ts +20 -5
- package/dist/Compilation.js +24 -4
- package/dist/Compiler.js +10 -5
- package/dist/DependenciesBlock.js +1 -1
- package/dist/Dependency.d.ts +7 -6
- package/dist/Dependency.js +35 -24
- package/dist/Module.d.ts +19 -17
- package/dist/Module.js +132 -49
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +3 -58
- package/dist/config/adapter.js +5 -1
- package/dist/config/defaults.js +4 -0
- package/dist/config/types.d.ts +529 -0
- package/dist/config/types.js +3 -0
- package/dist/config/zod.d.ts +1183 -3011
- package/dist/config/zod.js +51 -13
- package/dist/container/ContainerPlugin.d.ts +2 -18
- package/dist/container/ContainerReferencePlugin.d.ts +1 -1
- package/dist/loader-runner/index.js +1 -1
- package/package.json +2 -2
package/dist/config/zod.js
CHANGED
|
@@ -25,7 +25,11 @@ const context = zod_1.z.string().refine(val => node_path_1.default.isAbsolute(va
|
|
|
25
25
|
}));
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region Mode
|
|
28
|
-
const mode = zod_1.z.enum([
|
|
28
|
+
const mode = zod_1.z.enum([
|
|
29
|
+
"development",
|
|
30
|
+
"production",
|
|
31
|
+
"none"
|
|
32
|
+
]);
|
|
29
33
|
//#endregion
|
|
30
34
|
//#region Falsy
|
|
31
35
|
const falsy = zod_1.z.union([
|
|
@@ -37,18 +41,26 @@ const falsy = zod_1.z.union([
|
|
|
37
41
|
]);
|
|
38
42
|
//#endregion
|
|
39
43
|
//#region Entry
|
|
40
|
-
const publicPath = zod_1.z
|
|
44
|
+
const publicPath = zod_1.z
|
|
45
|
+
.literal("auto")
|
|
46
|
+
.or(filename);
|
|
41
47
|
const baseUri = zod_1.z.string();
|
|
42
48
|
const chunkLoadingType = zod_1.z
|
|
43
49
|
.enum(["jsonp", "import-scripts", "require", "async-node", "import"])
|
|
44
50
|
.or(zod_1.z.string());
|
|
45
|
-
const chunkLoading = zod_1.z
|
|
51
|
+
const chunkLoading = zod_1.z
|
|
52
|
+
.literal(false)
|
|
53
|
+
.or(chunkLoadingType);
|
|
46
54
|
const asyncChunks = zod_1.z.boolean();
|
|
47
55
|
const wasmLoadingType = zod_1.z
|
|
48
56
|
.enum(["fetch-streaming", "fetch", "async-node"])
|
|
49
57
|
.or(zod_1.z.string());
|
|
50
|
-
const wasmLoading = zod_1.z
|
|
51
|
-
|
|
58
|
+
const wasmLoading = zod_1.z
|
|
59
|
+
.literal(false)
|
|
60
|
+
.or(wasmLoadingType);
|
|
61
|
+
const scriptType = zod_1.z
|
|
62
|
+
.enum(["text/javascript", "module"])
|
|
63
|
+
.or(zod_1.z.literal(false));
|
|
52
64
|
const libraryCustomUmdObject = zod_1.z.strictObject({
|
|
53
65
|
amd: zod_1.z.string().optional(),
|
|
54
66
|
commonjs: zod_1.z.string().optional(),
|
|
@@ -65,8 +77,12 @@ const libraryCustomUmdCommentObject = zod_1.z.strictObject({
|
|
|
65
77
|
root: zod_1.z.string().optional()
|
|
66
78
|
});
|
|
67
79
|
const amdContainer = zod_1.z.string();
|
|
68
|
-
const auxiliaryComment = zod_1.z
|
|
69
|
-
|
|
80
|
+
const auxiliaryComment = zod_1.z
|
|
81
|
+
.string()
|
|
82
|
+
.or(libraryCustomUmdCommentObject);
|
|
83
|
+
const libraryExport = zod_1.z
|
|
84
|
+
.string()
|
|
85
|
+
.or(zod_1.z.array(zod_1.z.string()));
|
|
70
86
|
const libraryType = zod_1.z
|
|
71
87
|
.enum([
|
|
72
88
|
"var",
|
|
@@ -98,12 +114,20 @@ const libraryOptions = zod_1.z.strictObject({
|
|
|
98
114
|
type: libraryType,
|
|
99
115
|
umdNamedDefine: umdNamedDefine.optional()
|
|
100
116
|
});
|
|
101
|
-
const library = libraryName
|
|
117
|
+
const library = libraryName
|
|
118
|
+
.or(libraryOptions)
|
|
119
|
+
.optional();
|
|
102
120
|
const layer = zod_1.z.string().or(zod_1.z.null());
|
|
103
121
|
const entryFilename = filename;
|
|
104
|
-
const entryRuntime = zod_1.z
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
const entryRuntime = zod_1.z
|
|
123
|
+
.literal(false)
|
|
124
|
+
.or(zod_1.z.string());
|
|
125
|
+
const entryItem = zod_1.z
|
|
126
|
+
.string()
|
|
127
|
+
.or(zod_1.z.array(zod_1.z.string()));
|
|
128
|
+
const entryDependOn = zod_1.z
|
|
129
|
+
.string()
|
|
130
|
+
.or(zod_1.z.array(zod_1.z.string()));
|
|
107
131
|
const entryDescription = zod_1.z.strictObject({
|
|
108
132
|
import: entryItem,
|
|
109
133
|
runtime: entryRuntime.optional(),
|
|
@@ -364,6 +388,10 @@ const reexportExportsPresence = zod_1.z
|
|
|
364
388
|
const strictExportPresence = zod_1.z.boolean();
|
|
365
389
|
const worker = zod_1.z.array(zod_1.z.string()).or(zod_1.z.boolean());
|
|
366
390
|
const overrideStrict = zod_1.z.enum(["strict", "non-strict"]);
|
|
391
|
+
const requireAsExpression = zod_1.z.boolean();
|
|
392
|
+
const requireDynamic = zod_1.z.boolean();
|
|
393
|
+
const requireResolve = zod_1.z.boolean();
|
|
394
|
+
const importDynamic = zod_1.z.boolean();
|
|
367
395
|
const javascriptParserOptions = zod_1.z.strictObject({
|
|
368
396
|
dynamicImportMode: dynamicImportMode.optional(),
|
|
369
397
|
dynamicImportPreload: dynamicImportPreload.optional(),
|
|
@@ -378,7 +406,13 @@ const javascriptParserOptions = zod_1.z.strictObject({
|
|
|
378
406
|
reexportExportsPresence: reexportExportsPresence.optional(),
|
|
379
407
|
strictExportPresence: strictExportPresence.optional(),
|
|
380
408
|
worker: worker.optional(),
|
|
381
|
-
overrideStrict: overrideStrict.optional()
|
|
409
|
+
overrideStrict: overrideStrict.optional(),
|
|
410
|
+
// #region Not available in webpack yet.
|
|
411
|
+
requireAsExpression: requireAsExpression.optional(),
|
|
412
|
+
requireDynamic: requireDynamic.optional(),
|
|
413
|
+
requireResolve: requireResolve.optional(),
|
|
414
|
+
importDynamic: importDynamic.optional()
|
|
415
|
+
// #endregion
|
|
382
416
|
});
|
|
383
417
|
const parserOptionsByModuleTypeKnown = zod_1.z.strictObject({
|
|
384
418
|
asset: assetParserOptions.optional(),
|
|
@@ -561,7 +595,9 @@ const externalItem = zod_1.z
|
|
|
561
595
|
.function()
|
|
562
596
|
.args(externalItemFunctionData)
|
|
563
597
|
.returns(zod_1.z.promise(externalItemValue)));
|
|
564
|
-
const externals = externalItem
|
|
598
|
+
const externals = externalItem
|
|
599
|
+
.array()
|
|
600
|
+
.or(externalItem);
|
|
565
601
|
//#endregion
|
|
566
602
|
//#region ExternalsPresets
|
|
567
603
|
const externalsPresets = zod_1.z.strictObject({
|
|
@@ -752,6 +788,8 @@ const statsOptions = zod_1.z.strictObject({
|
|
|
752
788
|
warningsSpace: zod_1.z.number().optional()
|
|
753
789
|
});
|
|
754
790
|
const statsValue = zod_1.z.boolean().or(statsPresets).or(statsOptions);
|
|
791
|
+
//#endregion
|
|
792
|
+
//#region Plugins
|
|
755
793
|
const plugin = zod_1.z.union([
|
|
756
794
|
zod_1.z.custom(),
|
|
757
795
|
falsy
|
|
@@ -26,24 +26,8 @@ export declare class ContainerPlugin extends RspackBuiltinPlugin {
|
|
|
26
26
|
_options: {
|
|
27
27
|
name: string;
|
|
28
28
|
shareScope: string;
|
|
29
|
-
library:
|
|
30
|
-
|
|
31
|
-
name?: string | string[] | {
|
|
32
|
-
commonjs?: string | undefined;
|
|
33
|
-
amd?: string | undefined;
|
|
34
|
-
root?: string | string[] | undefined;
|
|
35
|
-
} | undefined;
|
|
36
|
-
amdContainer?: string | undefined;
|
|
37
|
-
auxiliaryComment?: string | {
|
|
38
|
-
commonjs?: string | undefined;
|
|
39
|
-
amd?: string | undefined;
|
|
40
|
-
root?: string | undefined;
|
|
41
|
-
commonjs2?: string | undefined;
|
|
42
|
-
} | undefined;
|
|
43
|
-
export?: string | string[] | undefined;
|
|
44
|
-
umdNamedDefine?: boolean | undefined;
|
|
45
|
-
};
|
|
46
|
-
runtime: string | false | undefined;
|
|
29
|
+
library: LibraryOptions;
|
|
30
|
+
runtime: EntryRuntime | undefined;
|
|
47
31
|
filename: string | undefined;
|
|
48
32
|
exposes: [string, {
|
|
49
33
|
import: string[];
|
|
@@ -21,7 +21,7 @@ export type RemotesConfig = {
|
|
|
21
21
|
export declare class ContainerReferencePlugin extends RspackBuiltinPlugin {
|
|
22
22
|
name: BuiltinPluginName;
|
|
23
23
|
_options: {
|
|
24
|
-
remoteType:
|
|
24
|
+
remoteType: ExternalsType;
|
|
25
25
|
remotes: [string, {
|
|
26
26
|
external: string[];
|
|
27
27
|
shareScope: string;
|
|
@@ -454,7 +454,7 @@ async function runLoaders(compiler, context) {
|
|
|
454
454
|
loaderContext.version = 2;
|
|
455
455
|
loaderContext.sourceMap = compiler.options.devtool
|
|
456
456
|
? (0, adapterRuleUse_1.isUseSourceMap)(compiler.options.devtool)
|
|
457
|
-
: false;
|
|
457
|
+
: context._module.useSourceMap ?? false;
|
|
458
458
|
loaderContext.mode = compiler.options.mode;
|
|
459
459
|
Object.assign(loaderContext, compiler.options.loader);
|
|
460
460
|
const getResolveContext = () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@module-federation/runtime-tools": "0.5.1",
|
|
61
61
|
"@rspack/lite-tapable": "1.0.1",
|
|
62
62
|
"caniuse-lite": "^1.0.30001616",
|
|
63
|
-
"@rspack/binding": "1.0.
|
|
63
|
+
"@rspack/binding": "1.0.10"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@swc/helpers": ">=0.5.1"
|