@rspack/core 0.2.4 → 0.2.5
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/config/adapter.js +10 -3
- package/dist/config/adapter.js.map +1 -1
- package/dist/config/defaults.js +38 -10
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/normalization.d.ts.map +1 -1
- package/dist/config/normalization.js +7 -2
- package/dist/config/normalization.js.map +1 -1
- package/dist/config/types.d.ts +10 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/zod/builtins.d.ts +73 -0
- package/dist/config/zod/builtins.d.ts.map +1 -1
- package/dist/config/zod/builtins.js +18 -0
- package/dist/config/zod/builtins.js.map +1 -1
- package/dist/config/zod/entry.d.ts +3 -0
- package/dist/config/zod/entry.d.ts.map +1 -1
- package/dist/config/zod/entry.js +2 -1
- package/dist/config/zod/entry.js.map +1 -1
- package/dist/config/zod/index.d.ts +323 -35
- package/dist/config/zod/index.d.ts.map +1 -1
- package/dist/config/zod/output.d.ts +154 -21
- package/dist/config/zod/output.d.ts.map +1 -1
- package/dist/config/zod/output.js +57 -21
- package/dist/config/zod/output.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +16 -0
- package/dist/lib/LoaderOptionsPlugin.d.ts.map +1 -0
- package/dist/lib/LoaderOptionsPlugin.js +57 -0
- package/dist/lib/LoaderOptionsPlugin.js.map +1 -0
- package/dist/schemas/plugins/LoaderOptionsPlugin.check.d.ts +11 -0
- package/dist/schemas/plugins/LoaderOptionsPlugin.check.d.ts.map +1 -0
- package/dist/schemas/plugins/LoaderOptionsPlugin.check.js +51 -0
- package/dist/schemas/plugins/LoaderOptionsPlugin.check.js.map +1 -0
- package/package.json +7 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare function publicPath(): z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodString]>;
|
|
3
|
+
export declare function filename(): z.ZodString;
|
|
3
4
|
export declare function output(): z.ZodObject<{
|
|
4
5
|
iife: z.ZodOptional<z.ZodBoolean>;
|
|
5
6
|
clean: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -45,14 +46,98 @@ export declare function output(): z.ZodObject<{
|
|
|
45
46
|
libraryTarget: z.ZodOptional<z.ZodEnum<["...", "var", "module", "assign", "assign-properties", "this", "window", "self", "global", "commonjs", "commonjs2", "commonjs-module", "commonjs-static", "amd", "amd-require", "umd", "umd2", "jsonp", "system"]>>;
|
|
46
47
|
hashFunction: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>]>>;
|
|
47
48
|
module: z.ZodOptional<z.ZodAny>;
|
|
48
|
-
strictModuleErrorHandling: z.ZodOptional<z.
|
|
49
|
-
umdNamedDefine: z.ZodOptional<z.
|
|
50
|
-
chunkLoadingGlobal: z.ZodOptional<z.
|
|
51
|
-
trustedTypes: z.ZodOptional<z.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
strictModuleErrorHandling: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
umdNamedDefine: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
chunkLoadingGlobal: z.ZodOptional<z.ZodString>;
|
|
52
|
+
trustedTypes: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<true>, z.ZodString]>, z.ZodObject<{
|
|
53
|
+
policyName: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}, "strict", z.ZodTypeAny, {
|
|
55
|
+
policyName?: string | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
policyName?: string | undefined;
|
|
58
|
+
}>]>>;
|
|
59
|
+
hashDigest: z.ZodOptional<z.ZodString>;
|
|
60
|
+
hashDigestLength: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
library: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
62
|
+
amd: z.ZodOptional<z.ZodString>;
|
|
63
|
+
commonjs: z.ZodOptional<z.ZodString>;
|
|
64
|
+
root: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
65
|
+
}, "strict", z.ZodTypeAny, {
|
|
66
|
+
amd?: string | undefined;
|
|
67
|
+
commonjs?: string | undefined;
|
|
68
|
+
root?: string | string[] | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
amd?: string | undefined;
|
|
71
|
+
commonjs?: string | undefined;
|
|
72
|
+
root?: string | string[] | undefined;
|
|
73
|
+
}>]>, z.ZodObject<{
|
|
74
|
+
auxiliaryComment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
75
|
+
amd: z.ZodOptional<z.ZodString>;
|
|
76
|
+
commonjs: z.ZodOptional<z.ZodString>;
|
|
77
|
+
commonjs2: z.ZodOptional<z.ZodString>;
|
|
78
|
+
root: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, "strict", z.ZodTypeAny, {
|
|
80
|
+
amd?: string | undefined;
|
|
81
|
+
commonjs?: string | undefined;
|
|
82
|
+
commonjs2?: string | undefined;
|
|
83
|
+
root?: string | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
amd?: string | undefined;
|
|
86
|
+
commonjs?: string | undefined;
|
|
87
|
+
commonjs2?: string | undefined;
|
|
88
|
+
root?: string | undefined;
|
|
89
|
+
}>]>>;
|
|
90
|
+
export: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>;
|
|
91
|
+
name: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
|
|
92
|
+
amd: z.ZodOptional<z.ZodString>;
|
|
93
|
+
commonjs: z.ZodOptional<z.ZodString>;
|
|
94
|
+
root: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
95
|
+
}, "strict", z.ZodTypeAny, {
|
|
96
|
+
amd?: string | undefined;
|
|
97
|
+
commonjs?: string | undefined;
|
|
98
|
+
root?: string | string[] | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
amd?: string | undefined;
|
|
101
|
+
commonjs?: string | undefined;
|
|
102
|
+
root?: string | string[] | undefined;
|
|
103
|
+
}>]>>;
|
|
104
|
+
type: z.ZodOptional<z.ZodEnum<["...", "var", "module", "assign", "assign-properties", "this", "window", "self", "global", "commonjs", "commonjs2", "commonjs-module", "commonjs-static", "amd", "amd-require", "umd", "umd2", "jsonp", "system"]>>;
|
|
105
|
+
umdNamedDefine: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
}, "strict", z.ZodTypeAny, {
|
|
107
|
+
auxiliaryComment?: string | {
|
|
108
|
+
amd?: string | undefined;
|
|
109
|
+
commonjs?: string | undefined;
|
|
110
|
+
commonjs2?: string | undefined;
|
|
111
|
+
root?: string | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
export?: string | string[] | undefined;
|
|
114
|
+
name?: string | string[] | {
|
|
115
|
+
amd?: string | undefined;
|
|
116
|
+
commonjs?: string | undefined;
|
|
117
|
+
root?: string | string[] | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
type?: "..." | "jsonp" | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | undefined;
|
|
120
|
+
umdNamedDefine?: boolean | undefined;
|
|
121
|
+
}, {
|
|
122
|
+
auxiliaryComment?: string | {
|
|
123
|
+
amd?: string | undefined;
|
|
124
|
+
commonjs?: string | undefined;
|
|
125
|
+
commonjs2?: string | undefined;
|
|
126
|
+
root?: string | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
export?: string | string[] | undefined;
|
|
129
|
+
name?: string | string[] | {
|
|
130
|
+
amd?: string | undefined;
|
|
131
|
+
commonjs?: string | undefined;
|
|
132
|
+
root?: string | string[] | undefined;
|
|
133
|
+
} | undefined;
|
|
134
|
+
type?: "..." | "jsonp" | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | undefined;
|
|
135
|
+
umdNamedDefine?: boolean | undefined;
|
|
136
|
+
}>]>>;
|
|
55
137
|
asyncChunks: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
workerChunkLoading: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodUnion<[z.ZodEnum<["jsonp", "import-scripts", "require", "async-node", "import"]>, z.ZodString]>]>>;
|
|
139
|
+
workerWasmLoading: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<false>, z.ZodEnum<["...", "fetch-streaming", "fetch", "async-node"]>]>>;
|
|
140
|
+
workerPublicPath: z.ZodOptional<z.ZodString>;
|
|
56
141
|
}, "strict", z.ZodTypeAny, {
|
|
57
142
|
iife?: boolean | undefined;
|
|
58
143
|
clean?: boolean | undefined;
|
|
@@ -88,14 +173,38 @@ export declare function output(): z.ZodObject<{
|
|
|
88
173
|
libraryTarget?: "..." | "jsonp" | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | undefined;
|
|
89
174
|
hashFunction?: string | ((...args: unknown[]) => unknown) | undefined;
|
|
90
175
|
module?: any;
|
|
91
|
-
strictModuleErrorHandling?:
|
|
92
|
-
umdNamedDefine?:
|
|
93
|
-
chunkLoadingGlobal?:
|
|
94
|
-
trustedTypes?:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
176
|
+
strictModuleErrorHandling?: boolean | undefined;
|
|
177
|
+
umdNamedDefine?: boolean | undefined;
|
|
178
|
+
chunkLoadingGlobal?: string | undefined;
|
|
179
|
+
trustedTypes?: string | true | {
|
|
180
|
+
policyName?: string | undefined;
|
|
181
|
+
} | undefined;
|
|
182
|
+
hashDigest?: string | undefined;
|
|
183
|
+
hashDigestLength?: number | undefined;
|
|
184
|
+
library?: string | string[] | {
|
|
185
|
+
amd?: string | undefined;
|
|
186
|
+
commonjs?: string | undefined;
|
|
187
|
+
root?: string | string[] | undefined;
|
|
188
|
+
} | {
|
|
189
|
+
auxiliaryComment?: string | {
|
|
190
|
+
amd?: string | undefined;
|
|
191
|
+
commonjs?: string | undefined;
|
|
192
|
+
commonjs2?: string | undefined;
|
|
193
|
+
root?: string | undefined;
|
|
194
|
+
} | undefined;
|
|
195
|
+
export?: string | string[] | undefined;
|
|
196
|
+
name?: string | string[] | {
|
|
197
|
+
amd?: string | undefined;
|
|
198
|
+
commonjs?: string | undefined;
|
|
199
|
+
root?: string | string[] | undefined;
|
|
200
|
+
} | undefined;
|
|
201
|
+
type?: "..." | "jsonp" | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | undefined;
|
|
202
|
+
umdNamedDefine?: boolean | undefined;
|
|
203
|
+
} | undefined;
|
|
98
204
|
asyncChunks?: boolean | undefined;
|
|
205
|
+
workerChunkLoading?: string | false | undefined;
|
|
206
|
+
workerWasmLoading?: false | "..." | "async-node" | "fetch-streaming" | "fetch" | undefined;
|
|
207
|
+
workerPublicPath?: string | undefined;
|
|
99
208
|
}, {
|
|
100
209
|
iife?: boolean | undefined;
|
|
101
210
|
clean?: boolean | undefined;
|
|
@@ -131,13 +240,37 @@ export declare function output(): z.ZodObject<{
|
|
|
131
240
|
libraryTarget?: "..." | "jsonp" | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | undefined;
|
|
132
241
|
hashFunction?: string | ((...args: unknown[]) => unknown) | undefined;
|
|
133
242
|
module?: any;
|
|
134
|
-
strictModuleErrorHandling?:
|
|
135
|
-
umdNamedDefine?:
|
|
136
|
-
chunkLoadingGlobal?:
|
|
137
|
-
trustedTypes?:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
243
|
+
strictModuleErrorHandling?: boolean | undefined;
|
|
244
|
+
umdNamedDefine?: boolean | undefined;
|
|
245
|
+
chunkLoadingGlobal?: string | undefined;
|
|
246
|
+
trustedTypes?: string | true | {
|
|
247
|
+
policyName?: string | undefined;
|
|
248
|
+
} | undefined;
|
|
249
|
+
hashDigest?: string | undefined;
|
|
250
|
+
hashDigestLength?: number | undefined;
|
|
251
|
+
library?: string | string[] | {
|
|
252
|
+
amd?: string | undefined;
|
|
253
|
+
commonjs?: string | undefined;
|
|
254
|
+
root?: string | string[] | undefined;
|
|
255
|
+
} | {
|
|
256
|
+
auxiliaryComment?: string | {
|
|
257
|
+
amd?: string | undefined;
|
|
258
|
+
commonjs?: string | undefined;
|
|
259
|
+
commonjs2?: string | undefined;
|
|
260
|
+
root?: string | undefined;
|
|
261
|
+
} | undefined;
|
|
262
|
+
export?: string | string[] | undefined;
|
|
263
|
+
name?: string | string[] | {
|
|
264
|
+
amd?: string | undefined;
|
|
265
|
+
commonjs?: string | undefined;
|
|
266
|
+
root?: string | string[] | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
type?: "..." | "jsonp" | "var" | "module" | "assign" | "assign-properties" | "this" | "window" | "self" | "global" | "commonjs" | "commonjs2" | "commonjs-module" | "commonjs-static" | "amd" | "amd-require" | "umd" | "umd2" | "system" | undefined;
|
|
269
|
+
umdNamedDefine?: boolean | undefined;
|
|
270
|
+
} | undefined;
|
|
141
271
|
asyncChunks?: boolean | undefined;
|
|
272
|
+
workerChunkLoading?: string | false | undefined;
|
|
273
|
+
workerWasmLoading?: false | "..." | "async-node" | "fetch-streaming" | "fetch" | undefined;
|
|
274
|
+
workerPublicPath?: string | undefined;
|
|
142
275
|
}>;
|
|
143
276
|
//# sourceMappingURL=output.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/config/zod/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/config/zod/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,wBAAgB,UAAU,oDAEzB;AAED,wBAAgB,QAAQ,gBAEvB;AA4DD,wBAAgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DrB"}
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.output = exports.publicPath = void 0;
|
|
3
|
+
exports.output = exports.filename = exports.publicPath = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
function chunkLoadingType() {
|
|
6
6
|
return zod_1.z
|
|
7
7
|
.enum(["jsonp", "import-scripts", "require", "async-node", "import"])
|
|
8
8
|
.or(zod_1.z.string());
|
|
9
9
|
}
|
|
10
|
+
function chunkLoading() {
|
|
11
|
+
return zod_1.z.literal(false).or(chunkLoadingType());
|
|
12
|
+
}
|
|
10
13
|
function wasmLoadingType() {
|
|
11
14
|
return zod_1.z.enum(["...", "fetch-streaming", "fetch", "async-node"]);
|
|
12
15
|
}
|
|
16
|
+
function wasmLoading() {
|
|
17
|
+
return zod_1.z.literal(false).or(wasmLoadingType());
|
|
18
|
+
}
|
|
13
19
|
function publicPath() {
|
|
14
20
|
return zod_1.z.literal("auto").or(zod_1.z.string());
|
|
15
21
|
}
|
|
16
22
|
exports.publicPath = publicPath;
|
|
23
|
+
function filename() {
|
|
24
|
+
return zod_1.z.string();
|
|
25
|
+
}
|
|
26
|
+
exports.filename = filename;
|
|
27
|
+
function workerPublicPath() {
|
|
28
|
+
return zod_1.z.string();
|
|
29
|
+
}
|
|
17
30
|
function libraryType() {
|
|
18
31
|
return zod_1.z.enum([
|
|
19
32
|
"...",
|
|
@@ -37,25 +50,39 @@ function libraryType() {
|
|
|
37
50
|
"system"
|
|
38
51
|
]);
|
|
39
52
|
}
|
|
53
|
+
const umdNamedDefine = zod_1.z.boolean();
|
|
54
|
+
const auxiliaryComment = zod_1.z.string().or(zod_1.z.strictObject({
|
|
55
|
+
amd: zod_1.z.string().optional(),
|
|
56
|
+
commonjs: zod_1.z.string().optional(),
|
|
57
|
+
commonjs2: zod_1.z.string().optional(),
|
|
58
|
+
root: zod_1.z.string().optional()
|
|
59
|
+
}));
|
|
60
|
+
const libraryName = zod_1.z
|
|
61
|
+
.string()
|
|
62
|
+
.or(zod_1.z.string().array())
|
|
63
|
+
.or(zod_1.z.strictObject({
|
|
64
|
+
amd: zod_1.z.string().optional(),
|
|
65
|
+
commonjs: zod_1.z.string().optional(),
|
|
66
|
+
root: zod_1.z.string().or(zod_1.z.string().array()).optional()
|
|
67
|
+
}));
|
|
68
|
+
const libraryOptions = zod_1.z.strictObject({
|
|
69
|
+
auxiliaryComment: auxiliaryComment.optional(),
|
|
70
|
+
export: zod_1.z.string().array().or(zod_1.z.string()).optional(),
|
|
71
|
+
name: libraryName.optional(),
|
|
72
|
+
type: libraryType().optional(),
|
|
73
|
+
umdNamedDefine: umdNamedDefine.optional()
|
|
74
|
+
});
|
|
40
75
|
function output() {
|
|
41
76
|
return zod_1.z.strictObject({
|
|
42
77
|
iife: zod_1.z.boolean().optional(),
|
|
43
78
|
clean: zod_1.z.boolean().optional(),
|
|
44
79
|
assetModuleFilename: zod_1.z.string().optional(),
|
|
45
|
-
auxiliaryComment:
|
|
46
|
-
.string()
|
|
47
|
-
.or(zod_1.z.strictObject({
|
|
48
|
-
amd: zod_1.z.string().optional(),
|
|
49
|
-
commonjs: zod_1.z.string().optional(),
|
|
50
|
-
commonjs2: zod_1.z.string().optional(),
|
|
51
|
-
root: zod_1.z.string().optional()
|
|
52
|
-
}))
|
|
53
|
-
.optional(),
|
|
80
|
+
auxiliaryComment: auxiliaryComment.optional(),
|
|
54
81
|
chunkFormat: zod_1.z
|
|
55
82
|
.enum(["array-push", "commonjs", "module"])
|
|
56
83
|
.or(zod_1.z.literal(false))
|
|
57
84
|
.optional(),
|
|
58
|
-
chunkLoading:
|
|
85
|
+
chunkLoading: chunkLoading().optional(),
|
|
59
86
|
enabledChunkLoadingTypes: chunkLoadingType().array().optional(),
|
|
60
87
|
chunkFilename: zod_1.z.string().optional(),
|
|
61
88
|
cssChunkFilename: zod_1.z.string().optional(),
|
|
@@ -64,7 +91,7 @@ function output() {
|
|
|
64
91
|
hotUpdateMainFilename: zod_1.z.string().optional(),
|
|
65
92
|
webassemblyModuleFilename: zod_1.z.string().optional(),
|
|
66
93
|
hashSalt: zod_1.z.string().optional(),
|
|
67
|
-
filename:
|
|
94
|
+
filename: filename().optional(),
|
|
68
95
|
sourceMapFilename: zod_1.z.string().optional(),
|
|
69
96
|
importFunctionName: zod_1.z.string().optional(),
|
|
70
97
|
publicPath: publicPath().optional(),
|
|
@@ -75,7 +102,7 @@ function output() {
|
|
|
75
102
|
.or(zod_1.z.enum(["anonymous", "use-credentials"]))
|
|
76
103
|
.optional(),
|
|
77
104
|
enabledWasmLoadingTypes: wasmLoadingType().array().optional(),
|
|
78
|
-
wasmLoading:
|
|
105
|
+
wasmLoading: wasmLoading().optional(),
|
|
79
106
|
enabledLibraryTypes: libraryType().or(libraryType().array()).optional(),
|
|
80
107
|
globalObject: zod_1.z.string().min(1).optional(),
|
|
81
108
|
libraryExport: zod_1.z.string().min(1).or(zod_1.z.string().min(1).array()).optional(),
|
|
@@ -83,14 +110,23 @@ function output() {
|
|
|
83
110
|
hashFunction: zod_1.z.string().or(zod_1.z.function()).optional(),
|
|
84
111
|
// TODO(hyf0)
|
|
85
112
|
module: zod_1.z.any().optional(),
|
|
86
|
-
strictModuleErrorHandling: zod_1.z.
|
|
87
|
-
umdNamedDefine:
|
|
88
|
-
chunkLoadingGlobal: zod_1.z.
|
|
89
|
-
trustedTypes: zod_1.z
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
strictModuleErrorHandling: zod_1.z.boolean().optional(),
|
|
114
|
+
umdNamedDefine: umdNamedDefine.optional(),
|
|
115
|
+
chunkLoadingGlobal: zod_1.z.string().optional(),
|
|
116
|
+
trustedTypes: zod_1.z
|
|
117
|
+
.literal(true)
|
|
118
|
+
.or(zod_1.z.string())
|
|
119
|
+
.or(zod_1.z.strictObject({
|
|
120
|
+
policyName: zod_1.z.string().optional()
|
|
121
|
+
}))
|
|
122
|
+
.optional(),
|
|
123
|
+
hashDigest: zod_1.z.string().optional(),
|
|
124
|
+
hashDigestLength: zod_1.z.number().optional(),
|
|
125
|
+
library: libraryName.or(libraryOptions).optional(),
|
|
126
|
+
asyncChunks: zod_1.z.boolean().optional(),
|
|
127
|
+
workerChunkLoading: chunkLoading().optional(),
|
|
128
|
+
workerWasmLoading: wasmLoading().optional(),
|
|
129
|
+
workerPublicPath: workerPublicPath().optional()
|
|
94
130
|
});
|
|
95
131
|
}
|
|
96
132
|
exports.output = output;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/config/zod/output.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,SAAS,gBAAgB;IACxB,OAAO,OAAC;SACN,IAAI,CAAC,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;SACpE,EAAE,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,eAAe;IACvB,OAAO,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAgB,UAAU;IACzB,OAAO,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACzC,CAAC;AAFD,gCAEC;AAED,SAAS,WAAW;IACnB,OAAO,OAAC,CAAC,IAAI,CAAC;QACb,KAAK;QACL,KAAK;QACL,QAAQ;QACR,QAAQ;QACR,mBAAmB;QACnB,MAAM;QACN,QAAQ;QACR,MAAM;QACN,QAAQ;QACR,UAAU;QACV,WAAW;QACX,iBAAiB;QACjB,iBAAiB;QACjB,KAAK;QACL,aAAa;QACb,KAAK;QACL,MAAM;QACN,OAAO;QACP,QAAQ;KACR,CAAC,CAAC;AACJ,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/config/zod/output.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,SAAS,gBAAgB;IACxB,OAAO,OAAC;SACN,IAAI,CAAC,CAAC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;SACpE,EAAE,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,YAAY;IACpB,OAAO,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC;AAChD,CAA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EAAE,WAAW,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;QAClD,WAAW,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACnC,kBAAkB,EAAE,YAAY,EAAE,CAAC,QAAQ,EAAE;QAC7C,iBAAiB,EAAE,WAAW,EAAE,CAAC,QAAQ,EAAE;QAC3C,gBAAgB,EAAE,gBAAgB,EAAE,CAAC,QAAQ,EAAE;KAC/C,CAAC,CAAC;AACJ,CAAC;AA1DD,wBA0DC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ export * from "./multiStats";
|
|
|
8
8
|
export * from "./chunk_group";
|
|
9
9
|
export * from "./normalModuleFactory";
|
|
10
10
|
export { cachedCleverMerge as cleverMerge } from "./util/cleverMerge";
|
|
11
|
-
export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
|
|
12
11
|
export { BannerPlugin } from "./lib/BannerPlugin";
|
|
12
|
+
export { EnvironmentPlugin } from "./lib/EnvironmentPlugin";
|
|
13
|
+
export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
|
|
13
14
|
import { Configuration } from "./config";
|
|
14
15
|
export type OptimizationSplitChunksOptions = NonNullable<Configuration["optimization"]>["splitChunks"];
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,iBAAiB,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,8BAA8B,GAAG,WAAW,CACvD,aAAa,CAAC,cAAc,CAAC,CAC7B,CAAC,aAAa,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.LoaderOptionsPlugin = exports.EnvironmentPlugin = exports.BannerPlugin = exports.cleverMerge = void 0;
|
|
18
18
|
__exportStar(require("./compiler"), exports);
|
|
19
19
|
__exportStar(require("./multiCompiler"), exports);
|
|
20
20
|
__exportStar(require("./compilation"), exports);
|
|
@@ -26,8 +26,10 @@ __exportStar(require("./chunk_group"), exports);
|
|
|
26
26
|
__exportStar(require("./normalModuleFactory"), exports);
|
|
27
27
|
var cleverMerge_1 = require("./util/cleverMerge");
|
|
28
28
|
Object.defineProperty(exports, "cleverMerge", { enumerable: true, get: function () { return cleverMerge_1.cachedCleverMerge; } });
|
|
29
|
-
var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
|
|
30
|
-
Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
|
|
31
29
|
var BannerPlugin_1 = require("./lib/BannerPlugin");
|
|
32
30
|
Object.defineProperty(exports, "BannerPlugin", { enumerable: true, get: function () { return BannerPlugin_1.BannerPlugin; } });
|
|
31
|
+
var EnvironmentPlugin_1 = require("./lib/EnvironmentPlugin");
|
|
32
|
+
Object.defineProperty(exports, "EnvironmentPlugin", { enumerable: true, get: function () { return EnvironmentPlugin_1.EnvironmentPlugin; } });
|
|
33
|
+
var LoaderOptionsPlugin_1 = require("./lib/LoaderOptionsPlugin");
|
|
34
|
+
Object.defineProperty(exports, "LoaderOptionsPlugin", { enumerable: true, get: function () { return LoaderOptionsPlugin_1.LoaderOptionsPlugin; } });
|
|
33
35
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,kDAAgC;AAChC,gDAA8B;AAC9B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,+CAA6B;AAC7B,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAsE;AAA7D,0GAAA,iBAAiB,OAAe;AACzC,6DAA4D;AAAnD,sHAAA,iBAAiB,OAAA;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,kDAAgC;AAChC,gDAA8B;AAC9B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,+CAA6B;AAC7B,gDAA8B;AAC9B,wDAAsC;AACtC,kDAAsE;AAA7D,0GAAA,iBAAiB,OAAe;AACzC,mDAAkD;AAAzC,4GAAA,YAAY,OAAA;AACrB,6DAA4D;AAAnD,sHAAA,iBAAiB,OAAA;AAC1B,iEAAgE;AAAvD,0HAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type LoaderOptionsPluginOptions = any;
|
|
2
|
+
export type Compiler = any;
|
|
3
|
+
export class LoaderOptionsPlugin {
|
|
4
|
+
/**
|
|
5
|
+
* @param {LoaderOptionsPluginOptions} options options object
|
|
6
|
+
*/
|
|
7
|
+
constructor(options?: any);
|
|
8
|
+
options: any;
|
|
9
|
+
/**
|
|
10
|
+
* Apply the plugin
|
|
11
|
+
* @param {Compiler} compiler the compiler instance
|
|
12
|
+
* @returns {void}
|
|
13
|
+
*/
|
|
14
|
+
apply(compiler: any): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=LoaderOptionsPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderOptionsPlugin.d.ts","sourceRoot":"","sources":["../../src/lib/LoaderOptionsPlugin.js"],"names":[],"mappings":";;AAsBA;IACC;;OAEG;IACH,2BASC;IADA,aAAsB;IAGvB;;;;OAIG;IACH,sBAFa,IAAI,CAqBhB;CACD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
3
|
+
Author Tobias Koppers @sokra
|
|
4
|
+
*/
|
|
5
|
+
"use strict";
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.LoaderOptionsPlugin = void 0;
|
|
8
|
+
const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
|
|
9
|
+
const { NormalModule } = require("../normalModule");
|
|
10
|
+
const createSchemaValidation = require("./util/create-schema-validation");
|
|
11
|
+
/** @typedef {import("../declarations/plugins/LoaderOptionsPlugin").LoaderOptionsPluginOptions} LoaderOptionsPluginOptions */
|
|
12
|
+
/** @typedef {import("./Compiler")} Compiler */
|
|
13
|
+
const validate = createSchemaValidation(require("../schemas/plugins/LoaderOptionsPlugin.check.js"), () => require("../schemas/plugins/LoaderOptionsPlugin.json"), {
|
|
14
|
+
name: "Loader Options Plugin",
|
|
15
|
+
baseDataPath: "options"
|
|
16
|
+
});
|
|
17
|
+
class LoaderOptionsPlugin {
|
|
18
|
+
/**
|
|
19
|
+
* @param {LoaderOptionsPluginOptions} options options object
|
|
20
|
+
*/
|
|
21
|
+
constructor(options = {}) {
|
|
22
|
+
validate(options);
|
|
23
|
+
if (typeof options !== "object")
|
|
24
|
+
options = {};
|
|
25
|
+
if (!options.test) {
|
|
26
|
+
options.test = {
|
|
27
|
+
test: () => true
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
this.options = options;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Apply the plugin
|
|
34
|
+
* @param {Compiler} compiler the compiler instance
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
apply(compiler) {
|
|
38
|
+
const options = this.options;
|
|
39
|
+
compiler.hooks.compilation.tap("LoaderOptionsPlugin", compilation => {
|
|
40
|
+
NormalModule.getCompilationHooks(compilation).loader.tap("LoaderOptionsPlugin", context => {
|
|
41
|
+
const resource = context.resourcePath;
|
|
42
|
+
if (!resource)
|
|
43
|
+
return;
|
|
44
|
+
if (ModuleFilenameHelpers.matchObject(options, resource)) {
|
|
45
|
+
for (const key of Object.keys(options)) {
|
|
46
|
+
if (key === "include" || key === "exclude" || key === "test") {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
context[key] = options[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.LoaderOptionsPlugin = LoaderOptionsPlugin;
|
|
57
|
+
//# sourceMappingURL=LoaderOptionsPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderOptionsPlugin.js","sourceRoot":"","sources":["../../src/lib/LoaderOptionsPlugin.js"],"names":[],"mappings":"AAAA;;;EAGE;AAEF,YAAY,CAAC;;;AAEb,MAAM,qBAAqB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AACjE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACpD,MAAM,sBAAsB,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAC;AAE1E,6HAA6H;AAC7H,+CAA+C;AAE/C,MAAM,QAAQ,GAAG,sBAAsB,CACtC,OAAO,CAAC,iDAAiD,CAAC,EAC1D,GAAG,EAAE,CAAC,OAAO,CAAC,6CAA6C,CAAC,EAC5D;IACC,IAAI,EAAE,uBAAuB;IAC7B,YAAY,EAAE,SAAS;CACvB,CACD,CAAC;AACF,MAAM,mBAAmB;IACxB;;OAEG;IACH,YAAY,OAAO,GAAG,EAAE;QACvB,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClB,IAAI,OAAO,OAAO,KAAK,QAAQ;YAAE,OAAO,GAAG,EAAE,CAAC;QAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YAClB,OAAO,CAAC,IAAI,GAAG;gBACd,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI;aAChB,CAAC;SACF;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACb,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE;YACnE,YAAY,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,CACvD,qBAAqB,EACrB,OAAO,CAAC,EAAE;gBACT,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;gBACtC,IAAI,CAAC,QAAQ;oBAAE,OAAO;gBACtB,IAAI,qBAAqB,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;oBACzD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;wBACvC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,MAAM,EAAE;4BAC7D,SAAS;yBACT;wBACD,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;qBAC5B;iBACD;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAEQ,kDAAmB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export = e;
|
|
2
|
+
declare function e(t: any, { instancePath: o, parentData: a, parentDataProperty: i, rootData: n }?: {
|
|
3
|
+
instancePath?: string | undefined;
|
|
4
|
+
parentData: any;
|
|
5
|
+
parentDataProperty: any;
|
|
6
|
+
rootData?: any;
|
|
7
|
+
}): any;
|
|
8
|
+
declare namespace e {
|
|
9
|
+
export { e as default };
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=LoaderOptionsPlugin.check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoaderOptionsPlugin.check.d.ts","sourceRoot":"","sources":["../../../src/schemas/plugins/LoaderOptionsPlugin.check.js"],"names":[],"mappings":";AAMA;;;;;QA2CC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This file was automatically generated.
|
|
4
|
+
* DO NOT MODIFY BY HAND.
|
|
5
|
+
* Run `yarn special-lint-fix` to update
|
|
6
|
+
*/
|
|
7
|
+
const r = /^(?:[A-Za-z]:[\\/]|\\\\|\/)/;
|
|
8
|
+
function e(t, { instancePath: o = "", parentData: a, parentDataProperty: i, rootData: n = t } = {}) {
|
|
9
|
+
if (!t || "object" != typeof t || Array.isArray(t))
|
|
10
|
+
return (e.errors = [{ params: { type: "object" } }]), !1;
|
|
11
|
+
if (void 0 !== t.debug) {
|
|
12
|
+
const r = 0;
|
|
13
|
+
if ("boolean" != typeof t.debug)
|
|
14
|
+
return (e.errors = [{ params: { type: "boolean" } }]), !1;
|
|
15
|
+
var s = 0 === r;
|
|
16
|
+
}
|
|
17
|
+
else
|
|
18
|
+
s = !0;
|
|
19
|
+
if (s) {
|
|
20
|
+
if (void 0 !== t.minimize) {
|
|
21
|
+
const r = 0;
|
|
22
|
+
if ("boolean" != typeof t.minimize)
|
|
23
|
+
return (e.errors = [{ params: { type: "boolean" } }]), !1;
|
|
24
|
+
s = 0 === r;
|
|
25
|
+
}
|
|
26
|
+
else
|
|
27
|
+
s = !0;
|
|
28
|
+
if (s)
|
|
29
|
+
if (void 0 !== t.options) {
|
|
30
|
+
let o = t.options;
|
|
31
|
+
const a = 0;
|
|
32
|
+
if (0 === a) {
|
|
33
|
+
if (!o || "object" != typeof o || Array.isArray(o))
|
|
34
|
+
return (e.errors = [{ params: { type: "object" } }]), !1;
|
|
35
|
+
if (void 0 !== o.context) {
|
|
36
|
+
let t = o.context;
|
|
37
|
+
if ("string" != typeof t)
|
|
38
|
+
return (e.errors = [{ params: { type: "string" } }]), !1;
|
|
39
|
+
if (t.includes("!") || !0 !== r.test(t))
|
|
40
|
+
return (e.errors = [{ params: {} }]), !1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
s = 0 === a;
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
s = !0;
|
|
47
|
+
}
|
|
48
|
+
return (e.errors = null), !0;
|
|
49
|
+
}
|
|
50
|
+
(module.exports = e), (module.exports.default = e);
|
|
51
|
+
//# sourceMappingURL=LoaderOptionsP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IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9B,CAAC;AACD,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A Fast Rust-based Web Bundler",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"ts-node": "10.9.1",
|
|
39
39
|
"wast-loader": "^1.11.4",
|
|
40
40
|
"webpack-dev-server": "4.13.1",
|
|
41
|
-
"@rspack/core": "0.2.
|
|
42
|
-
"@rspack/plugin-minify": "^0.2.
|
|
43
|
-
"@rspack/plugin-node-polyfill": "^0.2.
|
|
44
|
-
"@rspack/postcss-loader": "^0.2.
|
|
41
|
+
"@rspack/core": "0.2.5",
|
|
42
|
+
"@rspack/plugin-minify": "^0.2.5",
|
|
43
|
+
"@rspack/plugin-node-polyfill": "^0.2.5",
|
|
44
|
+
"@rspack/postcss-loader": "^0.2.5"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@swc/helpers": "0.5.1",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"webpack-sources": "3.2.3",
|
|
59
59
|
"zod": "^3.21.4",
|
|
60
60
|
"zod-validation-error": "1.2.0",
|
|
61
|
-
"@rspack/binding": "0.2.
|
|
62
|
-
"@rspack/dev-client": "0.2.
|
|
61
|
+
"@rspack/binding": "0.2.5",
|
|
62
|
+
"@rspack/dev-client": "0.2.5"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "tsc",
|