@rspack/core 1.6.8 → 1.7.0-beta.0
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/Compilation.d.ts +24 -4
- package/dist/Resolver.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +2 -2
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +8 -0
- package/dist/config/normalization.d.ts +10 -1
- package/dist/config/types.d.ts +23 -3
- package/dist/exports.d.ts +9 -1
- package/dist/index.js +134 -96
- package/dist/lib/EntryOptionPlugin.d.ts +1 -1
- package/dist/util/fake.d.ts +6 -1
- package/package.json +4 -4
package/dist/Compilation.d.ts
CHANGED
|
@@ -289,9 +289,14 @@ export declare class Compilation {
|
|
|
289
289
|
getLogger(name: string | (() => string)): Logger;
|
|
290
290
|
fileDependencies: {
|
|
291
291
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
292
|
-
has(dep: string)
|
|
292
|
+
has: (dep: string) => boolean;
|
|
293
293
|
add: (dep: string) => void;
|
|
294
294
|
addAll: (deps: Iterable<string>) => void;
|
|
295
|
+
delete: (dep: string) => boolean;
|
|
296
|
+
keys(): SetIterator<string>;
|
|
297
|
+
values(): SetIterator<string>;
|
|
298
|
+
entries(): SetIterator<[string, string]>;
|
|
299
|
+
readonly size: number;
|
|
295
300
|
};
|
|
296
301
|
get __internal__addedFileDependencies(): string[];
|
|
297
302
|
get __internal__removedFileDependencies(): string[];
|
|
@@ -301,21 +306,36 @@ export declare class Compilation {
|
|
|
301
306
|
get __internal__removedMissingDependencies(): string[];
|
|
302
307
|
contextDependencies: {
|
|
303
308
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
304
|
-
has(dep: string)
|
|
309
|
+
has: (dep: string) => boolean;
|
|
305
310
|
add: (dep: string) => void;
|
|
306
311
|
addAll: (deps: Iterable<string>) => void;
|
|
312
|
+
delete: (dep: string) => boolean;
|
|
313
|
+
keys(): SetIterator<string>;
|
|
314
|
+
values(): SetIterator<string>;
|
|
315
|
+
entries(): SetIterator<[string, string]>;
|
|
316
|
+
readonly size: number;
|
|
307
317
|
};
|
|
308
318
|
missingDependencies: {
|
|
309
319
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
310
|
-
has(dep: string)
|
|
320
|
+
has: (dep: string) => boolean;
|
|
311
321
|
add: (dep: string) => void;
|
|
312
322
|
addAll: (deps: Iterable<string>) => void;
|
|
323
|
+
delete: (dep: string) => boolean;
|
|
324
|
+
keys(): SetIterator<string>;
|
|
325
|
+
values(): SetIterator<string>;
|
|
326
|
+
entries(): SetIterator<[string, string]>;
|
|
327
|
+
readonly size: number;
|
|
313
328
|
};
|
|
314
329
|
buildDependencies: {
|
|
315
330
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
316
|
-
has(dep: string)
|
|
331
|
+
has: (dep: string) => boolean;
|
|
317
332
|
add: (dep: string) => void;
|
|
318
333
|
addAll: (deps: Iterable<string>) => void;
|
|
334
|
+
delete: (dep: string) => boolean;
|
|
335
|
+
keys(): SetIterator<string>;
|
|
336
|
+
values(): SetIterator<string>;
|
|
337
|
+
entries(): SetIterator<[string, string]>;
|
|
338
|
+
readonly size: number;
|
|
319
339
|
};
|
|
320
340
|
getStats(): Stats;
|
|
321
341
|
createChildCompiler(name: string, outputOptions: OutputNormalized, plugins: RspackPluginInstance[]): Compiler;
|
package/dist/Resolver.d.ts
CHANGED
|
@@ -25,6 +25,6 @@ export interface ResolveRequest {
|
|
|
25
25
|
export declare class Resolver {
|
|
26
26
|
#private;
|
|
27
27
|
constructor(binding: binding.JsResolver);
|
|
28
|
-
resolveSync(
|
|
29
|
-
resolve(
|
|
28
|
+
resolveSync(_context: object, path: string, request: string): string | false;
|
|
29
|
+
resolve(_context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
|
|
30
30
|
}
|
package/dist/RuntimeGlobals.d.ts
CHANGED
|
@@ -351,6 +351,6 @@ export declare enum RuntimeVariable {
|
|
|
351
351
|
StartupExec = 5
|
|
352
352
|
}
|
|
353
353
|
export declare function renderRuntimeVariables(variable: RuntimeVariable, _compilerOptions?: RspackOptionsNormalized): string;
|
|
354
|
-
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): typeof RuntimeGlobals
|
|
355
|
-
declare const DefaultRuntimeGlobals:
|
|
354
|
+
export declare function createCompilerRuntimeGlobals(compilerOptions?: RspackOptionsNormalized): Record<keyof typeof RuntimeGlobals, string>;
|
|
355
|
+
declare const DefaultRuntimeGlobals: Record<"publicPath" | "chunkName" | "moduleId" | "module" | "exports" | "require" | "global" | "system" | "requireScope" | "thisAsExports" | "returnExportsFromRuntime" | "moduleLoaded" | "entryModuleId" | "moduleCache" | "moduleFactories" | "moduleFactoriesAddOnly" | "ensureChunk" | "ensureChunkHandlers" | "ensureChunkIncludeEntries" | "prefetchChunk" | "prefetchChunkHandlers" | "preloadChunk" | "preloadChunkHandlers" | "definePropertyGetters" | "makeNamespaceObject" | "createFakeNamespaceObject" | "compatGetDefaultExport" | "harmonyModuleDecorator" | "nodeModuleDecorator" | "getFullHash" | "wasmInstances" | "instantiateWasm" | "uncaughtErrorHandler" | "scriptNonce" | "loadScript" | "createScript" | "createScriptUrl" | "getTrustedTypesPolicy" | "hasFetchPriority" | "runtimeId" | "getChunkScriptFilename" | "getChunkCssFilename" | "rspackVersion" | "hasCssModules" | "rspackUniqueId" | "getChunkUpdateScriptFilename" | "getChunkUpdateCssFilename" | "startup" | "startupNoDefault" | "startupOnlyAfter" | "startupOnlyBefore" | "chunkCallback" | "startupEntrypoint" | "startupChunkDependencies" | "onChunksLoaded" | "externalInstallChunk" | "interceptModuleExecution" | "shareScopeMap" | "initializeSharing" | "currentRemoteGetScope" | "getUpdateManifestFilename" | "hmrDownloadManifest" | "hmrDownloadUpdateHandlers" | "hmrModuleData" | "hmrInvalidateModuleHandlers" | "hmrRuntimeStatePrefix" | "amdDefine" | "amdOptions" | "hasOwnProperty" | "systemContext" | "baseURI" | "relativeUrl" | "asyncModule" | "asyncModuleExportSymbol" | "makeDeferredNamespaceObject" | "makeDeferredNamespaceObjectSymbol", string>;
|
|
356
356
|
export { DefaultRuntimeGlobals as RuntimeGlobals };
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { type Compiler, MultiCompiler } from "../..";
|
|
2
2
|
import type { MiddlewareHandler } from "../../config/devServer";
|
|
3
3
|
export declare const LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-";
|
|
4
|
+
/**
|
|
5
|
+
* Create a middleware that handles lazy compilation requests from the client.
|
|
6
|
+
* This function returns an Express-style middleware that listens for
|
|
7
|
+
* requests triggered by lazy compilation in the dev server client,
|
|
8
|
+
* then invokes the Rspack compiler to compile modules on demand.
|
|
9
|
+
* Use this middleware when integrating lazy compilation into a
|
|
10
|
+
* custom development server instead of relying on the built-in server.
|
|
11
|
+
*/
|
|
4
12
|
export declare const lazyCompilationMiddleware: (compiler: Compiler | MultiCompiler) => MiddlewareHandler;
|
|
@@ -17,7 +17,7 @@ export type EntryNormalized = EntryDynamicNormalized | EntryStaticNormalized;
|
|
|
17
17
|
export interface EntryStaticNormalized {
|
|
18
18
|
[k: string]: EntryDescriptionNormalized;
|
|
19
19
|
}
|
|
20
|
-
export type EntryDescriptionNormalized = Pick<EntryDescription, "runtime" | "chunkLoading" | "asyncChunks" | "publicPath" | "baseUri" | "filename" | "library" | "layer"> & {
|
|
20
|
+
export type EntryDescriptionNormalized = Pick<EntryDescription, "runtime" | "chunkLoading" | "wasmLoading" | "asyncChunks" | "publicPath" | "baseUri" | "filename" | "library" | "layer"> & {
|
|
21
21
|
import?: string[];
|
|
22
22
|
dependOn?: string[];
|
|
23
23
|
};
|
|
@@ -120,9 +120,18 @@ export interface ExperimentsNormalized {
|
|
|
120
120
|
buildHttp?: HttpUriPluginOptions;
|
|
121
121
|
parallelLoader?: boolean;
|
|
122
122
|
useInputFileSystem?: false | RegExp[];
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
125
|
+
*/
|
|
123
126
|
inlineConst?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
129
|
+
*/
|
|
124
130
|
inlineEnum?: boolean;
|
|
125
131
|
typeReexportsPresence?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
134
|
+
*/
|
|
126
135
|
lazyBarrel?: boolean;
|
|
127
136
|
nativeWatcher?: boolean;
|
|
128
137
|
deferImport?: boolean;
|
package/dist/config/types.d.ts
CHANGED
|
@@ -858,8 +858,6 @@ export type JavascriptParserOptions = {
|
|
|
858
858
|
* Enable magic comments for CommonJS require() expressions.
|
|
859
859
|
*/
|
|
860
860
|
commonjsMagicComments?: boolean;
|
|
861
|
-
/** Inline const values in this module */
|
|
862
|
-
inlineConst?: boolean;
|
|
863
861
|
/** Whether to tolerant exportsPresence for type reexport */
|
|
864
862
|
typeReexportsPresence?: "no-tolerant" | "tolerant" | "tolerant-no-check";
|
|
865
863
|
/** Whether to enable JSX parsing */
|
|
@@ -1881,6 +1879,13 @@ export type Optimization = {
|
|
|
1881
1879
|
* The value is `false` in development mode.
|
|
1882
1880
|
*/
|
|
1883
1881
|
mangleExports?: "size" | "deterministic" | boolean;
|
|
1882
|
+
/**
|
|
1883
|
+
* Allows to inline exports when possible to reduce code size.
|
|
1884
|
+
*
|
|
1885
|
+
* The value is `true` in production mode.
|
|
1886
|
+
* The value is `false` in development mode.
|
|
1887
|
+
*/
|
|
1888
|
+
inlineExports?: boolean;
|
|
1884
1889
|
/**
|
|
1885
1890
|
* Tells Rspack to set process.env.NODE_ENV to a given string value.
|
|
1886
1891
|
* @default false
|
|
@@ -2155,21 +2160,25 @@ export type Experiments = {
|
|
|
2155
2160
|
/**
|
|
2156
2161
|
* Enable inline const feature
|
|
2157
2162
|
* @default false
|
|
2163
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
2158
2164
|
*/
|
|
2159
2165
|
inlineConst?: boolean;
|
|
2160
2166
|
/**
|
|
2161
2167
|
* Enable inline enum feature
|
|
2162
2168
|
* @default false
|
|
2169
|
+
* @deprecated This option is deprecated, it's already stable. Rspack will remove this option in future version
|
|
2163
2170
|
*/
|
|
2164
2171
|
inlineEnum?: boolean;
|
|
2165
2172
|
/**
|
|
2166
2173
|
* Enable type reexports presence feature
|
|
2167
2174
|
* @default false
|
|
2175
|
+
* @deprecated This option is deprecated, it's already stable. Rspack will remove this option in future version
|
|
2168
2176
|
*/
|
|
2169
2177
|
typeReexportsPresence?: boolean;
|
|
2170
2178
|
/**
|
|
2171
2179
|
* Enable lazy make side effects free barrel file
|
|
2172
2180
|
* @default false
|
|
2181
|
+
* @deprecated This option is deprecated, it's already stable and enabled by default, Rspack will remove this option in future version
|
|
2173
2182
|
*/
|
|
2174
2183
|
lazyBarrel?: boolean;
|
|
2175
2184
|
/**
|
|
@@ -2333,7 +2342,18 @@ export type RspackOptions = {
|
|
|
2333
2342
|
*/
|
|
2334
2343
|
loader?: Loader;
|
|
2335
2344
|
/**
|
|
2336
|
-
*
|
|
2345
|
+
* Tells Rspack to suppress specific compilation warnings by matching their
|
|
2346
|
+
* message, module, or file, or by using a custom function.
|
|
2347
|
+
*
|
|
2348
|
+
* @example
|
|
2349
|
+
* ```js
|
|
2350
|
+
* export default {
|
|
2351
|
+
* ignoreWarnings: [
|
|
2352
|
+
* /warning from compiler/,
|
|
2353
|
+
* { file: /node_modules/ },
|
|
2354
|
+
* ],
|
|
2355
|
+
* };
|
|
2356
|
+
* ```
|
|
2337
2357
|
*/
|
|
2338
2358
|
ignoreWarnings?: IgnoreWarnings;
|
|
2339
2359
|
/**
|
package/dist/exports.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export { LoaderOptionsPlugin } from "./lib/LoaderOptionsPlugin";
|
|
|
56
56
|
export { LoaderTargetPlugin } from "./lib/LoaderTargetPlugin";
|
|
57
57
|
export type { OutputFileSystem, WatchFileSystem } from "./util/fs";
|
|
58
58
|
import { EsmLibraryPlugin, FetchCompileAsyncWasmPlugin, lazyCompilationMiddleware, SubresourceIntegrityPlugin } from "./builtin-plugin";
|
|
59
|
+
export { SubresourceIntegrityPlugin };
|
|
59
60
|
interface Web {
|
|
60
61
|
FetchCompileAsyncWasmPlugin: typeof FetchCompileAsyncWasmPlugin;
|
|
61
62
|
}
|
|
@@ -68,6 +69,7 @@ interface Node {
|
|
|
68
69
|
NodeTemplatePlugin: typeof NodeTemplatePlugin;
|
|
69
70
|
NodeEnvironmentPlugin: typeof NodeEnvironmentPlugin;
|
|
70
71
|
}
|
|
72
|
+
export { lazyCompilationMiddleware };
|
|
71
73
|
export declare const node: Node;
|
|
72
74
|
import { ElectronTargetPlugin } from "./builtin-plugin";
|
|
73
75
|
interface Electron {
|
|
@@ -141,11 +143,17 @@ interface Experiments {
|
|
|
141
143
|
cleanup: () => Promise<void>;
|
|
142
144
|
};
|
|
143
145
|
RemoveDuplicateModulesPlugin: typeof RemoveDuplicateModulesPlugin;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Use `rspack.SubresourceIntegrityPlugin` instead
|
|
148
|
+
*/
|
|
149
|
+
SubresourceIntegrityPlugin: typeof SubresourceIntegrityPlugin;
|
|
144
150
|
EsmLibraryPlugin: typeof EsmLibraryPlugin;
|
|
145
151
|
RsdoctorPlugin: typeof RsdoctorPlugin;
|
|
146
152
|
RstestPlugin: typeof RstestPlugin;
|
|
147
153
|
RslibPlugin: typeof RslibPlugin;
|
|
148
|
-
|
|
154
|
+
/**
|
|
155
|
+
* @deprecated Use `rspack.lazyCompilationMiddleware` instead
|
|
156
|
+
*/
|
|
149
157
|
lazyCompilationMiddleware: typeof lazyCompilationMiddleware;
|
|
150
158
|
swc: {
|
|
151
159
|
transform: typeof transform;
|
package/dist/index.js
CHANGED
|
@@ -297,6 +297,7 @@ for(var __rspack_i in (()=>{
|
|
|
297
297
|
EvalDevToolModulePlugin: ()=>EvalDevToolModulePlugin,
|
|
298
298
|
NormalModuleReplacementPlugin: ()=>NormalModuleReplacementPlugin,
|
|
299
299
|
WebpackOptionsApply: ()=>RspackOptionsApply,
|
|
300
|
+
lazyCompilationMiddleware: ()=>lazyCompilationMiddleware,
|
|
300
301
|
EnvironmentPlugin: ()=>EnvironmentPlugin,
|
|
301
302
|
HotModuleReplacementPlugin: ()=>HotModuleReplacementPlugin,
|
|
302
303
|
Compilation: ()=>Compilation,
|
|
@@ -329,9 +330,10 @@ for(var __rspack_i in (()=>{
|
|
|
329
330
|
ModuleFilenameHelpers: ()=>ModuleFilenameHelpers_namespaceObject,
|
|
330
331
|
MultiCompiler: ()=>MultiCompiler,
|
|
331
332
|
SourceMapDevToolPlugin: ()=>SourceMapDevToolPlugin,
|
|
333
|
+
SubresourceIntegrityPlugin: ()=>SubresourceIntegrityPlugin,
|
|
332
334
|
library: ()=>exports_library,
|
|
333
|
-
node: ()=>exports_node,
|
|
334
335
|
RuntimeGlobals: ()=>DefaultRuntimeGlobals,
|
|
336
|
+
node: ()=>exports_node,
|
|
335
337
|
rspackVersion: ()=>exports_rspackVersion,
|
|
336
338
|
util: ()=>util,
|
|
337
339
|
optimize: ()=>optimize,
|
|
@@ -401,6 +403,7 @@ for(var __rspack_i in (()=>{
|
|
|
401
403
|
SourceMapDevToolPlugin: ()=>SourceMapDevToolPlugin,
|
|
402
404
|
Stats: ()=>Stats,
|
|
403
405
|
StatsErrorCode: ()=>statsFactoryUtils_StatsErrorCode,
|
|
406
|
+
SubresourceIntegrityPlugin: ()=>SubresourceIntegrityPlugin,
|
|
404
407
|
SwcJsMinimizerRspackPlugin: ()=>SwcJsMinimizerRspackPlugin,
|
|
405
408
|
Template: ()=>Template,
|
|
406
409
|
ValidationError: ()=>ValidationError,
|
|
@@ -412,6 +415,7 @@ for(var __rspack_i in (()=>{
|
|
|
412
415
|
electron: ()=>electron,
|
|
413
416
|
experiments: ()=>exports_experiments,
|
|
414
417
|
javascript: ()=>javascript,
|
|
418
|
+
lazyCompilationMiddleware: ()=>lazyCompilationMiddleware,
|
|
415
419
|
library: ()=>exports_library,
|
|
416
420
|
node: ()=>exports_node,
|
|
417
421
|
optimize: ()=>optimize,
|
|
@@ -1185,20 +1189,35 @@ for(var __rspack_i in (()=>{
|
|
|
1185
1189
|
}
|
|
1186
1190
|
}
|
|
1187
1191
|
function createFakeCompilationDependencies(getDeps, addDeps) {
|
|
1188
|
-
let addDepsCaller = new MergeCaller(addDeps)
|
|
1192
|
+
let addDepsCaller = new MergeCaller(addDeps), deletedDeps = new Set(), hasDep = (dep)=>!deletedDeps.has(dep) && (addDepsCaller.pendingData().includes(dep) || getDeps().includes(dep)), getAllDeps = ()=>{
|
|
1193
|
+
let deps = new Set([
|
|
1194
|
+
...getDeps(),
|
|
1195
|
+
...addDepsCaller.pendingData()
|
|
1196
|
+
]);
|
|
1197
|
+
for (let deleted of deletedDeps)deps.delete(deleted);
|
|
1198
|
+
return deps;
|
|
1199
|
+
};
|
|
1189
1200
|
return {
|
|
1190
1201
|
*[Symbol.iterator] () {
|
|
1191
|
-
for (let dep of
|
|
1192
|
-
...getDeps(),
|
|
1193
|
-
...addDepsCaller.pendingData()
|
|
1194
|
-
]))yield dep;
|
|
1202
|
+
for (let dep of getAllDeps())yield dep;
|
|
1195
1203
|
},
|
|
1196
|
-
has:
|
|
1204
|
+
has: hasDep,
|
|
1197
1205
|
add: (dep)=>{
|
|
1198
|
-
addDepsCaller.push(dep);
|
|
1206
|
+
deletedDeps.delete(dep), addDepsCaller.push(dep);
|
|
1199
1207
|
},
|
|
1200
1208
|
addAll: (deps)=>{
|
|
1209
|
+
for (let dep of deps)deletedDeps.delete(dep);
|
|
1201
1210
|
addDepsCaller.push(...deps);
|
|
1211
|
+
},
|
|
1212
|
+
delete: (dep)=>{
|
|
1213
|
+
let hadDep = hasDep(dep);
|
|
1214
|
+
return hadDep && deletedDeps.add(dep), hadDep;
|
|
1215
|
+
},
|
|
1216
|
+
keys: ()=>getAllDeps().keys(),
|
|
1217
|
+
values: ()=>getAllDeps().values(),
|
|
1218
|
+
entries: ()=>getAllDeps().entries(),
|
|
1219
|
+
get size () {
|
|
1220
|
+
return getAllDeps().size;
|
|
1202
1221
|
}
|
|
1203
1222
|
};
|
|
1204
1223
|
}
|
|
@@ -1476,7 +1495,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
1476
1495
|
processAssetsHook.tap(getOptions(options), ()=>fn(...getArgs()));
|
|
1477
1496
|
},
|
|
1478
1497
|
tapAsync: (options, fn)=>{
|
|
1479
|
-
processAssetsHook.tapAsync(getOptions(options), (
|
|
1498
|
+
processAssetsHook.tapAsync(getOptions(options), (_assets, callback)=>fn(...getArgs(), callback));
|
|
1480
1499
|
},
|
|
1481
1500
|
tapPromise: (options, fn)=>{
|
|
1482
1501
|
processAssetsHook.tapPromise(getOptions(options), ()=>fn(...getArgs()));
|
|
@@ -2169,7 +2188,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2169
2188
|
for (let entry of desc.import)new EntryPlugin(context, entry, options).apply(compiler);
|
|
2170
2189
|
}
|
|
2171
2190
|
}
|
|
2172
|
-
static entryDescriptionToOptions(
|
|
2191
|
+
static entryDescriptionToOptions(_compiler, name, desc) {
|
|
2173
2192
|
return {
|
|
2174
2193
|
name,
|
|
2175
2194
|
filename: desc.filename,
|
|
@@ -2192,13 +2211,13 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
2192
2211
|
} : options)
|
|
2193
2212
|
}), "make");
|
|
2194
2213
|
function getRawEntryOptions(entry) {
|
|
2195
|
-
let runtime = entry.runtime, chunkLoading = entry.chunkLoading;
|
|
2196
2214
|
return {
|
|
2197
2215
|
name: entry.name,
|
|
2198
2216
|
publicPath: entry.publicPath,
|
|
2199
2217
|
baseUri: entry.baseUri,
|
|
2200
|
-
runtime,
|
|
2201
|
-
chunkLoading,
|
|
2218
|
+
runtime: entry.runtime,
|
|
2219
|
+
chunkLoading: entry.chunkLoading,
|
|
2220
|
+
wasmLoading: entry.wasmLoading,
|
|
2202
2221
|
asyncChunks: entry.asyncChunks,
|
|
2203
2222
|
filename: entry.filename,
|
|
2204
2223
|
library: entry.library,
|
|
@@ -2287,7 +2306,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
|
2287
2306
|
var config;
|
|
2288
2307
|
let err, logger = compiler.getInfrastructureLogger(EsmLibraryPlugin.PLUGIN_NAME);
|
|
2289
2308
|
if (!function(options, logger) {
|
|
2290
|
-
options.optimization.concatenateModules = !1, options.output.chunkFormat = !1, options.output.chunkLoading && "import" !== options.output.chunkLoading && (logger.warn(`\`output.chunkLoading\` should be \`"import"\` or \`false\`, but got ${options.output.chunkLoading}, changed it to \`"import"\``), options.output.chunkLoading = "import"), void 0 === options.output.chunkLoading && (options.output.chunkLoading = "import"), options.output.library && (options.output.library = void 0);
|
|
2309
|
+
options.optimization.concatenateModules = !1, options.optimization.removeEmptyChunks = !1, options.output.chunkFormat = !1, options.output.chunkLoading && "import" !== options.output.chunkLoading && (logger.warn(`\`output.chunkLoading\` should be \`"import"\` or \`false\`, but got ${options.output.chunkLoading}, changed it to \`"import"\``), options.output.chunkLoading = "import"), void 0 === options.output.chunkLoading && (options.output.chunkLoading = "import"), options.output.library && (options.output.library = void 0);
|
|
2291
2310
|
let { splitChunks } = options.optimization;
|
|
2292
2311
|
void 0 === splitChunks && (splitChunks = options.optimization.splitChunks = {}), !1 !== splitChunks && (splitChunks.chunks = "all", splitChunks.minSize = 0, splitChunks.maxAsyncRequests = 1 / 0, splitChunks.maxInitialRequests = 1 / 0, splitChunks.cacheGroups ??= {}, splitChunks.cacheGroups.default = !1, splitChunks.cacheGroups.defaultVendors = !1);
|
|
2293
2312
|
}(compiler.options, logger), new RemoveDuplicateModulesPlugin().apply(compiler), err = (config = compiler.options).optimization.concatenateModules ? "You should disable `config.optimization.concatenateModules`" : !1 !== config.output.chunkFormat ? "You should disable default chunkFormat by `config.output.chunkFormat = false`" : void 0) throw new src_0.WebpackError(`Conflicted config for ${EsmLibraryPlugin.PLUGIN_NAME}: ${err}`);
|
|
@@ -3973,7 +3992,6 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
|
3973
3992
|
commonjs: parser.commonjs,
|
|
3974
3993
|
importDynamic: parser.importDynamic,
|
|
3975
3994
|
commonjsMagicComments: parser.commonjsMagicComments,
|
|
3976
|
-
inlineConst: parser.inlineConst,
|
|
3977
3995
|
typeReexportsPresence: parser.typeReexportsPresence,
|
|
3978
3996
|
jsx: parser.jsx,
|
|
3979
3997
|
deferImport: parser.deferImport
|
|
@@ -4442,7 +4460,36 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
|
|
|
4442
4460
|
currentActiveModules
|
|
4443
4461
|
}), "thisCompilation"), LAZY_COMPILATION_PREFIX = "/lazy-compilation-using-", noop = (_req, _res, next)=>{
|
|
4444
4462
|
"function" == typeof next && next();
|
|
4445
|
-
}, DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN = "The `experiments.lazyCompilation` option is deprecated, please use the configuration top level `lazyCompilation` instead.", REPEAT_LAZY_COMPILATION_OPTIONS_WARN = "Both top-level `lazyCompilation` and `experiments.lazyCompilation` options are set. The top-level `lazyCompilation` configuration will take precedence."
|
|
4463
|
+
}, DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN = "The `experiments.lazyCompilation` option is deprecated, please use the configuration top level `lazyCompilation` instead.", REPEAT_LAZY_COMPILATION_OPTIONS_WARN = "Both top-level `lazyCompilation` and `experiments.lazyCompilation` options are set. The top-level `lazyCompilation` configuration will take precedence.", lazyCompilationMiddleware = (compiler)=>{
|
|
4464
|
+
if (compiler instanceof MultiCompiler) {
|
|
4465
|
+
let middlewareByCompiler = new Map(), i = 0, isReportDeprecatedWarned = !1, isReportRepeatWarned = !1;
|
|
4466
|
+
for (let c of compiler.compilers){
|
|
4467
|
+
if (c.options.experiments.lazyCompilation && (c.name ? console.warn(`The 'experiments.lazyCompilation' option in compiler named '${c.name}' is deprecated, please use the Configuration top level 'lazyCompilation' instead.`) : isReportDeprecatedWarned || (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), isReportDeprecatedWarned = !0)), c.options.lazyCompilation && c.options.experiments.lazyCompilation && (c.name ? console.warn(`The top-level 'lazyCompilation' option in compiler named '${c.name}' will override the 'experiments.lazyCompilation' option.`) : isReportRepeatWarned || (console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN), isReportRepeatWarned = !0)), !c.options.lazyCompilation && !c.options.experiments.lazyCompilation) continue;
|
|
4468
|
+
let options = {
|
|
4469
|
+
...c.options.experiments.lazyCompilation,
|
|
4470
|
+
...c.options.lazyCompilation
|
|
4471
|
+
}, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
|
|
4472
|
+
options.prefix = `${prefix}__${i++}`;
|
|
4473
|
+
let activeModules = new Set();
|
|
4474
|
+
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, options.prefix)), applyPlugin(c, options, activeModules);
|
|
4475
|
+
}
|
|
4476
|
+
let keys = [
|
|
4477
|
+
...middlewareByCompiler.keys()
|
|
4478
|
+
];
|
|
4479
|
+
return (req, res, next)=>{
|
|
4480
|
+
let key = keys.find((key)=>req.url?.startsWith(key));
|
|
4481
|
+
if (!key) return next?.();
|
|
4482
|
+
let middleware = middlewareByCompiler.get(key);
|
|
4483
|
+
return middleware?.(req, res, next);
|
|
4484
|
+
};
|
|
4485
|
+
}
|
|
4486
|
+
if (compiler.options.experiments.lazyCompilation && (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
|
|
4487
|
+
let activeModules = new Set(), options = {
|
|
4488
|
+
...compiler.options.experiments.lazyCompilation,
|
|
4489
|
+
...compiler.options.lazyCompilation
|
|
4490
|
+
};
|
|
4491
|
+
return applyPlugin(compiler, options, activeModules), lazyCompilationMiddlewareInternal(compiler, activeModules, options.prefix || LAZY_COMPILATION_PREFIX);
|
|
4492
|
+
};
|
|
4446
4493
|
function applyPlugin(compiler, options, activeModules) {
|
|
4447
4494
|
let compiler1;
|
|
4448
4495
|
new BuiltinLazyCompilationPlugin(()=>{
|
|
@@ -5735,12 +5782,16 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
5735
5782
|
if ("function" != typeof options.entry) for (let key of Object.keys(options.entry))F(options.entry[key], "import", ()=>[
|
|
5736
5783
|
"./src"
|
|
5737
5784
|
]);
|
|
5738
|
-
F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1),
|
|
5785
|
+
F(options, "devtool", ()=>!!development && "eval"), D(options, "watch", !1), D(options, "profile", !1), F(options, "lazyCompilation", ()=>!!targetProperties && !!targetProperties.web && !targetProperties.electron && !targetProperties.node && !targetProperties.nwjs && {
|
|
5786
|
+
imports: !0,
|
|
5787
|
+
entries: !1
|
|
5788
|
+
}), D(options, "bail", !1), F(options, "cache", ()=>development), !1 === options.cache && (options.experiments.cache = !1), applyExperimentsDefaults(options.experiments, {
|
|
5739
5789
|
development
|
|
5740
5790
|
}), applyOptimizationDefaults(options.optimization, {
|
|
5741
5791
|
production,
|
|
5742
5792
|
development,
|
|
5743
|
-
css: options.experiments.css
|
|
5793
|
+
css: options.experiments.css,
|
|
5794
|
+
deprecatedInline: options.experiments.inlineConst || options.experiments.inlineEnum
|
|
5744
5795
|
}), applySnapshotDefaults(options.snapshot, {
|
|
5745
5796
|
production
|
|
5746
5797
|
}), applyModuleDefaults(options.module, {
|
|
@@ -5750,17 +5801,13 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
5750
5801
|
targetProperties,
|
|
5751
5802
|
mode: options.mode,
|
|
5752
5803
|
uniqueName: options.output.uniqueName,
|
|
5753
|
-
usedExports: !!options.optimization.usedExports,
|
|
5754
|
-
inlineConst: options.experiments.inlineConst,
|
|
5755
5804
|
deferImport: options.experiments.deferImport
|
|
5756
5805
|
}), applyOutputDefaults(options.output, {
|
|
5757
5806
|
context: options.context,
|
|
5758
5807
|
targetProperties,
|
|
5759
5808
|
isAffectedByBrowserslist: void 0 === target || "string" == typeof target && target.startsWith("browserslist") || Array.isArray(target) && target.some((target)=>target.startsWith("browserslist")),
|
|
5760
5809
|
outputModule: options.experiments.outputModule,
|
|
5761
|
-
|
|
5762
|
-
entry: options.entry,
|
|
5763
|
-
futureDefaults: options.experiments.futureDefaults
|
|
5810
|
+
entry: options.entry
|
|
5764
5811
|
}), applybundlerInfoDefaults(options.experiments.rspackFuture, options.output.library), applyExternalsPresetsDefaults(options.externalsPresets, {
|
|
5765
5812
|
targetProperties,
|
|
5766
5813
|
buildHttp: !!options.experiments.buildHttp
|
|
@@ -5783,17 +5830,15 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
5783
5830
|
let tty = infrastructureLogging.stream?.isTTY && "dumb" !== process.env.TERM;
|
|
5784
5831
|
D(infrastructureLogging, "level", "info"), D(infrastructureLogging, "debug", !1), D(infrastructureLogging, "colors", tty), D(infrastructureLogging, "appendOnly", !tty);
|
|
5785
5832
|
}, applyExperimentsDefaults = (experiments, { development })=>{
|
|
5786
|
-
F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !
|
|
5833
|
+
F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "topLevelAwait", !0), D(experiments, "deferImport", !1), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !0), D(experiments.incremental, "providedExports", !0), D(experiments.incremental, "dependenciesDiagnostics", !0), D(experiments.incremental, "sideEffects", !0), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !0), D(experiments.incremental, "chunkIds", !0), D(experiments.incremental, "modulesHashes", !0), D(experiments.incremental, "modulesCodegen", !0), D(experiments.incremental, "modulesRuntimeRequirements", !0), D(experiments.incremental, "chunksRuntimeRequirements", !0), D(experiments.incremental, "chunksHashes", !0), D(experiments.incremental, "chunksRender", !0), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !1), D(experiments, "parallelLoader", !1), D(experiments, "useInputFileSystem", !1), D(experiments, "inlineConst", !0), D(experiments, "inlineEnum", !1), D(experiments, "typeReexportsPresence", !1), D(experiments, "lazyBarrel", !0);
|
|
5787
5834
|
}, applybundlerInfoDefaults = (rspackFuture, library)=>{
|
|
5788
|
-
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.
|
|
5789
|
-
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName,
|
|
5790
|
-
if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, {
|
|
5835
|
+
"object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.7.0-beta.0"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
|
|
5836
|
+
}, applySnapshotDefaults = (_snapshot, _env)=>{}, applyModuleDefaults = (module1, { cache, asyncWebAssembly, css, targetProperties, mode, uniqueName, deferImport })=>{
|
|
5837
|
+
if (assertNotNill(module1.parser), assertNotNill(module1.generator), cache ? D(module1, "unsafeCache", /[\\/]node_modules[\\/]/) : D(module1, "unsafeCache", !1), F(module1.parser, "asset", ()=>({})), assertNotNill(module1.parser.asset), F(module1.parser.asset, "dataUrlCondition", ()=>({})), "object" == typeof module1.parser.asset.dataUrlCondition && D(module1.parser.asset.dataUrlCondition, "maxSize", 8096), F(module1.parser, "javascript", ()=>({})), assertNotNill(module1.parser.javascript), ((parserOptions, { deferImport })=>{
|
|
5791
5838
|
D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "unknownContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "commonjs", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
|
|
5792
5839
|
"..."
|
|
5793
|
-
]), D(parserOptions, "importMeta", !0), D(parserOptions, "
|
|
5840
|
+
]), D(parserOptions, "importMeta", !0), D(parserOptions, "typeReexportsPresence", "no-tolerant"), D(parserOptions, "jsx", !1), D(parserOptions, "deferImport", deferImport);
|
|
5794
5841
|
})(module1.parser.javascript, {
|
|
5795
|
-
usedExports,
|
|
5796
|
-
inlineConst,
|
|
5797
5842
|
deferImport
|
|
5798
5843
|
}), F(module1.parser, "json", ()=>({})), assertNotNill(module1.parser.json), D(module1.parser.json, "exportsDepth", "development" === mode ? 1 : Number.MAX_SAFE_INTEGER), F(module1.generator, "json", ()=>({})), assertNotNill(module1.generator.json), D(module1.generator.json, "JSONParse", !0), css) {
|
|
5799
5844
|
F(module1.parser, "css", ()=>({})), assertNotNill(module1.parser.css), D(module1.parser.css, "namedExports", !0), D(module1.parser.css, "url", !0), F(module1.parser, "css/auto", ()=>({})), assertNotNill(module1.parser["css/auto"]), D(module1.parser["css/auto"], "namedExports", !0), D(module1.parser["css/auto"], "url", !0), F(module1.parser, "css/module", ()=>({})), assertNotNill(module1.parser["css/module"]), D(module1.parser["css/module"], "namedExports", !0), D(module1.parser["css/module"], "url", !0), F(module1.generator, "css", ()=>({})), assertNotNill(module1.generator.css), D(module1.generator.css, "exportsOnly", !targetProperties || !targetProperties.document), D(module1.generator.css, "esModule", !0), F(module1.generator, "css/auto", ()=>({})), assertNotNill(module1.generator["css/auto"]), D(module1.generator["css/auto"], "exportsOnly", !targetProperties || !targetProperties.document), D(module1.generator["css/auto"], "exportsConvention", "as-is");
|
|
@@ -5914,15 +5959,20 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
5914
5959
|
type: "json"
|
|
5915
5960
|
},
|
|
5916
5961
|
type: "json"
|
|
5962
|
+
}, {
|
|
5963
|
+
with: {
|
|
5964
|
+
type: "text"
|
|
5965
|
+
},
|
|
5966
|
+
type: "asset/source"
|
|
5917
5967
|
}), rules;
|
|
5918
5968
|
});
|
|
5919
|
-
}, applyOutputDefaults = (output, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist,
|
|
5969
|
+
}, applyOutputDefaults = (output, { context, outputModule, targetProperties: tp, isAffectedByBrowserslist, entry })=>{
|
|
5920
5970
|
let getLibraryName = (library)=>{
|
|
5921
5971
|
let libraryName = "object" == typeof library && library && !Array.isArray(library) && "type" in library ? library.name : library;
|
|
5922
5972
|
return Array.isArray(libraryName) ? libraryName.join(".") : "object" == typeof libraryName ? getLibraryName(libraryName.root) : "string" == typeof libraryName ? libraryName : "";
|
|
5923
5973
|
};
|
|
5924
5974
|
F(output, "uniqueName", ()=>{
|
|
5925
|
-
let libraryName = getLibraryName(output.library).replace(/^\[(\\*[\w:]+\\*)\](\.)|(\.)\[(\\*[\w:]+\\*)\](?=\.|$)|\[(\\*[\w:]+\\*)\]/g, (
|
|
5975
|
+
let libraryName = getLibraryName(output.library).replace(/^\[(\\*[\w:]+\\*)\](\.)|(\.)\[(\\*[\w:]+\\*)\](?=\.|$)|\[(\\*[\w:]+\\*)\]/g, (_, a, d1, d2, b, c)=>{
|
|
5926
5976
|
let content = a || b || c;
|
|
5927
5977
|
return content.startsWith("\\") && content.endsWith("\\") ? `${d2 || ""}[${content.slice(1, -1)}]${d1 || ""}` : "";
|
|
5928
5978
|
});
|
|
@@ -6035,7 +6085,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6035
6085
|
if (tp) {
|
|
6036
6086
|
if (tp.fetchWasm) return "fetch";
|
|
6037
6087
|
if (tp.nodeBuiltins) return "async-node";
|
|
6038
|
-
null === tp.nodeBuiltins || tp.fetchWasm;
|
|
6088
|
+
if ((null === tp.nodeBuiltins || null === tp.fetchWasm) && output.module && environment.dynamicImport) return "universal";
|
|
6039
6089
|
}
|
|
6040
6090
|
return !1;
|
|
6041
6091
|
}), F(output, "workerWasmLoading", ()=>output.wasmLoading), F(output, "globalObject", ()=>{
|
|
@@ -6062,7 +6112,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6062
6112
|
}), Array.from(enabledChunkLoadingTypes);
|
|
6063
6113
|
}), A(output, "enabledWasmLoadingTypes", ()=>{
|
|
6064
6114
|
let enabledWasmLoadingTypes = new Set();
|
|
6065
|
-
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading),
|
|
6115
|
+
return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
|
|
6116
|
+
desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
|
|
6117
|
+
}), Array.from(enabledWasmLoadingTypes);
|
|
6066
6118
|
});
|
|
6067
6119
|
}, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp })=>{
|
|
6068
6120
|
D(externalsPresets, "web", !buildHttp && targetProperties?.web), D(externalsPresets, "node", targetProperties?.node), D(externalsPresets, "electron", targetProperties?.electron), D(externalsPresets, "electronMain", targetProperties?.electron && targetProperties.electronMain), D(externalsPresets, "electronPreload", targetProperties?.electron && targetProperties.electronPreload), D(externalsPresets, "electronRenderer", targetProperties?.electron && targetProperties.electronRenderer), D(externalsPresets, "nwjs", targetProperties?.nwjs);
|
|
@@ -6079,8 +6131,8 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6079
6131
|
!1 !== node && (F(node, "global", ()=>!targetProperties?.global && "warn"), F(node, "__dirname", ()=>targetProperties?.node ? outputModule ? "node-module" : "eval-only" : "warn-mock"), F(node, "__filename", ()=>targetProperties?.node ? outputModule ? "node-module" : "eval-only" : "warn-mock"));
|
|
6080
6132
|
}, applyPerformanceDefaults = (performance, { production })=>{
|
|
6081
6133
|
!1 !== performance && (D(performance, "maxAssetSize", 250000), D(performance, "maxEntrypointSize", 250000), F(performance, "hints", ()=>!!production && "warning"));
|
|
6082
|
-
}, applyOptimizationDefaults = (optimization, { production, development, css })=>{
|
|
6083
|
-
D(optimization, "removeAvailableModules", !0), D(optimization, "removeEmptyChunks", !0), D(optimization, "mergeDuplicateChunks", !0), F(optimization, "moduleIds", ()=>production ? "deterministic" : development ? "named" : "natural"), F(optimization, "chunkIds", ()=>production ? "deterministic" : development ? "named" : "natural"), F(optimization, "sideEffects", ()=>!!production || "flag"), D(optimization, "mangleExports", production), D(optimization, "providedExports", !0), D(optimization, "usedExports", production), D(optimization, "innerGraph", production), D(optimization, "emitOnErrors", !production), D(optimization, "runtimeChunk", !1), D(optimization, "realContentHash", production), D(optimization, "avoidEntryIife", !1), D(optimization, "minimize", production), D(optimization, "concatenateModules", production), A(optimization, "minimizer", ()=>[
|
|
6134
|
+
}, applyOptimizationDefaults = (optimization, { production, development, css, deprecatedInline })=>{
|
|
6135
|
+
D(optimization, "removeAvailableModules", !0), D(optimization, "removeEmptyChunks", !0), D(optimization, "mergeDuplicateChunks", !0), F(optimization, "moduleIds", ()=>production ? "deterministic" : development ? "named" : "natural"), F(optimization, "chunkIds", ()=>production ? "deterministic" : development ? "named" : "natural"), F(optimization, "sideEffects", ()=>!!production || "flag"), D(optimization, "mangleExports", production), D(optimization, "inlineExports", deprecatedInline && production), D(optimization, "providedExports", !0), D(optimization, "usedExports", production), D(optimization, "innerGraph", production), D(optimization, "emitOnErrors", !production), D(optimization, "runtimeChunk", !1), D(optimization, "realContentHash", production), D(optimization, "avoidEntryIife", !1), D(optimization, "minimize", production), D(optimization, "concatenateModules", production), A(optimization, "minimizer", ()=>[
|
|
6084
6136
|
new SwcJsMinimizerRspackPlugin(),
|
|
6085
6137
|
new LightningCssMinimizerRspackPlugin()
|
|
6086
6138
|
]), F(optimization, "nodeEnv", ()=>production ? "production" : !!development && "development");
|
|
@@ -6243,13 +6295,15 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6243
6295
|
}, getPnpDefault = ()=>!!process.versions.pnp, getNormalizedRspackOptions = (config)=>{
|
|
6244
6296
|
let fn;
|
|
6245
6297
|
return {
|
|
6246
|
-
ignoreWarnings:
|
|
6247
|
-
if (
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6298
|
+
ignoreWarnings: ((ignoreWarnings)=>{
|
|
6299
|
+
if (ignoreWarnings) return ignoreWarnings.map((ignore)=>{
|
|
6300
|
+
if ("function" == typeof ignore) return ignore;
|
|
6301
|
+
let rule = ignore instanceof RegExp ? {
|
|
6302
|
+
message: ignore
|
|
6303
|
+
} : ignore;
|
|
6304
|
+
return (warning)=>(!!rule.message || !!rule.module || !!rule.file) && (!rule.message || !!rule.message.test(warning.message)) && (!rule.module || !!warning.module && !!rule.module.test(warning.module.readableIdentifier())) && (!rule.file || !!warning.file && !!rule.file.test(warning.file));
|
|
6305
|
+
});
|
|
6306
|
+
})(config.ignoreWarnings),
|
|
6253
6307
|
name: config.name,
|
|
6254
6308
|
dependencies: config.dependencies,
|
|
6255
6309
|
context: config.context,
|
|
@@ -6397,7 +6451,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6397
6451
|
plugins: nestedArray(config.plugins, (p)=>[
|
|
6398
6452
|
...p
|
|
6399
6453
|
]),
|
|
6400
|
-
experiments: nestedConfig(config.experiments, (experiments)=>(experiments.layers && external_node_util_default().deprecate(()=>{}, "`experiments.layers` config has been deprecated and will be removed in Rspack v2.0. Feature layers will be always enabled. Please remove this option from your Rspack configuration.")(), !1 === experiments.topLevelAwait && external_node_util_default().deprecate(()=>{}, "`experiments.topLevelAwait` config has been deprecated and will be removed in Rspack v2.0. Top-level await will be always enabled. Please remove this option from your Rspack configuration.")(), experiments.parallelCodeSplitting && external_node_util_default().deprecate(()=>{}, "`experiments.parallelCodeSplitting` config has been deprecated and will be removed in next minor. It has huge regression in some edge cases where the chunk graph has lots of cycles, we'll improve the performance of build_chunk_graph in the future instead")(), {
|
|
6454
|
+
experiments: nestedConfig(config.experiments, (experiments)=>(experiments.layers && external_node_util_default().deprecate(()=>{}, "`experiments.layers` config has been deprecated and will be removed in Rspack v2.0. Feature layers will be always enabled. Please remove this option from your Rspack configuration.")(), !1 === experiments.topLevelAwait && external_node_util_default().deprecate(()=>{}, "`experiments.topLevelAwait` config has been deprecated and will be removed in Rspack v2.0. Top-level await will be always enabled. Please remove this option from your Rspack configuration.")(), experiments.parallelCodeSplitting && external_node_util_default().deprecate(()=>{}, "`experiments.parallelCodeSplitting` config has been deprecated and will be removed in next minor. It has huge regression in some edge cases where the chunk graph has lots of cycles, we'll improve the performance of build_chunk_graph in the future instead")(), experiments.lazyBarrel && external_node_util_default().deprecate(()=>{}, "`experiments.lazyBarrel` config has been deprecated and will be removed in Rspack v2.0. Lazy barrel is already stable and enabled by default. Please remove this option from your Rspack configuration.")(), experiments.inlineConst && external_node_util_default().deprecate(()=>{}, "`experiments.inlineConst` config has been deprecated and will be removed in Rspack v2.0. Inline Const is already stable and enabled by default. Please remove this option from your Rspack configuration.")(), experiments.inlineEnum && external_node_util_default().deprecate(()=>{}, "`experiments.inlineEnum` config has been deprecated and will be removed in Rspack v2.0. Inline Enum is already stable. Please remove this option from your Rspack configuration.")(), experiments.typeReexportsPresence && external_node_util_default().deprecate(()=>{}, "`experiments.typeReexportsPresence` config has been deprecated and will be removed in Rspack v2.0. typeReexportsPresence is already stable. Please remove this option from your Rspack configuration.")(), {
|
|
6401
6455
|
...experiments,
|
|
6402
6456
|
cache: optionalNestedConfig(experiments.cache, (cache)=>{
|
|
6403
6457
|
if ("boolean" == typeof cache || "memory" === cache.type) return cache;
|
|
@@ -6883,7 +6937,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6883
6937
|
constructor(fs){
|
|
6884
6938
|
if (Object.assign(this, NOOP_FILESYSTEM), !fs) return;
|
|
6885
6939
|
this.writeFile = memoizeFn(()=>external_node_util_default().promisify(fs.writeFile.bind(fs))), this.removeFile = memoizeFn(()=>external_node_util_default().promisify(fs.unlink.bind(fs))), this.mkdir = memoizeFn(()=>external_node_util_default().promisify(fs.mkdir.bind(fs))), this.mkdirp = memoizeFn(()=>external_node_util_default().promisify(mkdirp.bind(null, fs))), this.removeDirAll = memoizeFn(()=>external_node_util_default().promisify((function rmrf(fs, p, callback) {
|
|
6886
|
-
fs.stat(p, (err, stats)=>{
|
|
6940
|
+
(fs.lstat || fs.stat)(p, (err, stats)=>{
|
|
6887
6941
|
if (err) return "ENOENT" === err.code ? callback() : callback(err);
|
|
6888
6942
|
stats.isDirectory() ? fs.readdir(p, (err, files)=>{
|
|
6889
6943
|
if (err) return callback(err);
|
|
@@ -6938,7 +6992,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
6938
6992
|
readFn(fd, {
|
|
6939
6993
|
position,
|
|
6940
6994
|
length
|
|
6941
|
-
}, (err,
|
|
6995
|
+
}, (err, _bytesRead, buffer)=>{
|
|
6942
6996
|
err ? resolve(err) : resolve(buffer);
|
|
6943
6997
|
});
|
|
6944
6998
|
});
|
|
@@ -7233,10 +7287,10 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7233
7287
|
constructor(binding){
|
|
7234
7288
|
this.#binding = binding;
|
|
7235
7289
|
}
|
|
7236
|
-
resolveSync(
|
|
7290
|
+
resolveSync(_context, path, request) {
|
|
7237
7291
|
return this.#binding.resolveSync(path, request) ?? !1;
|
|
7238
7292
|
}
|
|
7239
|
-
resolve(
|
|
7293
|
+
resolve(_context, path, request, resolveContext, callback) {
|
|
7240
7294
|
this.#binding.resolve(path, request, (error, text)=>{
|
|
7241
7295
|
if (error) return void callback(error);
|
|
7242
7296
|
let req = text ? JSON.parse(text) : void 0;
|
|
@@ -7545,7 +7599,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
|
|
|
7545
7599
|
});
|
|
7546
7600
|
}
|
|
7547
7601
|
}
|
|
7548
|
-
let CORE_VERSION = "1.
|
|
7602
|
+
let CORE_VERSION = "1.7.0-beta.0", bindingVersionCheck_errorMessage = (coreVersion, expectedCoreVersion)=>process.env.RSPACK_BINDING ? `Unmatched version @rspack/core@${coreVersion} and binding version.
|
|
7549
7603
|
|
|
7550
7604
|
Help:
|
|
7551
7605
|
Looks like you are using a custom binding (via environment variable 'RSPACK_BINDING=${process.env.RSPACK_BINDING}').
|
|
@@ -8178,11 +8232,11 @@ Help:
|
|
|
8178
8232
|
parser: Object.fromEntries(Object.entries(parser = module1.parser).map(([k, v])=>[
|
|
8179
8233
|
k,
|
|
8180
8234
|
getRawParserOptions(v, k)
|
|
8181
|
-
]).filter(([
|
|
8235
|
+
]).filter(([_, v])=>void 0 !== v)),
|
|
8182
8236
|
generator: Object.fromEntries(Object.entries(generator = module1.generator).map(([k, v])=>[
|
|
8183
8237
|
k,
|
|
8184
8238
|
getRawGeneratorOptions(v, k)
|
|
8185
|
-
]).filter(([
|
|
8239
|
+
]).filter(([_, v])=>void 0 !== v)),
|
|
8186
8240
|
noParse: module1.noParse,
|
|
8187
8241
|
unsafeCache: module1.unsafeCache
|
|
8188
8242
|
};
|
|
@@ -8400,9 +8454,9 @@ Help:
|
|
|
8400
8454
|
codeGenerationResult: new CodeGenerationResult(result),
|
|
8401
8455
|
moduleObject
|
|
8402
8456
|
}, {
|
|
8403
|
-
[
|
|
8457
|
+
[RuntimeGlobals.require]: moduleRequireFn
|
|
8404
8458
|
}), "Compilation.hooks.executeModule"), moduleObject.loaded = !0, moduleObject.exports;
|
|
8405
|
-
}, moduleCache = moduleRequireFn[
|
|
8459
|
+
}, moduleCache = moduleRequireFn[RuntimeGlobals.moduleCache.replace(`${RuntimeGlobals.require}.`, "")] = {}, interceptModuleExecution = moduleRequireFn[RuntimeGlobals.interceptModuleExecution.replace(`${RuntimeGlobals.require}.`, "")] = [];
|
|
8406
8460
|
for (let runtimeModule of runtimeModules)moduleRequireFn(runtimeModule);
|
|
8407
8461
|
let executeResult = moduleRequireFn(entry);
|
|
8408
8462
|
getCompiler2().__internal__get_module_execution_results_map().set(id, executeResult);
|
|
@@ -8854,7 +8908,7 @@ Help:
|
|
|
8854
8908
|
obj.children = this.stats.map((stat, idx)=>{
|
|
8855
8909
|
let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
|
|
8856
8910
|
return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
|
|
8857
|
-
}), childOptions.version && (obj.rspackVersion = "1.
|
|
8911
|
+
}), childOptions.version && (obj.rspackVersion = "1.7.0-beta.0", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
|
|
8858
8912
|
let mapError = (j, obj)=>({
|
|
8859
8913
|
...obj,
|
|
8860
8914
|
compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
|
|
@@ -9197,7 +9251,13 @@ Help:
|
|
|
9197
9251
|
}
|
|
9198
9252
|
apply(compiler) {
|
|
9199
9253
|
compiler.hooks.compilation.tap(this.name, (compilation)=>{
|
|
9200
|
-
compilation.hooks.processWarnings.tap(this.name, (warnings)=>warnings.filter((warning)
|
|
9254
|
+
compilation.hooks.processWarnings.tap(this.name, (warnings)=>warnings.filter((warning)=>{
|
|
9255
|
+
let plainWarning = warning.message ? {
|
|
9256
|
+
...warning,
|
|
9257
|
+
message: external_node_util_default().stripVTControlCharacters(warning.message)
|
|
9258
|
+
} : warning;
|
|
9259
|
+
return !this._ignorePattern.some((ignore)=>ignore(plainWarning, compilation));
|
|
9260
|
+
}));
|
|
9201
9261
|
});
|
|
9202
9262
|
}
|
|
9203
9263
|
};
|
|
@@ -9727,15 +9787,20 @@ Help:
|
|
|
9727
9787
|
if (!1 === logging && !debugMode) continue;
|
|
9728
9788
|
let groupStack = [], rootList = [], currentList = rootList, processedLogEntries = 0;
|
|
9729
9789
|
for (let entry of logEntries){
|
|
9730
|
-
let type = entry.type, typeBitFlag = getLogTypeBitFlag(type);
|
|
9790
|
+
let message, type = entry.type, typeBitFlag = getLogTypeBitFlag(type);
|
|
9731
9791
|
if (!debugMode && (acceptedTypes & typeBitFlag) !== typeBitFlag) continue;
|
|
9732
9792
|
if (type === LogType.groupCollapsed && (debugMode || collapsedGroups) && (type = LogType.group), 0 === depthInCollapsedGroup && processedLogEntries++, type === LogType.groupEnd) {
|
|
9733
9793
|
groupStack.pop(), currentList = groupStack.length > 0 ? groupStack[groupStack.length - 1].children : rootList, depthInCollapsedGroup > 0 && depthInCollapsedGroup--;
|
|
9734
9794
|
continue;
|
|
9735
9795
|
}
|
|
9796
|
+
if (entry.type === LogType.time) {
|
|
9797
|
+
let [label, first, second] = entry.args;
|
|
9798
|
+
"number" == typeof first && "number" == typeof second && (message = `${label}: ${1000 * first + second / 1000000} ms`);
|
|
9799
|
+
}
|
|
9800
|
+
message || (message = entry.args?.length ? external_node_util_namespaceObject.format(entry.args[0], ...entry.args.slice(1)) : "");
|
|
9736
9801
|
let newEntry = {
|
|
9737
9802
|
type,
|
|
9738
|
-
message:
|
|
9803
|
+
message: message || "",
|
|
9739
9804
|
trace: loggingTrace ? entry.trace : void 0,
|
|
9740
9805
|
children: type === LogType.group || type === LogType.groupCollapsed ? [] : void 0
|
|
9741
9806
|
};
|
|
@@ -9753,7 +9818,7 @@ Help:
|
|
|
9753
9818
|
object.hash = context.getStatsCompilation(compilation).hash;
|
|
9754
9819
|
},
|
|
9755
9820
|
version: (object)=>{
|
|
9756
|
-
object.version = "5.75.0", object.rspackVersion = "1.
|
|
9821
|
+
object.version = "5.75.0", object.rspackVersion = "1.7.0-beta.0";
|
|
9757
9822
|
},
|
|
9758
9823
|
env: (object, _compilation, _context, { _env })=>{
|
|
9759
9824
|
object.env = _env;
|
|
@@ -9801,7 +9866,7 @@ Help:
|
|
|
9801
9866
|
}), options.assetsSpace ?? 1 / 0);
|
|
9802
9867
|
object.assets = limited.children, object.filteredAssets = limited.filteredChildren;
|
|
9803
9868
|
},
|
|
9804
|
-
chunks: (object, compilation, context,
|
|
9869
|
+
chunks: (object, compilation, context, _options, factory)=>{
|
|
9805
9870
|
let { type, getStatsCompilation } = context, chunks = getStatsCompilation(compilation).chunks;
|
|
9806
9871
|
object.chunks = factory.create(`${type}.chunks`, chunks, context);
|
|
9807
9872
|
},
|
|
@@ -10255,8 +10320,8 @@ Help:
|
|
|
10255
10320
|
warningsFilter: (value)=>(Array.isArray(value) ? value : value ? [
|
|
10256
10321
|
value
|
|
10257
10322
|
] : []).map((filter)=>{
|
|
10258
|
-
if ("string" == typeof filter) return (
|
|
10259
|
-
if (filter instanceof RegExp) return (
|
|
10323
|
+
if ("string" == typeof filter) return (_warning, warningString)=>warningString.includes(filter);
|
|
10324
|
+
if (filter instanceof RegExp) return (_warning, warningString)=>filter.test(warningString);
|
|
10260
10325
|
if ("function" == typeof filter) return filter;
|
|
10261
10326
|
throw Error(`Can only filter warnings with Strings or RegExps. (Given: ${filter})`);
|
|
10262
10327
|
}),
|
|
@@ -11092,7 +11157,7 @@ Help:
|
|
|
11092
11157
|
moduleFilenameTemplate: options.output.devtoolModuleFilenameTemplate,
|
|
11093
11158
|
namespace: options.output.devtoolNamespace
|
|
11094
11159
|
}).apply(compiler);
|
|
11095
|
-
if (new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), options.experiments.css && new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.experiments.rspackFuture.bundlerInfo && new BundlerInfoRspackPlugin(options.experiments.rspackFuture.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin().apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin("global" === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler),
|
|
11160
|
+
if (new JavascriptModulesPlugin().apply(compiler), new URLPlugin().apply(compiler), new JsonModulesPlugin().apply(compiler), new AssetModulesPlugin().apply(compiler), options.experiments.asyncWebAssembly && new AsyncWebAssemblyModulesPlugin().apply(compiler), options.experiments.css && new CssModulesPlugin().apply(compiler), new lib_EntryOptionPlugin().apply(compiler), assertNotNill(options.context), compiler.hooks.entryOption.call(options.context, options.entry), new RuntimePlugin().apply(compiler), options.experiments.rspackFuture.bundlerInfo && new BundlerInfoRspackPlugin(options.experiments.rspackFuture.bundlerInfo).apply(compiler), new InferAsyncModulesPlugin().apply(compiler), new APIPlugin().apply(compiler), new DataUriPlugin().apply(compiler), new FileUriPlugin().apply(compiler), options.experiments.buildHttp && new HttpUriPlugin(options.experiments.buildHttp).apply(compiler), new EnsureChunkConditionsPlugin().apply(compiler), options.optimization.mergeDuplicateChunks && new MergeDuplicateChunksPlugin().apply(compiler), options.optimization.sideEffects && new SideEffectsFlagPlugin().apply(compiler), options.optimization.providedExports && new FlagDependencyExportsPlugin().apply(compiler), options.optimization.usedExports && new FlagDependencyUsagePlugin("global" === options.optimization.usedExports).apply(compiler), options.optimization.concatenateModules && new ModuleConcatenationPlugin().apply(compiler), options.optimization.inlineExports && new InlineExportsPlugin().apply(compiler), options.optimization.mangleExports && new MangleExportsPlugin("size" !== options.optimization.mangleExports).apply(compiler), options.output.enabledLibraryTypes && options.output.enabledLibraryTypes.length > 0) for (let type of options.output.enabledLibraryTypes)new EnableLibraryPlugin(type).apply(compiler);
|
|
11096
11161
|
options.optimization.splitChunks && new SplitChunksPlugin(options.optimization.splitChunks).apply(compiler), options.optimization.removeEmptyChunks && new RemoveEmptyChunksPlugin().apply(compiler), options.optimization.realContentHash && new RealContentHashPlugin().apply(compiler);
|
|
11097
11162
|
let moduleIds = options.optimization.moduleIds;
|
|
11098
11163
|
if (moduleIds) switch(moduleIds){
|
|
@@ -11972,7 +12037,7 @@ Help:
|
|
|
11972
12037
|
let _options = JSON.stringify(options || {});
|
|
11973
12038
|
return binding_default().transform(source, _options);
|
|
11974
12039
|
}
|
|
11975
|
-
let exports_rspackVersion = "1.
|
|
12040
|
+
let exports_rspackVersion = "1.7.0-beta.0", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
|
|
11976
12041
|
getNormalizedRspackOptions: getNormalizedRspackOptions,
|
|
11977
12042
|
applyRspackOptionsDefaults: applyRspackOptionsDefaults,
|
|
11978
12043
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
@@ -12080,7 +12145,7 @@ Help:
|
|
|
12080
12145
|
}), sum;
|
|
12081
12146
|
}, {}), manifestExposes = function(exposes) {
|
|
12082
12147
|
if (!exposes) return;
|
|
12083
|
-
let result = parseOptions(exposes, (value
|
|
12148
|
+
let result = parseOptions(exposes, (value)=>({
|
|
12084
12149
|
import: Array.isArray(value) ? value : [
|
|
12085
12150
|
value
|
|
12086
12151
|
],
|
|
@@ -12176,41 +12241,12 @@ Help:
|
|
|
12176
12241
|
}
|
|
12177
12242
|
},
|
|
12178
12243
|
RemoveDuplicateModulesPlugin: RemoveDuplicateModulesPlugin,
|
|
12244
|
+
SubresourceIntegrityPlugin: SubresourceIntegrityPlugin,
|
|
12179
12245
|
EsmLibraryPlugin: EsmLibraryPlugin,
|
|
12180
12246
|
RsdoctorPlugin: RsdoctorPluginImpl,
|
|
12181
12247
|
RstestPlugin: RstestPlugin,
|
|
12182
12248
|
RslibPlugin: RslibPlugin,
|
|
12183
|
-
|
|
12184
|
-
lazyCompilationMiddleware: (compiler)=>{
|
|
12185
|
-
if (compiler instanceof MultiCompiler) {
|
|
12186
|
-
let middlewareByCompiler = new Map(), i = 0, isReportDeprecatedWarned = !1, isReportRepeatWarned = !1;
|
|
12187
|
-
for (let c of compiler.compilers){
|
|
12188
|
-
if (c.options.experiments.lazyCompilation && (c.name ? console.warn(`The 'experiments.lazyCompilation' option in compiler named '${c.name}' is deprecated, please use the Configuration top level 'lazyCompilation' instead.`) : isReportDeprecatedWarned || (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), isReportDeprecatedWarned = !0)), c.options.lazyCompilation && c.options.experiments.lazyCompilation && (c.name ? console.warn(`The top-level 'lazyCompilation' option in compiler named '${c.name}' will override the 'experiments.lazyCompilation' option.`) : isReportRepeatWarned || (console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN), isReportRepeatWarned = !0)), !c.options.lazyCompilation && !c.options.experiments.lazyCompilation) continue;
|
|
12189
|
-
let options = {
|
|
12190
|
-
...c.options.experiments.lazyCompilation,
|
|
12191
|
-
...c.options.lazyCompilation
|
|
12192
|
-
}, prefix = options.prefix || LAZY_COMPILATION_PREFIX;
|
|
12193
|
-
options.prefix = `${prefix}__${i++}`;
|
|
12194
|
-
let activeModules = new Set();
|
|
12195
|
-
middlewareByCompiler.set(options.prefix, lazyCompilationMiddlewareInternal(compiler, activeModules, options.prefix)), applyPlugin(c, options, activeModules);
|
|
12196
|
-
}
|
|
12197
|
-
let keys = [
|
|
12198
|
-
...middlewareByCompiler.keys()
|
|
12199
|
-
];
|
|
12200
|
-
return (req, res, next)=>{
|
|
12201
|
-
let key = keys.find((key)=>req.url?.startsWith(key));
|
|
12202
|
-
if (!key) return next?.();
|
|
12203
|
-
let middleware = middlewareByCompiler.get(key);
|
|
12204
|
-
return middleware?.(req, res, next);
|
|
12205
|
-
};
|
|
12206
|
-
}
|
|
12207
|
-
if (compiler.options.experiments.lazyCompilation && (console.warn(DEPRECATED_LAZY_COMPILATION_OPTIONS_WARN), compiler.options.lazyCompilation && console.warn(REPEAT_LAZY_COMPILATION_OPTIONS_WARN)), !compiler.options.lazyCompilation && !compiler.options.experiments.lazyCompilation) return noop;
|
|
12208
|
-
let activeModules = new Set(), options = {
|
|
12209
|
-
...compiler.options.experiments.lazyCompilation,
|
|
12210
|
-
...compiler.options.lazyCompilation
|
|
12211
|
-
};
|
|
12212
|
-
return applyPlugin(compiler, options, activeModules), lazyCompilationMiddlewareInternal(compiler, activeModules, options.prefix || LAZY_COMPILATION_PREFIX);
|
|
12213
|
-
},
|
|
12249
|
+
lazyCompilationMiddleware: lazyCompilationMiddleware,
|
|
12214
12250
|
swc: {
|
|
12215
12251
|
minify: minify,
|
|
12216
12252
|
transform: transform,
|
|
@@ -12320,7 +12356,7 @@ Help:
|
|
|
12320
12356
|
}, exports_namespaceObject);
|
|
12321
12357
|
src_fn.rspack = src_fn, src_fn.webpack = src_fn;
|
|
12322
12358
|
let src_rspack_0 = src_fn, src_0 = src_rspack_0;
|
|
12323
|
-
})(), exports.AsyncDependenciesBlock = __webpack_exports__.AsyncDependenciesBlock, exports.BannerPlugin = __webpack_exports__.BannerPlugin, exports.CircularDependencyRspackPlugin = __webpack_exports__.CircularDependencyRspackPlugin, exports.Compilation = __webpack_exports__.Compilation, exports.Compiler = __webpack_exports__.Compiler, exports.ConcatenatedModule = __webpack_exports__.ConcatenatedModule, exports.ContextModule = __webpack_exports__.ContextModule, exports.ContextReplacementPlugin = __webpack_exports__.ContextReplacementPlugin, exports.CopyRspackPlugin = __webpack_exports__.CopyRspackPlugin, exports.CssExtractRspackPlugin = __webpack_exports__.CssExtractRspackPlugin, exports.DefinePlugin = __webpack_exports__.DefinePlugin, exports.Dependency = __webpack_exports__.Dependency, exports.DllPlugin = __webpack_exports__.DllPlugin, exports.DllReferencePlugin = __webpack_exports__.DllReferencePlugin, exports.DynamicEntryPlugin = __webpack_exports__.DynamicEntryPlugin, exports.EntryDependency = __webpack_exports__.EntryDependency, exports.EntryOptionPlugin = __webpack_exports__.EntryOptionPlugin, exports.EntryPlugin = __webpack_exports__.EntryPlugin, exports.EnvironmentPlugin = __webpack_exports__.EnvironmentPlugin, exports.EvalDevToolModulePlugin = __webpack_exports__.EvalDevToolModulePlugin, exports.EvalSourceMapDevToolPlugin = __webpack_exports__.EvalSourceMapDevToolPlugin, exports.ExternalModule = __webpack_exports__.ExternalModule, exports.ExternalsPlugin = __webpack_exports__.ExternalsPlugin, exports.HotModuleReplacementPlugin = __webpack_exports__.HotModuleReplacementPlugin, exports.HtmlRspackPlugin = __webpack_exports__.HtmlRspackPlugin, exports.IgnorePlugin = __webpack_exports__.IgnorePlugin, exports.LightningCssMinimizerRspackPlugin = __webpack_exports__.LightningCssMinimizerRspackPlugin, exports.LoaderOptionsPlugin = __webpack_exports__.LoaderOptionsPlugin, exports.LoaderTargetPlugin = __webpack_exports__.LoaderTargetPlugin, exports.Module = __webpack_exports__.Module, exports.ModuleFilenameHelpers = __webpack_exports__.ModuleFilenameHelpers, exports.MultiCompiler = __webpack_exports__.MultiCompiler, exports.MultiStats = __webpack_exports__.MultiStats, exports.NoEmitOnErrorsPlugin = __webpack_exports__.NoEmitOnErrorsPlugin, exports.NormalModule = __webpack_exports__.NormalModule, exports.NormalModuleReplacementPlugin = __webpack_exports__.NormalModuleReplacementPlugin, exports.ProgressPlugin = __webpack_exports__.ProgressPlugin, exports.ProvidePlugin = __webpack_exports__.ProvidePlugin, exports.RspackOptionsApply = __webpack_exports__.RspackOptionsApply, exports.RuntimeGlobals = __webpack_exports__.RuntimeGlobals, exports.RuntimeModule = __webpack_exports__.RuntimeModule, exports.RuntimePlugin = __webpack_exports__.RuntimePlugin, exports.SourceMapDevToolPlugin = __webpack_exports__.SourceMapDevToolPlugin, exports.Stats = __webpack_exports__.Stats, exports.StatsErrorCode = __webpack_exports__.StatsErrorCode, exports.SwcJsMinimizerRspackPlugin = __webpack_exports__.SwcJsMinimizerRspackPlugin, exports.Template = __webpack_exports__.Template, exports.ValidationError = __webpack_exports__.ValidationError, exports.WarnCaseSensitiveModulesPlugin = __webpack_exports__.WarnCaseSensitiveModulesPlugin, exports.WebpackError = __webpack_exports__.WebpackError, exports.WebpackOptionsApply = __webpack_exports__.WebpackOptionsApply, exports.config = __webpack_exports__.config, exports.container = __webpack_exports__.container, exports.default = __webpack_exports__.default, exports.electron = __webpack_exports__.electron, exports.experiments = __webpack_exports__.experiments, exports.javascript = __webpack_exports__.javascript, exports.library = __webpack_exports__.library, exports.node = __webpack_exports__.node, exports.optimize = __webpack_exports__.optimize, exports.rspack = __webpack_exports__.rspack, exports.rspackVersion = __webpack_exports__.rspackVersion, exports.sharing = __webpack_exports__.sharing, exports.sources = __webpack_exports__.sources, exports.util = __webpack_exports__.util, exports.version = __webpack_exports__.version, exports.wasm = __webpack_exports__.wasm, exports.web = __webpack_exports__.web, exports.webworker = __webpack_exports__.webworker, __webpack_exports__)-1 === [
|
|
12359
|
+
})(), exports.AsyncDependenciesBlock = __webpack_exports__.AsyncDependenciesBlock, exports.BannerPlugin = __webpack_exports__.BannerPlugin, exports.CircularDependencyRspackPlugin = __webpack_exports__.CircularDependencyRspackPlugin, exports.Compilation = __webpack_exports__.Compilation, exports.Compiler = __webpack_exports__.Compiler, exports.ConcatenatedModule = __webpack_exports__.ConcatenatedModule, exports.ContextModule = __webpack_exports__.ContextModule, exports.ContextReplacementPlugin = __webpack_exports__.ContextReplacementPlugin, exports.CopyRspackPlugin = __webpack_exports__.CopyRspackPlugin, exports.CssExtractRspackPlugin = __webpack_exports__.CssExtractRspackPlugin, exports.DefinePlugin = __webpack_exports__.DefinePlugin, exports.Dependency = __webpack_exports__.Dependency, exports.DllPlugin = __webpack_exports__.DllPlugin, exports.DllReferencePlugin = __webpack_exports__.DllReferencePlugin, exports.DynamicEntryPlugin = __webpack_exports__.DynamicEntryPlugin, exports.EntryDependency = __webpack_exports__.EntryDependency, exports.EntryOptionPlugin = __webpack_exports__.EntryOptionPlugin, exports.EntryPlugin = __webpack_exports__.EntryPlugin, exports.EnvironmentPlugin = __webpack_exports__.EnvironmentPlugin, exports.EvalDevToolModulePlugin = __webpack_exports__.EvalDevToolModulePlugin, exports.EvalSourceMapDevToolPlugin = __webpack_exports__.EvalSourceMapDevToolPlugin, exports.ExternalModule = __webpack_exports__.ExternalModule, exports.ExternalsPlugin = __webpack_exports__.ExternalsPlugin, exports.HotModuleReplacementPlugin = __webpack_exports__.HotModuleReplacementPlugin, exports.HtmlRspackPlugin = __webpack_exports__.HtmlRspackPlugin, exports.IgnorePlugin = __webpack_exports__.IgnorePlugin, exports.LightningCssMinimizerRspackPlugin = __webpack_exports__.LightningCssMinimizerRspackPlugin, exports.LoaderOptionsPlugin = __webpack_exports__.LoaderOptionsPlugin, exports.LoaderTargetPlugin = __webpack_exports__.LoaderTargetPlugin, exports.Module = __webpack_exports__.Module, exports.ModuleFilenameHelpers = __webpack_exports__.ModuleFilenameHelpers, exports.MultiCompiler = __webpack_exports__.MultiCompiler, exports.MultiStats = __webpack_exports__.MultiStats, exports.NoEmitOnErrorsPlugin = __webpack_exports__.NoEmitOnErrorsPlugin, exports.NormalModule = __webpack_exports__.NormalModule, exports.NormalModuleReplacementPlugin = __webpack_exports__.NormalModuleReplacementPlugin, exports.ProgressPlugin = __webpack_exports__.ProgressPlugin, exports.ProvidePlugin = __webpack_exports__.ProvidePlugin, exports.RspackOptionsApply = __webpack_exports__.RspackOptionsApply, exports.RuntimeGlobals = __webpack_exports__.RuntimeGlobals, exports.RuntimeModule = __webpack_exports__.RuntimeModule, exports.RuntimePlugin = __webpack_exports__.RuntimePlugin, exports.SourceMapDevToolPlugin = __webpack_exports__.SourceMapDevToolPlugin, exports.Stats = __webpack_exports__.Stats, exports.StatsErrorCode = __webpack_exports__.StatsErrorCode, exports.SubresourceIntegrityPlugin = __webpack_exports__.SubresourceIntegrityPlugin, exports.SwcJsMinimizerRspackPlugin = __webpack_exports__.SwcJsMinimizerRspackPlugin, exports.Template = __webpack_exports__.Template, exports.ValidationError = __webpack_exports__.ValidationError, exports.WarnCaseSensitiveModulesPlugin = __webpack_exports__.WarnCaseSensitiveModulesPlugin, exports.WebpackError = __webpack_exports__.WebpackError, exports.WebpackOptionsApply = __webpack_exports__.WebpackOptionsApply, exports.config = __webpack_exports__.config, exports.container = __webpack_exports__.container, exports.default = __webpack_exports__.default, exports.electron = __webpack_exports__.electron, exports.experiments = __webpack_exports__.experiments, exports.javascript = __webpack_exports__.javascript, exports.lazyCompilationMiddleware = __webpack_exports__.lazyCompilationMiddleware, exports.library = __webpack_exports__.library, exports.node = __webpack_exports__.node, exports.optimize = __webpack_exports__.optimize, exports.rspack = __webpack_exports__.rspack, exports.rspackVersion = __webpack_exports__.rspackVersion, exports.sharing = __webpack_exports__.sharing, exports.sources = __webpack_exports__.sources, exports.util = __webpack_exports__.util, exports.version = __webpack_exports__.version, exports.wasm = __webpack_exports__.wasm, exports.web = __webpack_exports__.web, exports.webworker = __webpack_exports__.webworker, __webpack_exports__)-1 === [
|
|
12324
12360
|
"AsyncDependenciesBlock",
|
|
12325
12361
|
"BannerPlugin",
|
|
12326
12362
|
"CircularDependencyRspackPlugin",
|
|
@@ -12366,6 +12402,7 @@ Help:
|
|
|
12366
12402
|
"SourceMapDevToolPlugin",
|
|
12367
12403
|
"Stats",
|
|
12368
12404
|
"StatsErrorCode",
|
|
12405
|
+
"SubresourceIntegrityPlugin",
|
|
12369
12406
|
"SwcJsMinimizerRspackPlugin",
|
|
12370
12407
|
"Template",
|
|
12371
12408
|
"ValidationError",
|
|
@@ -12378,6 +12415,7 @@ Help:
|
|
|
12378
12415
|
"electron",
|
|
12379
12416
|
"experiments",
|
|
12380
12417
|
"javascript",
|
|
12418
|
+
"lazyCompilationMiddleware",
|
|
12381
12419
|
"library",
|
|
12382
12420
|
"node",
|
|
12383
12421
|
"optimize",
|
|
@@ -28,6 +28,6 @@ export declare class EntryOptionPlugin {
|
|
|
28
28
|
* @param desc entry description
|
|
29
29
|
* @returns options for the entry
|
|
30
30
|
*/
|
|
31
|
-
static entryDescriptionToOptions(
|
|
31
|
+
static entryDescriptionToOptions(_compiler: Compiler, name: string, desc: EntryDescriptionNormalized): EntryOptions;
|
|
32
32
|
}
|
|
33
33
|
export default EntryOptionPlugin;
|
package/dist/util/fake.d.ts
CHANGED
|
@@ -3,7 +3,12 @@ export type FakeHook<T> = T & {
|
|
|
3
3
|
};
|
|
4
4
|
export declare function createFakeCompilationDependencies(getDeps: () => string[], addDeps: (deps: string[]) => void): {
|
|
5
5
|
[Symbol.iterator](): Generator<string, void, unknown>;
|
|
6
|
-
has(dep: string)
|
|
6
|
+
has: (dep: string) => boolean;
|
|
7
7
|
add: (dep: string) => void;
|
|
8
8
|
addAll: (deps: Iterable<string>) => void;
|
|
9
|
+
delete: (dep: string) => boolean;
|
|
10
|
+
keys(): SetIterator<string>;
|
|
11
|
+
values(): SetIterator<string>;
|
|
12
|
+
entries(): SetIterator<[string, string]>;
|
|
13
|
+
readonly size: number;
|
|
9
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-beta.0",
|
|
4
4
|
"webpackVersion": "5.75.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The fast Rust-based web bundler with webpack-compatible API",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"browserslist-load-config": "^1.0.1",
|
|
48
48
|
"enhanced-resolve": "5.18.3",
|
|
49
49
|
"glob-to-regexp": "^0.4.1",
|
|
50
|
-
"memfs": "4.
|
|
50
|
+
"memfs": "4.51.1",
|
|
51
51
|
"prebundle": "^1.6.0",
|
|
52
52
|
"tinypool": "^1.1.1",
|
|
53
|
-
"tsx": "^4.
|
|
53
|
+
"tsx": "^4.21.0",
|
|
54
54
|
"typescript": "^5.9.3",
|
|
55
55
|
"watchpack": "^2.4.4",
|
|
56
56
|
"webpack-sources": "3.3.3"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@module-federation/runtime-tools": "0.21.6",
|
|
60
60
|
"@rspack/lite-tapable": "1.1.0",
|
|
61
|
-
"@rspack/binding": "1.
|
|
61
|
+
"@rspack/binding": "1.7.0-beta.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@swc/helpers": ">=0.5.1"
|