@ms-cloudpack/bundler-rspack 0.1.3 → 0.1.4
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.
|
@@ -1,591 +1,8 @@
|
|
|
1
1
|
import type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';
|
|
2
2
|
import type { WriteESMStubsResult } from '@ms-cloudpack/esm-stub-utilities';
|
|
3
|
+
import type { Configuration } from '@rspack/core';
|
|
3
4
|
export declare function getRspackConfiguration(params: {
|
|
4
5
|
options: Omit<BundleOptions, 'entries' | 'outputPath'>;
|
|
5
6
|
outputPath: string;
|
|
6
|
-
} & Pick<WriteESMStubsResult, 'newEntries'>, context: BundleContext):
|
|
7
|
-
[x: string]: unknown;
|
|
8
|
-
} | {
|
|
9
|
-
module?: {
|
|
10
|
-
parser?: {
|
|
11
|
-
javascript?: {
|
|
12
|
-
dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined;
|
|
13
|
-
dynamicImportPreload?: number | boolean | undefined;
|
|
14
|
-
dynamicImportPrefetch?: number | boolean | undefined;
|
|
15
|
-
dynamicImportFetchPriority?: "auto" | "low" | "high" | undefined;
|
|
16
|
-
importMeta?: boolean | undefined;
|
|
17
|
-
url?: boolean | "relative" | undefined;
|
|
18
|
-
exprContextCritical?: boolean | undefined;
|
|
19
|
-
wrappedContextCritical?: boolean | undefined;
|
|
20
|
-
exportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
21
|
-
importExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
22
|
-
reexportExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
23
|
-
strictExportPresence?: boolean | undefined;
|
|
24
|
-
worker?: boolean | string[] | undefined;
|
|
25
|
-
overrideStrict?: "strict" | "non-strict" | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
css?: {
|
|
28
|
-
namedExports?: boolean | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
"css/auto"?: {
|
|
31
|
-
namedExports?: boolean | undefined;
|
|
32
|
-
} | undefined;
|
|
33
|
-
"css/module"?: {
|
|
34
|
-
namedExports?: boolean | undefined;
|
|
35
|
-
} | undefined;
|
|
36
|
-
asset?: {
|
|
37
|
-
dataUrlCondition?: {
|
|
38
|
-
maxSize?: number | undefined;
|
|
39
|
-
} | undefined;
|
|
40
|
-
} | undefined;
|
|
41
|
-
"javascript/auto"?: {
|
|
42
|
-
dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined;
|
|
43
|
-
dynamicImportPreload?: number | boolean | undefined;
|
|
44
|
-
dynamicImportPrefetch?: number | boolean | undefined;
|
|
45
|
-
dynamicImportFetchPriority?: "auto" | "low" | "high" | undefined;
|
|
46
|
-
importMeta?: boolean | undefined;
|
|
47
|
-
url?: boolean | "relative" | undefined;
|
|
48
|
-
exprContextCritical?: boolean | undefined;
|
|
49
|
-
wrappedContextCritical?: boolean | undefined;
|
|
50
|
-
exportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
51
|
-
importExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
52
|
-
reexportExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
53
|
-
strictExportPresence?: boolean | undefined;
|
|
54
|
-
worker?: boolean | string[] | undefined;
|
|
55
|
-
overrideStrict?: "strict" | "non-strict" | undefined;
|
|
56
|
-
} | undefined;
|
|
57
|
-
"javascript/dynamic"?: {
|
|
58
|
-
dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined;
|
|
59
|
-
dynamicImportPreload?: number | boolean | undefined;
|
|
60
|
-
dynamicImportPrefetch?: number | boolean | undefined;
|
|
61
|
-
dynamicImportFetchPriority?: "auto" | "low" | "high" | undefined;
|
|
62
|
-
importMeta?: boolean | undefined;
|
|
63
|
-
url?: boolean | "relative" | undefined;
|
|
64
|
-
exprContextCritical?: boolean | undefined;
|
|
65
|
-
wrappedContextCritical?: boolean | undefined;
|
|
66
|
-
exportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
67
|
-
importExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
68
|
-
reexportExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
69
|
-
strictExportPresence?: boolean | undefined;
|
|
70
|
-
worker?: boolean | string[] | undefined;
|
|
71
|
-
overrideStrict?: "strict" | "non-strict" | undefined;
|
|
72
|
-
} | undefined;
|
|
73
|
-
"javascript/esm"?: {
|
|
74
|
-
dynamicImportMode?: "eager" | "lazy" | "weak" | "lazy-once" | undefined;
|
|
75
|
-
dynamicImportPreload?: number | boolean | undefined;
|
|
76
|
-
dynamicImportPrefetch?: number | boolean | undefined;
|
|
77
|
-
dynamicImportFetchPriority?: "auto" | "low" | "high" | undefined;
|
|
78
|
-
importMeta?: boolean | undefined;
|
|
79
|
-
url?: boolean | "relative" | undefined;
|
|
80
|
-
exprContextCritical?: boolean | undefined;
|
|
81
|
-
wrappedContextCritical?: boolean | undefined;
|
|
82
|
-
exportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
83
|
-
importExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
84
|
-
reexportExportsPresence?: false | "auto" | "error" | "warn" | undefined;
|
|
85
|
-
strictExportPresence?: boolean | undefined;
|
|
86
|
-
worker?: boolean | string[] | undefined;
|
|
87
|
-
overrideStrict?: "strict" | "non-strict" | undefined;
|
|
88
|
-
} | undefined;
|
|
89
|
-
} | Record<string, Record<string, any>> | undefined;
|
|
90
|
-
generator?: Record<string, Record<string, any>> | {
|
|
91
|
-
css?: {
|
|
92
|
-
exportsOnly?: boolean | undefined;
|
|
93
|
-
esModule?: boolean | undefined;
|
|
94
|
-
} | undefined;
|
|
95
|
-
"css/auto"?: {
|
|
96
|
-
exportsOnly?: boolean | undefined;
|
|
97
|
-
esModule?: boolean | undefined;
|
|
98
|
-
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
99
|
-
localIdentName?: string | undefined;
|
|
100
|
-
} | undefined;
|
|
101
|
-
"css/module"?: {
|
|
102
|
-
exportsOnly?: boolean | undefined;
|
|
103
|
-
esModule?: boolean | undefined;
|
|
104
|
-
exportsConvention?: "as-is" | "camel-case" | "camel-case-only" | "dashes" | "dashes-only" | undefined;
|
|
105
|
-
localIdentName?: string | undefined;
|
|
106
|
-
} | undefined;
|
|
107
|
-
asset?: {
|
|
108
|
-
filename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
109
|
-
publicPath?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
110
|
-
emit?: boolean | undefined;
|
|
111
|
-
dataUrl?: {
|
|
112
|
-
mimetype?: string | undefined;
|
|
113
|
-
encoding?: false | "base64" | undefined;
|
|
114
|
-
} | ((args_0: {
|
|
115
|
-
filename: string;
|
|
116
|
-
content: string;
|
|
117
|
-
}, ...args_1: unknown[]) => string) | undefined;
|
|
118
|
-
} | undefined;
|
|
119
|
-
"asset/inline"?: {
|
|
120
|
-
dataUrl?: {
|
|
121
|
-
mimetype?: string | undefined;
|
|
122
|
-
encoding?: false | "base64" | undefined;
|
|
123
|
-
} | ((args_0: {
|
|
124
|
-
filename: string;
|
|
125
|
-
content: string;
|
|
126
|
-
}, ...args_1: unknown[]) => string) | undefined;
|
|
127
|
-
} | undefined;
|
|
128
|
-
"asset/resource"?: {
|
|
129
|
-
filename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
130
|
-
publicPath?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
131
|
-
emit?: boolean | undefined;
|
|
132
|
-
} | undefined;
|
|
133
|
-
} | undefined;
|
|
134
|
-
rules?: (false | "" | 0 | "..." | import("@rspack/core").RuleSetRule | null | undefined)[] | undefined;
|
|
135
|
-
defaultRules?: (false | "" | 0 | "..." | import("@rspack/core").RuleSetRule | null | undefined)[] | undefined;
|
|
136
|
-
noParse?: string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined;
|
|
137
|
-
} | undefined;
|
|
138
|
-
dependencies?: string[] | undefined;
|
|
139
|
-
name?: string | undefined;
|
|
140
|
-
context?: string | undefined;
|
|
141
|
-
performance?: false | {
|
|
142
|
-
assetFilter?: ((args_0: string, ...args_1: unknown[]) => boolean) | undefined;
|
|
143
|
-
hints?: false | "error" | "warning" | undefined;
|
|
144
|
-
maxAssetSize?: number | undefined;
|
|
145
|
-
maxEntrypointSize?: number | undefined;
|
|
146
|
-
} | undefined;
|
|
147
|
-
entry?: string | string[] | Record<string, string | string[] | {
|
|
148
|
-
import: string | string[];
|
|
149
|
-
filename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
150
|
-
publicPath?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
151
|
-
layer?: string | null | undefined;
|
|
152
|
-
runtime?: string | false | undefined;
|
|
153
|
-
baseUri?: string | undefined;
|
|
154
|
-
chunkLoading?: string | false | undefined;
|
|
155
|
-
asyncChunks?: boolean | undefined;
|
|
156
|
-
wasmLoading?: string | false | undefined;
|
|
157
|
-
library?: {
|
|
158
|
-
type: string;
|
|
159
|
-
name?: string | string[] | {
|
|
160
|
-
commonjs?: string | undefined;
|
|
161
|
-
amd?: string | undefined;
|
|
162
|
-
root?: string | string[] | undefined;
|
|
163
|
-
} | undefined;
|
|
164
|
-
amdContainer?: string | undefined;
|
|
165
|
-
auxiliaryComment?: string | {
|
|
166
|
-
commonjs?: string | undefined;
|
|
167
|
-
amd?: string | undefined;
|
|
168
|
-
root?: string | undefined;
|
|
169
|
-
commonjs2?: string | undefined;
|
|
170
|
-
} | undefined;
|
|
171
|
-
export?: string | string[] | undefined;
|
|
172
|
-
umdNamedDefine?: boolean | undefined;
|
|
173
|
-
} | undefined;
|
|
174
|
-
dependOn?: string | string[] | undefined;
|
|
175
|
-
}> | ((...args: unknown[]) => string | string[] | Record<string, string | string[] | {
|
|
176
|
-
import: string | string[];
|
|
177
|
-
filename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
178
|
-
publicPath?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
179
|
-
layer?: string | null | undefined;
|
|
180
|
-
runtime?: string | false | undefined;
|
|
181
|
-
baseUri?: string | undefined;
|
|
182
|
-
chunkLoading?: string | false | undefined;
|
|
183
|
-
asyncChunks?: boolean | undefined;
|
|
184
|
-
wasmLoading?: string | false | undefined;
|
|
185
|
-
library?: {
|
|
186
|
-
type: string;
|
|
187
|
-
name?: string | string[] | {
|
|
188
|
-
commonjs?: string | undefined;
|
|
189
|
-
amd?: string | undefined;
|
|
190
|
-
root?: string | string[] | undefined;
|
|
191
|
-
} | undefined;
|
|
192
|
-
amdContainer?: string | undefined;
|
|
193
|
-
auxiliaryComment?: string | {
|
|
194
|
-
commonjs?: string | undefined;
|
|
195
|
-
amd?: string | undefined;
|
|
196
|
-
root?: string | undefined;
|
|
197
|
-
commonjs2?: string | undefined;
|
|
198
|
-
} | undefined;
|
|
199
|
-
export?: string | string[] | undefined;
|
|
200
|
-
umdNamedDefine?: boolean | undefined;
|
|
201
|
-
} | undefined;
|
|
202
|
-
dependOn?: string | string[] | undefined;
|
|
203
|
-
}> | Promise<string | string[] | Record<string, string | string[] | {
|
|
204
|
-
import: string | string[];
|
|
205
|
-
filename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
206
|
-
publicPath?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
207
|
-
layer?: string | null | undefined;
|
|
208
|
-
runtime?: string | false | undefined;
|
|
209
|
-
baseUri?: string | undefined;
|
|
210
|
-
chunkLoading?: string | false | undefined;
|
|
211
|
-
asyncChunks?: boolean | undefined;
|
|
212
|
-
wasmLoading?: string | false | undefined;
|
|
213
|
-
library?: {
|
|
214
|
-
type: string;
|
|
215
|
-
name?: string | string[] | {
|
|
216
|
-
commonjs?: string | undefined;
|
|
217
|
-
amd?: string | undefined;
|
|
218
|
-
root?: string | string[] | undefined;
|
|
219
|
-
} | undefined;
|
|
220
|
-
amdContainer?: string | undefined;
|
|
221
|
-
auxiliaryComment?: string | {
|
|
222
|
-
commonjs?: string | undefined;
|
|
223
|
-
amd?: string | undefined;
|
|
224
|
-
root?: string | undefined;
|
|
225
|
-
commonjs2?: string | undefined;
|
|
226
|
-
} | undefined;
|
|
227
|
-
export?: string | string[] | undefined;
|
|
228
|
-
umdNamedDefine?: boolean | undefined;
|
|
229
|
-
} | undefined;
|
|
230
|
-
dependOn?: string | string[] | undefined;
|
|
231
|
-
}>>) | undefined;
|
|
232
|
-
node?: false | {
|
|
233
|
-
global?: boolean | "warn" | undefined;
|
|
234
|
-
__dirname?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module" | undefined;
|
|
235
|
-
__filename?: boolean | "warn-mock" | "mock" | "eval-only" | "node-module" | undefined;
|
|
236
|
-
} | undefined;
|
|
237
|
-
profile?: boolean | undefined;
|
|
238
|
-
cache?: boolean | undefined;
|
|
239
|
-
loader?: Record<string, any> | undefined;
|
|
240
|
-
resolve?: import("@rspack/core").ResolveOptions | undefined;
|
|
241
|
-
output?: {
|
|
242
|
-
module?: boolean | undefined;
|
|
243
|
-
filename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
244
|
-
publicPath?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
245
|
-
environment?: {
|
|
246
|
-
module?: boolean | undefined;
|
|
247
|
-
arrowFunction?: boolean | undefined;
|
|
248
|
-
asyncFunction?: boolean | undefined;
|
|
249
|
-
bigIntLiteral?: boolean | undefined;
|
|
250
|
-
const?: boolean | undefined;
|
|
251
|
-
destructuring?: boolean | undefined;
|
|
252
|
-
document?: boolean | undefined;
|
|
253
|
-
dynamicImport?: boolean | undefined;
|
|
254
|
-
dynamicImportInWorker?: boolean | undefined;
|
|
255
|
-
forOf?: boolean | undefined;
|
|
256
|
-
globalThis?: boolean | undefined;
|
|
257
|
-
nodePrefixForCoreModules?: boolean | undefined;
|
|
258
|
-
optionalChaining?: boolean | undefined;
|
|
259
|
-
templateLiteral?: boolean | undefined;
|
|
260
|
-
} | undefined;
|
|
261
|
-
path?: string | undefined;
|
|
262
|
-
chunkFilename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
263
|
-
auxiliaryComment?: string | {
|
|
264
|
-
commonjs?: string | undefined;
|
|
265
|
-
amd?: string | undefined;
|
|
266
|
-
root?: string | undefined;
|
|
267
|
-
commonjs2?: string | undefined;
|
|
268
|
-
} | undefined;
|
|
269
|
-
umdNamedDefine?: boolean | undefined;
|
|
270
|
-
chunkLoading?: string | false | undefined;
|
|
271
|
-
asyncChunks?: boolean | undefined;
|
|
272
|
-
wasmLoading?: string | false | undefined;
|
|
273
|
-
library?: string | string[] | {
|
|
274
|
-
commonjs?: string | undefined;
|
|
275
|
-
amd?: string | undefined;
|
|
276
|
-
root?: string | string[] | undefined;
|
|
277
|
-
} | {
|
|
278
|
-
type: string;
|
|
279
|
-
name?: string | string[] | {
|
|
280
|
-
commonjs?: string | undefined;
|
|
281
|
-
amd?: string | undefined;
|
|
282
|
-
root?: string | string[] | undefined;
|
|
283
|
-
} | undefined;
|
|
284
|
-
amdContainer?: string | undefined;
|
|
285
|
-
auxiliaryComment?: string | {
|
|
286
|
-
commonjs?: string | undefined;
|
|
287
|
-
amd?: string | undefined;
|
|
288
|
-
root?: string | undefined;
|
|
289
|
-
commonjs2?: string | undefined;
|
|
290
|
-
} | undefined;
|
|
291
|
-
export?: string | string[] | undefined;
|
|
292
|
-
umdNamedDefine?: boolean | undefined;
|
|
293
|
-
} | undefined;
|
|
294
|
-
pathinfo?: boolean | "verbose" | undefined;
|
|
295
|
-
clean?: boolean | undefined;
|
|
296
|
-
crossOriginLoading?: false | "anonymous" | "use-credentials" | undefined;
|
|
297
|
-
cssFilename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
298
|
-
cssHeadDataCompression?: boolean | undefined;
|
|
299
|
-
cssChunkFilename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
300
|
-
hotUpdateMainFilename?: string | undefined;
|
|
301
|
-
hotUpdateChunkFilename?: string | undefined;
|
|
302
|
-
hotUpdateGlobal?: string | undefined;
|
|
303
|
-
assetModuleFilename?: string | ((args_0: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsPathData, args_1: import(".store/@rspack-binding-npm-1.0.8-eb8cb06a64/package").JsAssetInfo | undefined, ...args_2: unknown[]) => string) | undefined;
|
|
304
|
-
uniqueName?: string | undefined;
|
|
305
|
-
chunkLoadingGlobal?: string | undefined;
|
|
306
|
-
enabledLibraryTypes?: string[] | undefined;
|
|
307
|
-
libraryExport?: string | string[] | undefined;
|
|
308
|
-
libraryTarget?: string | undefined;
|
|
309
|
-
strictModuleExceptionHandling?: boolean | undefined;
|
|
310
|
-
strictModuleErrorHandling?: boolean | undefined;
|
|
311
|
-
globalObject?: string | undefined;
|
|
312
|
-
importFunctionName?: string | undefined;
|
|
313
|
-
importMetaName?: string | undefined;
|
|
314
|
-
iife?: boolean | undefined;
|
|
315
|
-
enabledWasmLoadingTypes?: string[] | undefined;
|
|
316
|
-
webassemblyModuleFilename?: string | undefined;
|
|
317
|
-
chunkFormat?: string | false | undefined;
|
|
318
|
-
enabledChunkLoadingTypes?: string[] | undefined;
|
|
319
|
-
trustedTypes?: string | true | {
|
|
320
|
-
policyName?: string | undefined;
|
|
321
|
-
} | undefined;
|
|
322
|
-
sourceMapFilename?: string | undefined;
|
|
323
|
-
hashDigest?: string | undefined;
|
|
324
|
-
hashDigestLength?: number | undefined;
|
|
325
|
-
hashFunction?: "xxhash64" | "md4" | undefined;
|
|
326
|
-
hashSalt?: string | undefined;
|
|
327
|
-
workerChunkLoading?: string | false | undefined;
|
|
328
|
-
workerWasmLoading?: string | false | undefined;
|
|
329
|
-
workerPublicPath?: string | undefined;
|
|
330
|
-
scriptType?: false | "module" | "text/javascript" | undefined;
|
|
331
|
-
devtoolNamespace?: string | undefined;
|
|
332
|
-
devtoolModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined;
|
|
333
|
-
devtoolFallbackModuleFilenameTemplate?: string | ((args_0: any) => any) | undefined;
|
|
334
|
-
chunkLoadTimeout?: number | undefined;
|
|
335
|
-
charset?: boolean | undefined;
|
|
336
|
-
} | undefined;
|
|
337
|
-
target?: false | "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | "web" | "webworker" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | "browserslist" | `browserslist:${string}` | ("es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "node" | "async-node" | "web" | "webworker" | `node${number}` | `async-node${number}` | `node${number}.${number}` | `async-node${number}.${number}` | "electron-main" | `electron${number}-main` | `electron${number}.${number}-main` | "electron-renderer" | `electron${number}-renderer` | `electron${number}.${number}-renderer` | "electron-preload" | `electron${number}-preload` | `electron${number}.${number}-preload` | "nwjs" | `nwjs${number}` | `nwjs${number}.${number}` | "node-webkit" | `node-webkit${number}` | `node-webkit${number}.${number}` | "browserslist" | `browserslist:${string}`)[] | undefined;
|
|
338
|
-
mode?: "none" | "development" | "production" | undefined;
|
|
339
|
-
experiments?: {
|
|
340
|
-
css?: boolean | undefined;
|
|
341
|
-
lazyCompilation?: boolean | {
|
|
342
|
-
entries?: boolean | undefined;
|
|
343
|
-
test?: RegExp | ((args_0: import("@rspack/core").Module, ...args_1: unknown[]) => boolean) | undefined;
|
|
344
|
-
backend?: {
|
|
345
|
-
client?: string | undefined;
|
|
346
|
-
listen?: number | {
|
|
347
|
-
path?: string | undefined;
|
|
348
|
-
port?: number | undefined;
|
|
349
|
-
host?: string | undefined;
|
|
350
|
-
backlog?: number | undefined;
|
|
351
|
-
exclusive?: boolean | undefined;
|
|
352
|
-
readableAll?: boolean | undefined;
|
|
353
|
-
writableAll?: boolean | undefined;
|
|
354
|
-
ipv6Only?: boolean | undefined;
|
|
355
|
-
} | undefined;
|
|
356
|
-
protocol?: "http" | "https" | undefined;
|
|
357
|
-
} | undefined;
|
|
358
|
-
imports?: boolean | undefined;
|
|
359
|
-
} | undefined;
|
|
360
|
-
asyncWebAssembly?: boolean | undefined;
|
|
361
|
-
outputModule?: boolean | undefined;
|
|
362
|
-
topLevelAwait?: boolean | undefined;
|
|
363
|
-
layers?: boolean | undefined;
|
|
364
|
-
incremental?: boolean | {
|
|
365
|
-
make?: boolean | undefined;
|
|
366
|
-
providedExports?: boolean | undefined;
|
|
367
|
-
emitAssets?: boolean | undefined;
|
|
368
|
-
inferAsyncModules?: boolean | undefined;
|
|
369
|
-
moduleHashes?: boolean | undefined;
|
|
370
|
-
moduleCodegen?: boolean | undefined;
|
|
371
|
-
moduleRuntimeRequirements?: boolean | undefined;
|
|
372
|
-
} | undefined;
|
|
373
|
-
futureDefaults?: boolean | undefined;
|
|
374
|
-
rspackFuture?: {
|
|
375
|
-
bundlerInfo?: {
|
|
376
|
-
force?: boolean | ("version" | "uniqueId")[] | undefined;
|
|
377
|
-
version?: string | undefined;
|
|
378
|
-
bundler?: string | undefined;
|
|
379
|
-
} | undefined;
|
|
380
|
-
} | undefined;
|
|
381
|
-
} | undefined;
|
|
382
|
-
externals?: string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
|
|
383
|
-
context?: string | undefined;
|
|
384
|
-
dependencyType?: string | undefined;
|
|
385
|
-
request?: string | undefined;
|
|
386
|
-
contextInfo?: {
|
|
387
|
-
issuer: string;
|
|
388
|
-
} | undefined;
|
|
389
|
-
}, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record<string, string | string[]> | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "module-import" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: {
|
|
390
|
-
context?: string | undefined;
|
|
391
|
-
dependencyType?: string | undefined;
|
|
392
|
-
request?: string | undefined;
|
|
393
|
-
contextInfo?: {
|
|
394
|
-
issuer: string;
|
|
395
|
-
} | undefined;
|
|
396
|
-
}, ...args_1: unknown[]) => Promise<string | boolean | string[] | Record<string, string | string[]>>) | (string | RegExp | Record<string, string | boolean | string[] | Record<string, string | string[]>> | ((args_0: {
|
|
397
|
-
context?: string | undefined;
|
|
398
|
-
dependencyType?: string | undefined;
|
|
399
|
-
request?: string | undefined;
|
|
400
|
-
contextInfo?: {
|
|
401
|
-
issuer: string;
|
|
402
|
-
} | undefined;
|
|
403
|
-
}, args_1: (args_0: Error | undefined, args_1: string | boolean | string[] | Record<string, string | string[]> | undefined, args_2: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "module-import" | "script" | "node-commonjs" | undefined, ...args_3: unknown[]) => void, ...args_2: unknown[]) => unknown) | ((args_0: {
|
|
404
|
-
context?: string | undefined;
|
|
405
|
-
dependencyType?: string | undefined;
|
|
406
|
-
request?: string | undefined;
|
|
407
|
-
contextInfo?: {
|
|
408
|
-
issuer: string;
|
|
409
|
-
} | undefined;
|
|
410
|
-
}, ...args_1: unknown[]) => Promise<string | boolean | string[] | Record<string, string | string[]>>))[] | undefined;
|
|
411
|
-
externalsType?: "module" | "global" | "system" | "promise" | "commonjs" | "umd" | "amd" | "jsonp" | "import" | "commonjs2" | "var" | "assign" | "this" | "window" | "self" | "commonjs-module" | "commonjs-static" | "amd-require" | "umd2" | "module-import" | "script" | "node-commonjs" | undefined;
|
|
412
|
-
externalsPresets?: {
|
|
413
|
-
node?: boolean | undefined;
|
|
414
|
-
web?: boolean | undefined;
|
|
415
|
-
nwjs?: boolean | undefined;
|
|
416
|
-
webAsync?: boolean | undefined;
|
|
417
|
-
electron?: boolean | undefined;
|
|
418
|
-
electronMain?: boolean | undefined;
|
|
419
|
-
electronPreload?: boolean | undefined;
|
|
420
|
-
electronRenderer?: boolean | undefined;
|
|
421
|
-
} | undefined;
|
|
422
|
-
infrastructureLogging?: {
|
|
423
|
-
debug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined;
|
|
424
|
-
colors?: boolean | undefined;
|
|
425
|
-
appendOnly?: boolean | undefined;
|
|
426
|
-
console?: Console | undefined;
|
|
427
|
-
level?: "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined;
|
|
428
|
-
stream?: NodeJS.WritableStream | undefined;
|
|
429
|
-
} | undefined;
|
|
430
|
-
devtool?: false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | undefined;
|
|
431
|
-
ignoreWarnings?: (RegExp | ((args_0: Error, args_1: import("@rspack/core").Compilation, ...args_2: unknown[]) => boolean))[] | undefined;
|
|
432
|
-
watchOptions?: {
|
|
433
|
-
aggregateTimeout?: number | undefined;
|
|
434
|
-
followSymlinks?: boolean | undefined;
|
|
435
|
-
ignored?: string | RegExp | string[] | undefined;
|
|
436
|
-
poll?: number | boolean | undefined;
|
|
437
|
-
stdin?: boolean | undefined;
|
|
438
|
-
} | undefined;
|
|
439
|
-
watch?: boolean | undefined;
|
|
440
|
-
stats?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | {
|
|
441
|
-
source?: boolean | undefined;
|
|
442
|
-
publicPath?: boolean | undefined;
|
|
443
|
-
all?: boolean | undefined;
|
|
444
|
-
chunks?: boolean | undefined;
|
|
445
|
-
usedExports?: boolean | undefined;
|
|
446
|
-
providedExports?: boolean | undefined;
|
|
447
|
-
preset?: boolean | "verbose" | "normal" | "none" | "errors-only" | "errors-warnings" | "minimal" | "detailed" | "summary" | undefined;
|
|
448
|
-
assets?: boolean | undefined;
|
|
449
|
-
modules?: boolean | undefined;
|
|
450
|
-
entrypoints?: boolean | "auto" | undefined;
|
|
451
|
-
chunkGroups?: boolean | undefined;
|
|
452
|
-
warnings?: boolean | undefined;
|
|
453
|
-
warningsCount?: boolean | undefined;
|
|
454
|
-
errors?: boolean | undefined;
|
|
455
|
-
errorsCount?: boolean | undefined;
|
|
456
|
-
colors?: boolean | undefined;
|
|
457
|
-
hash?: boolean | undefined;
|
|
458
|
-
version?: boolean | undefined;
|
|
459
|
-
reasons?: boolean | undefined;
|
|
460
|
-
outputPath?: boolean | undefined;
|
|
461
|
-
chunkModules?: boolean | undefined;
|
|
462
|
-
chunkRelations?: boolean | undefined;
|
|
463
|
-
ids?: boolean | undefined;
|
|
464
|
-
timings?: boolean | undefined;
|
|
465
|
-
builtAt?: boolean | undefined;
|
|
466
|
-
moduleAssets?: boolean | undefined;
|
|
467
|
-
nestedModules?: boolean | undefined;
|
|
468
|
-
logging?: boolean | "log" | "info" | "verbose" | "none" | "error" | "warn" | undefined;
|
|
469
|
-
loggingDebug?: string | boolean | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean) | (string | RegExp | ((args_0: string, ...args_1: unknown[]) => boolean))[] | undefined;
|
|
470
|
-
loggingTrace?: boolean | undefined;
|
|
471
|
-
runtimeModules?: boolean | undefined;
|
|
472
|
-
children?: boolean | undefined;
|
|
473
|
-
optimizationBailout?: boolean | undefined;
|
|
474
|
-
groupModulesByType?: boolean | undefined;
|
|
475
|
-
groupModulesByCacheStatus?: boolean | undefined;
|
|
476
|
-
groupModulesByLayer?: boolean | undefined;
|
|
477
|
-
groupModulesByAttributes?: boolean | undefined;
|
|
478
|
-
groupModulesByPath?: boolean | undefined;
|
|
479
|
-
groupModulesByExtension?: boolean | undefined;
|
|
480
|
-
modulesSpace?: number | undefined;
|
|
481
|
-
chunkModulesSpace?: number | undefined;
|
|
482
|
-
nestedModulesSpace?: number | undefined;
|
|
483
|
-
relatedAssets?: boolean | undefined;
|
|
484
|
-
groupAssetsByEmitStatus?: boolean | undefined;
|
|
485
|
-
groupAssetsByInfo?: boolean | undefined;
|
|
486
|
-
groupAssetsByPath?: boolean | undefined;
|
|
487
|
-
groupAssetsByExtension?: boolean | undefined;
|
|
488
|
-
groupAssetsByChunk?: boolean | undefined;
|
|
489
|
-
assetsSpace?: number | undefined;
|
|
490
|
-
orphanModules?: boolean | undefined;
|
|
491
|
-
excludeModules?: string | boolean | RegExp | ((args_0: string, args_1: any, args_2: any) => boolean) | (string | RegExp | ((args_0: string, args_1: any, args_2: any) => boolean))[] | undefined;
|
|
492
|
-
excludeAssets?: string | RegExp | ((args_0: string, args_1: any) => boolean) | (string | RegExp | ((args_0: string, args_1: any) => boolean))[] | undefined;
|
|
493
|
-
modulesSort?: string | undefined;
|
|
494
|
-
chunkModulesSort?: string | undefined;
|
|
495
|
-
nestedModulesSort?: string | undefined;
|
|
496
|
-
chunksSort?: string | undefined;
|
|
497
|
-
assetsSort?: string | undefined;
|
|
498
|
-
performance?: boolean | undefined;
|
|
499
|
-
env?: boolean | undefined;
|
|
500
|
-
chunkGroupAuxiliary?: boolean | undefined;
|
|
501
|
-
chunkGroupChildren?: boolean | undefined;
|
|
502
|
-
chunkGroupMaxAssets?: number | undefined;
|
|
503
|
-
dependentModules?: boolean | undefined;
|
|
504
|
-
chunkOrigins?: boolean | undefined;
|
|
505
|
-
runtime?: boolean | undefined;
|
|
506
|
-
depth?: boolean | undefined;
|
|
507
|
-
reasonsSpace?: number | undefined;
|
|
508
|
-
groupReasonsByOrigin?: boolean | undefined;
|
|
509
|
-
errorDetails?: boolean | undefined;
|
|
510
|
-
errorStack?: boolean | undefined;
|
|
511
|
-
moduleTrace?: boolean | undefined;
|
|
512
|
-
cachedModules?: boolean | undefined;
|
|
513
|
-
cachedAssets?: boolean | undefined;
|
|
514
|
-
cached?: boolean | undefined;
|
|
515
|
-
errorsSpace?: number | undefined;
|
|
516
|
-
warningsSpace?: number | undefined;
|
|
517
|
-
} | undefined;
|
|
518
|
-
snapshot?: {} | undefined;
|
|
519
|
-
optimization?: {
|
|
520
|
-
moduleIds?: "named" | "natural" | "deterministic" | undefined;
|
|
521
|
-
chunkIds?: "named" | "natural" | "deterministic" | undefined;
|
|
522
|
-
minimize?: boolean | undefined;
|
|
523
|
-
minimizer?: (false | "" | 0 | import("@rspack/core").RspackPluginInstance | "..." | import("@rspack/core").RspackPluginFunction | import("@rspack/core").WebpackPluginInstance | import("@rspack/core").WebpackPluginFunction | null | undefined)[] | undefined;
|
|
524
|
-
mergeDuplicateChunks?: boolean | undefined;
|
|
525
|
-
usedExports?: boolean | "global" | undefined;
|
|
526
|
-
splitChunks?: false | {
|
|
527
|
-
name?: string | false | ((args_0: import("@rspack/core").Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
|
|
528
|
-
chunks?: RegExp | "async" | "initial" | "all" | ((args_0: import("@rspack/core").Chunk, ...args_1: unknown[]) => boolean) | undefined;
|
|
529
|
-
defaultSizeTypes?: string[] | undefined;
|
|
530
|
-
minChunks?: number | undefined;
|
|
531
|
-
usedExports?: boolean | undefined;
|
|
532
|
-
minSize?: number | Record<string, number> | undefined;
|
|
533
|
-
maxSize?: number | Record<string, number> | undefined;
|
|
534
|
-
maxAsyncSize?: number | Record<string, number> | undefined;
|
|
535
|
-
maxInitialSize?: number | Record<string, number> | undefined;
|
|
536
|
-
maxAsyncRequests?: number | undefined;
|
|
537
|
-
maxInitialRequests?: number | undefined;
|
|
538
|
-
automaticNameDelimiter?: string | undefined;
|
|
539
|
-
cacheGroups?: Record<string, false | {
|
|
540
|
-
filename?: string | undefined;
|
|
541
|
-
name?: string | false | ((args_0: import("@rspack/core").Module | undefined, ...args_1: unknown[]) => unknown) | undefined;
|
|
542
|
-
priority?: number | undefined;
|
|
543
|
-
type?: string | RegExp | undefined;
|
|
544
|
-
test?: string | RegExp | ((args_0: import("@rspack/core").Module, ...args_1: unknown[]) => unknown) | undefined;
|
|
545
|
-
enforce?: boolean | undefined;
|
|
546
|
-
reuseExistingChunk?: boolean | undefined;
|
|
547
|
-
idHint?: string | undefined;
|
|
548
|
-
chunks?: RegExp | "async" | "initial" | "all" | ((args_0: import("@rspack/core").Chunk, ...args_1: unknown[]) => boolean) | undefined;
|
|
549
|
-
defaultSizeTypes?: string[] | undefined;
|
|
550
|
-
minChunks?: number | undefined;
|
|
551
|
-
usedExports?: boolean | undefined;
|
|
552
|
-
minSize?: number | Record<string, number> | undefined;
|
|
553
|
-
maxSize?: number | Record<string, number> | undefined;
|
|
554
|
-
maxAsyncSize?: number | Record<string, number> | undefined;
|
|
555
|
-
maxInitialSize?: number | Record<string, number> | undefined;
|
|
556
|
-
maxAsyncRequests?: number | undefined;
|
|
557
|
-
maxInitialRequests?: number | undefined;
|
|
558
|
-
automaticNameDelimiter?: string | undefined;
|
|
559
|
-
}> | undefined;
|
|
560
|
-
fallbackCacheGroup?: {
|
|
561
|
-
chunks?: RegExp | "async" | "initial" | "all" | ((args_0: import("@rspack/core").Chunk, ...args_1: unknown[]) => boolean) | undefined;
|
|
562
|
-
minSize?: number | undefined;
|
|
563
|
-
maxSize?: number | undefined;
|
|
564
|
-
maxAsyncSize?: number | undefined;
|
|
565
|
-
maxInitialSize?: number | undefined;
|
|
566
|
-
automaticNameDelimiter?: string | undefined;
|
|
567
|
-
} | undefined;
|
|
568
|
-
hidePathInfo?: boolean | undefined;
|
|
569
|
-
} | undefined;
|
|
570
|
-
runtimeChunk?: boolean | "single" | "multiple" | {
|
|
571
|
-
name?: string | ((args_0: {
|
|
572
|
-
name: string;
|
|
573
|
-
}, ...args_1: unknown[]) => string) | undefined;
|
|
574
|
-
} | undefined;
|
|
575
|
-
removeAvailableModules?: boolean | undefined;
|
|
576
|
-
removeEmptyChunks?: boolean | undefined;
|
|
577
|
-
realContentHash?: boolean | undefined;
|
|
578
|
-
sideEffects?: boolean | "flag" | undefined;
|
|
579
|
-
providedExports?: boolean | undefined;
|
|
580
|
-
concatenateModules?: boolean | undefined;
|
|
581
|
-
innerGraph?: boolean | undefined;
|
|
582
|
-
mangleExports?: boolean | "size" | "deterministic" | undefined;
|
|
583
|
-
nodeEnv?: string | false | undefined;
|
|
584
|
-
emitOnErrors?: boolean | undefined;
|
|
585
|
-
} | undefined;
|
|
586
|
-
resolveLoader?: import("@rspack/core").ResolveOptions | undefined;
|
|
587
|
-
plugins?: (false | "" | 0 | import("@rspack/core").RspackPluginInstance | import("@rspack/core").RspackPluginFunction | import("@rspack/core").WebpackPluginInstance | import("@rspack/core").WebpackPluginFunction | null | undefined)[] | undefined;
|
|
588
|
-
devServer?: import("@rspack/core").DevServer | undefined;
|
|
589
|
-
bail?: boolean | undefined;
|
|
590
|
-
};
|
|
7
|
+
} & Pick<WriteESMStubsResult, 'newEntries'>, context: BundleContext): Configuration;
|
|
591
8
|
//# sourceMappingURL=getRspackConfiguration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRspackConfiguration.d.ts","sourceRoot":"","sources":["../src/getRspackConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"getRspackConfiguration.d.ts","sourceRoot":"","sources":["../src/getRspackConfiguration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAA+C,MAAM,cAAc,CAAC;AAI/F,wBAAgB,sBAAsB,CACpC,MAAM,EAAE;IACN,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC;IACvD,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,EAC3C,OAAO,EAAE,aAAa,GACrB,aAAa,CA2Lf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRspackConfiguration.js","sourceRoot":"","sources":["../src/getRspackConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIzF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,iBAAiB,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AK;SACX;QACD,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK;QAC/F,YAAY,EAAE;YACZ,YAAY,EAAE,QAAQ;YACtB,QAAQ,EAAE,OAAO,CAAC,MAAM;YACxB,aAAa,EAAE,KAAK;YACpB,WAAW,EAAE;gBACX,iFAAiF;gBACjF,YAAY,EAAE,IAAI;gBAElB,mFAAmF;gBACnF,4CAA4C;gBAC5C,WAAW,EAAE,CAAC,aAAa;gBAE3B,MAAM,EAAE,KAAK;gBAEb,6CAA6C;gBAE7C,4FAA4F;gBAC5F,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;gBAEjC,WAAW,EAAE;oBACX,cAAc,EAAE,KAAK;iBACtB;aACF;SACF;KACF,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { shouldExternalizePackage, getSwcConfig } from '@ms-cloudpack/bundler-utilities';\nimport type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';\nimport type { WriteESMStubsResult } from '@ms-cloudpack/esm-stub-utilities';\nimport type { Configuration, ExternalItemFunctionData, ExternalItemValue } from '@rspack/core';\nimport { merge } from 'webpack-merge';\nimport { getPathsOfModules } from './getPathsOfModules.js';\n\nexport function getRspackConfiguration(\n params: {\n options: Omit<BundleOptions, 'entries' | 'outputPath'>;\n outputPath: string;\n } & Pick<WriteESMStubsResult, 'newEntries'>,\n context: BundleContext,\n) {\n const { options, outputPath, newEntries } = params;\n const { unsafeDisableInlineSvg: _, ...bundlerOptions } = options.bundlerOptions || {};\n\n const isLibraryMode = context.config.mode === 'library';\n\n const swcConfig = getSwcConfig({ packagePath: options.inputPath, sourcemap: options.sourcemap });\n\n const config: Configuration = {\n mode: options.minify ? 'production' : 'development',\n // For Rspack, it looks like this following is still needed as unit tests fail without removing the './'.\n // Webpack (at least older versions) expects entry keys without a leading `./`.\n // (The leading `./` seems to be okay with the latest version, but in older versions, it appears\n // to cause the runtime chunk runtime.js to be generated with an incorrect relative path?)\n entry: Object.fromEntries(Object.entries(newEntries).map(([key, value]) => [key.replace(/^\\.\\//, ''), value])),\n context: options.inputPath,\n resolve: {\n extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json'],\n extensionAlias: {\n '.js': ['.ts', '.js', '.tsx', '.jsx'],\n '.mjs': ['.mts', '.mjs'],\n },\n },\n resolveLoader: {\n modules: [\n // Resolve loaders from the package's node_modules\n 'node_modules',\n\n // Cloudpack provided loaders\n ...getPathsOfModules(['css-loader', 'style-loader', 'sass-loader']),\n ],\n },\n externals: isLibraryMode\n ? // These types can't be inferred due to use of zod types (which may be slightly incorrect too,\n // since they don't allow returning undefined from the async version).\n // Issue: https://github.com/web-infra-dev/rspack/issues/7979\n // There's discussion here of moving away from zod types: https://github.com/web-infra-dev/rspack/issues/4241\n // eslint-disable-next-line @typescript-eslint/require-await -- API signature uses a promise\n async (ctx: ExternalItemFunctionData): Promise<ExternalItemValue | undefined> => {\n if (\n ctx.request &&\n !ctx.request.includes('!') && // webpack loader\n shouldExternalizePackage({\n id: ctx.request,\n inlined: options.inlined,\n external: options.external,\n shouldInlineNodeBuiltins: false,\n })\n ) {\n return ctx.request;\n }\n }\n : [],\n target: ['web', 'es2020'],\n //plugins: [new rspack.CssExtractRspackPlugin({})],\n module: {\n rules: [\n {\n oneOf: [\n // Rule for global CSS files\n {\n test: /\\.global\\.css$/,\n use: [\n 'style-loader',\n {\n loader: 'css-loader',\n options: {\n modules: {\n localIdentName: '[local]', // Use the local name for global CSS\n },\n },\n },\n ],\n },\n // Rule for CSS Modules files\n {\n test: /\\.module\\.css$/,\n use: [\n 'style-loader',\n {\n loader: 'css-loader',\n options: {\n modules: true, // Enable CSS Modules\n },\n },\n ],\n },\n // Rule for regular CSS files\n {\n test: /\\.css$/,\n exclude: /\\.module\\.css$/, // Exclude CSS Modules files\n use: [\n 'style-loader',\n 'css-loader', // Use css-loader without CSS Modules for regular CSS\n ],\n },\n ],\n },\n {\n test: /\\.json$/,\n type: 'json',\n sideEffects: false,\n },\n {\n test: /\\.ejs$/,\n loader: 'ejs-loader',\n options: {\n variable: 'data',\n esModule: true,\n },\n resolve: {\n fullySpecified: false,\n },\n },\n {\n // transform internal jsx files\n test: /\\.[cm]?jsx$/,\n loader: 'builtin:swc-loader',\n exclude: [/node_modules/],\n options: swcConfig.js,\n type: 'javascript/auto',\n },\n {\n // transform internal ts files\n test: /\\.[cm]?tsx?$/,\n loader: 'builtin:swc-loader',\n exclude: [/node_modules/],\n options: swcConfig.ts,\n type: 'javascript/auto',\n },\n {\n test: /\\.s[ac]ss$/i,\n use: ['style-loader', 'css-loader', 'sass-loader'],\n },\n {\n test: /\\.worker\\.js$/,\n use: { loader: 'worker-rspack-loader' },\n },\n ],\n },\n output: {\n library: {\n type: 'module',\n },\n chunkFormat: 'module',\n chunkLoading: 'import',\n path: outputPath,\n module: true,\n filename: '[name].js',\n chunkFilename: '[id].chunk.js',\n },\n experiments: {\n outputModule: true,\n css: false,\n },\n devtool: options.sourcemap ? (isLibraryMode ? 'cheap-module-source-map' : 'source-map') : false,\n optimization: {\n runtimeChunk: 'single',\n minimize: options.minify,\n mangleExports: false,\n splitChunks: {\n // Prevents exposing path info when creating names for parts splitted by maxSize.\n hidePathInfo: true,\n\n // Figure out which exports are used by modules to mangle export names, omit unused\n // exports and generate more efficient code.\n usedExports: !isLibraryMode,\n\n chunks: 'all',\n\n //name: '[id].chunk', //TODO: is this needed?\n\n // Production chunks should be at least 1000 bytes to prevent large numbers of file requests\n minSize: isLibraryMode ? 0 : 1000,\n\n cacheGroups: {\n defaultVendors: false,\n },\n },\n },\n };\n\n if (Object.keys(bundlerOptions).length) {\n return merge(config, bundlerOptions);\n }\n\n return config;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getRspackConfiguration.js","sourceRoot":"","sources":["../src/getRspackConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIzF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,UAAU,sBAAsB,CACpC,MAG2C,EAC3C,OAAsB;IAEtB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACnD,MAAM,EAAE,sBAAsB,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,IAAI,EAAE,CAAC;IAEtF,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC;IAExD,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAEjG,MAAM,MAAM,GAAkB;QAC5B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa;QACnD,yGAAyG;QACzG,+EAA+E;QAC/E,gGAAgG;QAChG,0FAA0F;QAC1F,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QAC9G,OAAO,EAAE,OAAO,CAAC,SAAS;QAC1B,OAAO,EAAE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,sBAAsB,EAAE;iBACxC;aACF;SACF;QACD,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;aACf;YACD,WAAW,EAAE,QAAQ;YACrB,YAAY,EAAE,QAAQ;YACtB,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE,WAAW;YACrB,aAAa,EAAE,eAAe;SAC/B;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,GAAG,EAAE,KAAK;SACX;QACD,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK;QAC/F,YAAY,EAAE;YACZ,YAAY,EAAE,QAAQ;YACtB,QAAQ,EAAE,OAAO,CAAC,MAAM;YACxB,aAAa,EAAE,KAAK;YACpB,WAAW,EAAE;gBACX,iFAAiF;gBACjF,YAAY,EAAE,IAAI;gBAElB,mFAAmF;gBACnF,4CAA4C;gBAC5C,WAAW,EAAE,CAAC,aAAa;gBAE3B,MAAM,EAAE,KAAK;gBAEb,6CAA6C;gBAE7C,4FAA4F;gBAC5F,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;gBAEjC,WAAW,EAAE;oBACX,cAAc,EAAE,KAAK;iBACtB;aACF;SACF;KACF,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC;QACvC,OAAO,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { shouldExternalizePackage, getSwcConfig } from '@ms-cloudpack/bundler-utilities';\nimport type { BundleContext, BundleOptions } from '@ms-cloudpack/common-types';\nimport type { WriteESMStubsResult } from '@ms-cloudpack/esm-stub-utilities';\nimport type { Configuration, ExternalItemFunctionData, ExternalItemValue } from '@rspack/core';\nimport { merge } from 'webpack-merge';\nimport { getPathsOfModules } from './getPathsOfModules.js';\n\nexport function getRspackConfiguration(\n params: {\n options: Omit<BundleOptions, 'entries' | 'outputPath'>;\n outputPath: string;\n } & Pick<WriteESMStubsResult, 'newEntries'>,\n context: BundleContext,\n): Configuration {\n const { options, outputPath, newEntries } = params;\n const { unsafeDisableInlineSvg: _, ...bundlerOptions } = options.bundlerOptions || {};\n\n const isLibraryMode = context.config.mode === 'library';\n\n const swcConfig = getSwcConfig({ packagePath: options.inputPath, sourcemap: options.sourcemap });\n\n const config: Configuration = {\n mode: options.minify ? 'production' : 'development',\n // For Rspack, it looks like this following is still needed as unit tests fail without removing the './'.\n // Webpack (at least older versions) expects entry keys without a leading `./`.\n // (The leading `./` seems to be okay with the latest version, but in older versions, it appears\n // to cause the runtime chunk runtime.js to be generated with an incorrect relative path?)\n entry: Object.fromEntries(Object.entries(newEntries).map(([key, value]) => [key.replace(/^\\.\\//, ''), value])),\n context: options.inputPath,\n resolve: {\n extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json'],\n extensionAlias: {\n '.js': ['.ts', '.js', '.tsx', '.jsx'],\n '.mjs': ['.mts', '.mjs'],\n },\n },\n resolveLoader: {\n modules: [\n // Resolve loaders from the package's node_modules\n 'node_modules',\n\n // Cloudpack provided loaders\n ...getPathsOfModules(['css-loader', 'style-loader', 'sass-loader']),\n ],\n },\n externals: isLibraryMode\n ? // These types can't be inferred due to use of zod types (which may be slightly incorrect too,\n // since they don't allow returning undefined from the async version).\n // Issue: https://github.com/web-infra-dev/rspack/issues/7979\n // There's discussion here of moving away from zod types: https://github.com/web-infra-dev/rspack/issues/4241\n // eslint-disable-next-line @typescript-eslint/require-await -- API signature uses a promise\n async (ctx: ExternalItemFunctionData): Promise<ExternalItemValue | undefined> => {\n if (\n ctx.request &&\n !ctx.request.includes('!') && // webpack loader\n shouldExternalizePackage({\n id: ctx.request,\n inlined: options.inlined,\n external: options.external,\n shouldInlineNodeBuiltins: false,\n })\n ) {\n return ctx.request;\n }\n }\n : [],\n target: ['web', 'es2020'],\n //plugins: [new rspack.CssExtractRspackPlugin({})],\n module: {\n rules: [\n {\n oneOf: [\n // Rule for global CSS files\n {\n test: /\\.global\\.css$/,\n use: [\n 'style-loader',\n {\n loader: 'css-loader',\n options: {\n modules: {\n localIdentName: '[local]', // Use the local name for global CSS\n },\n },\n },\n ],\n },\n // Rule for CSS Modules files\n {\n test: /\\.module\\.css$/,\n use: [\n 'style-loader',\n {\n loader: 'css-loader',\n options: {\n modules: true, // Enable CSS Modules\n },\n },\n ],\n },\n // Rule for regular CSS files\n {\n test: /\\.css$/,\n exclude: /\\.module\\.css$/, // Exclude CSS Modules files\n use: [\n 'style-loader',\n 'css-loader', // Use css-loader without CSS Modules for regular CSS\n ],\n },\n ],\n },\n {\n test: /\\.json$/,\n type: 'json',\n sideEffects: false,\n },\n {\n test: /\\.ejs$/,\n loader: 'ejs-loader',\n options: {\n variable: 'data',\n esModule: true,\n },\n resolve: {\n fullySpecified: false,\n },\n },\n {\n // transform internal jsx files\n test: /\\.[cm]?jsx$/,\n loader: 'builtin:swc-loader',\n exclude: [/node_modules/],\n options: swcConfig.js,\n type: 'javascript/auto',\n },\n {\n // transform internal ts files\n test: /\\.[cm]?tsx?$/,\n loader: 'builtin:swc-loader',\n exclude: [/node_modules/],\n options: swcConfig.ts,\n type: 'javascript/auto',\n },\n {\n test: /\\.s[ac]ss$/i,\n use: ['style-loader', 'css-loader', 'sass-loader'],\n },\n {\n test: /\\.worker\\.js$/,\n use: { loader: 'worker-rspack-loader' },\n },\n ],\n },\n output: {\n library: {\n type: 'module',\n },\n chunkFormat: 'module',\n chunkLoading: 'import',\n path: outputPath,\n module: true,\n filename: '[name].js',\n chunkFilename: '[id].chunk.js',\n },\n experiments: {\n outputModule: true,\n css: false,\n },\n devtool: options.sourcemap ? (isLibraryMode ? 'cheap-module-source-map' : 'source-map') : false,\n optimization: {\n runtimeChunk: 'single',\n minimize: options.minify,\n mangleExports: false,\n splitChunks: {\n // Prevents exposing path info when creating names for parts splitted by maxSize.\n hidePathInfo: true,\n\n // Figure out which exports are used by modules to mangle export names, omit unused\n // exports and generate more efficient code.\n usedExports: !isLibraryMode,\n\n chunks: 'all',\n\n //name: '[id].chunk', //TODO: is this needed?\n\n // Production chunks should be at least 1000 bytes to prevent large numbers of file requests\n minSize: isLibraryMode ? 0 : 1000,\n\n cacheGroups: {\n defaultVendors: false,\n },\n },\n },\n };\n\n if (Object.keys(bundlerOptions).length) {\n return merge(config, bundlerOptions);\n }\n\n return config;\n}\n"]}
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/bundler-rspack",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "A cloudpack plugin for abstracting rspack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ms-cloudpack/bundler-capabilities": "^0.1.26",
|
|
18
|
-
"@ms-cloudpack/bundler-utilities": "^0.1.
|
|
18
|
+
"@ms-cloudpack/bundler-utilities": "^0.1.5",
|
|
19
19
|
"@ms-cloudpack/common-types": "^0.23.0",
|
|
20
|
-
"@ms-cloudpack/esm-stub-utilities": "^0.13.
|
|
20
|
+
"@ms-cloudpack/esm-stub-utilities": "^0.13.9",
|
|
21
21
|
"@ms-cloudpack/path-string-parsing": "^1.2.4",
|
|
22
22
|
"@ms-cloudpack/path-utilities": "^2.7.49",
|
|
23
23
|
"@rspack/core": "^1.0.0 || ^1.0.0-0",
|