@rspack/core 1.1.4 → 1.1.6
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 +2 -0
- package/dist/Compiler.d.ts +2 -2
- package/dist/FileSystem.d.ts +16 -4
- package/dist/Module.d.ts +1 -0
- package/dist/MultiCompiler.d.ts +3 -3
- package/dist/Stats.d.ts +1 -1
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +8 -10
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +10 -11
- package/dist/builtin-plugin/HtmlRspackPlugin.d.ts +2 -0
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +8 -10
- package/dist/config/normalization.d.ts +1 -1
- package/dist/config/types.d.ts +33 -1
- package/dist/config/zod.d.ts +54 -172
- package/dist/cssExtractLoader.js +1 -0
- package/dist/index.js +381 -197
- package/dist/util/MergeCaller.d.ts +1 -3
- package/dist/util/fs.d.ts +36 -1
- package/dist/util/source.d.ts +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -742,7 +742,7 @@ __export(src_exports, {
|
|
|
742
742
|
rspackVersion: () => rspackVersion,
|
|
743
743
|
sharing: () => sharing,
|
|
744
744
|
sources: () => sources,
|
|
745
|
-
util: () =>
|
|
745
|
+
util: () => util7,
|
|
746
746
|
version: () => version,
|
|
747
747
|
wasm: () => wasm,
|
|
748
748
|
web: () => web,
|
|
@@ -804,7 +804,7 @@ __export(exports_exports, {
|
|
|
804
804
|
rspackVersion: () => rspackVersion,
|
|
805
805
|
sharing: () => sharing,
|
|
806
806
|
sources: () => sources,
|
|
807
|
-
util: () =>
|
|
807
|
+
util: () => util7,
|
|
808
808
|
version: () => version,
|
|
809
809
|
wasm: () => wasm,
|
|
810
810
|
web: () => web,
|
|
@@ -1716,10 +1716,11 @@ RuntimeModule.STAGE_TRIGGER = 20 /* TRIGGER */;
|
|
|
1716
1716
|
// src/Stats.ts
|
|
1717
1717
|
var Stats = class {
|
|
1718
1718
|
#inner;
|
|
1719
|
+
#compilation;
|
|
1719
1720
|
#innerMap;
|
|
1720
1721
|
constructor(compilation) {
|
|
1721
1722
|
this.#inner = compilation.__internal_getInner().getStats();
|
|
1722
|
-
this
|
|
1723
|
+
this.#compilation = compilation;
|
|
1723
1724
|
this.#innerMap = new WeakMap([[this.compilation, this.#inner]]);
|
|
1724
1725
|
}
|
|
1725
1726
|
// use correct JsStats for child compilation
|
|
@@ -1731,6 +1732,14 @@ var Stats = class {
|
|
|
1731
1732
|
this.#innerMap.set(compilation, inner);
|
|
1732
1733
|
return inner;
|
|
1733
1734
|
}
|
|
1735
|
+
get compilation() {
|
|
1736
|
+
if (this.#compilation.__internal__shutdown) {
|
|
1737
|
+
throw new Error(
|
|
1738
|
+
"Unable to access `Stats` after the compiler was shutdown"
|
|
1739
|
+
);
|
|
1740
|
+
}
|
|
1741
|
+
return this.#compilation;
|
|
1742
|
+
}
|
|
1734
1743
|
get hash() {
|
|
1735
1744
|
return this.compilation.hash;
|
|
1736
1745
|
}
|
|
@@ -2662,24 +2671,20 @@ var JsAssetInfo = class {
|
|
|
2662
2671
|
|
|
2663
2672
|
// src/util/MergeCaller.ts
|
|
2664
2673
|
var MergeCaller = class {
|
|
2665
|
-
constructor(fn2
|
|
2666
|
-
this.timer = null;
|
|
2674
|
+
constructor(fn2) {
|
|
2667
2675
|
this.callArgs = [];
|
|
2668
2676
|
this.finalCall = () => {
|
|
2669
|
-
this.timer = null;
|
|
2670
2677
|
const args = this.callArgs;
|
|
2671
2678
|
this.callArgs = [];
|
|
2672
2679
|
this.callFn(args);
|
|
2673
2680
|
};
|
|
2674
|
-
this.debounceTime = debounceTime;
|
|
2675
2681
|
this.callFn = fn2;
|
|
2676
2682
|
}
|
|
2677
2683
|
push(...data) {
|
|
2678
|
-
if (this.
|
|
2679
|
-
|
|
2684
|
+
if (this.callArgs.length === 0) {
|
|
2685
|
+
queueMicrotask(this.finalCall);
|
|
2680
2686
|
}
|
|
2681
2687
|
this.callArgs.push(...data);
|
|
2682
|
-
this.timer = setTimeout(this.finalCall, this.debounceTime);
|
|
2683
2688
|
}
|
|
2684
2689
|
};
|
|
2685
2690
|
|
|
@@ -2712,7 +2717,7 @@ function createReadonlyMap(obj) {
|
|
|
2712
2717
|
|
|
2713
2718
|
// src/util/fake.ts
|
|
2714
2719
|
function createFakeCompilationDependencies(getDeps, addDeps) {
|
|
2715
|
-
const addDepsCaller = new MergeCaller(addDeps
|
|
2720
|
+
const addDepsCaller = new MergeCaller(addDeps);
|
|
2716
2721
|
return {
|
|
2717
2722
|
*[Symbol.iterator]() {
|
|
2718
2723
|
const deps = getDeps();
|
|
@@ -2787,11 +2792,12 @@ function memoizeValue(fn2) {
|
|
|
2787
2792
|
}
|
|
2788
2793
|
|
|
2789
2794
|
// src/Compilation.ts
|
|
2790
|
-
var _inner, _customModules, _Compilation_instances, createCachedAssets_fn, _rebuildModuleCaller;
|
|
2795
|
+
var _inner, _shutdown, _customModules, _Compilation_instances, createCachedAssets_fn, _rebuildModuleCaller;
|
|
2791
2796
|
var _Compilation = class _Compilation {
|
|
2792
2797
|
constructor(compiler, inner) {
|
|
2793
2798
|
__privateAdd(this, _Compilation_instances);
|
|
2794
2799
|
__privateAdd(this, _inner);
|
|
2800
|
+
__privateAdd(this, _shutdown);
|
|
2795
2801
|
this.fileSystemInfo = {
|
|
2796
2802
|
createSnapshot() {
|
|
2797
2803
|
return null;
|
|
@@ -2833,10 +2839,10 @@ var _Compilation = class _Compilation {
|
|
|
2833
2839
|
}
|
|
2834
2840
|
}
|
|
2835
2841
|
);
|
|
2836
|
-
}
|
|
2837
|
-
10
|
|
2842
|
+
}
|
|
2838
2843
|
))(this));
|
|
2839
2844
|
__privateSet(this, _inner, inner);
|
|
2845
|
+
__privateSet(this, _shutdown, false);
|
|
2840
2846
|
__privateSet(this, _customModules, {});
|
|
2841
2847
|
const processAssetsHook = new liteTapable.AsyncSeriesHook([
|
|
2842
2848
|
"assets"
|
|
@@ -3574,12 +3580,19 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
|
|
|
3574
3580
|
__internal_getInner() {
|
|
3575
3581
|
return __privateGet(this, _inner);
|
|
3576
3582
|
}
|
|
3583
|
+
get __internal__shutdown() {
|
|
3584
|
+
return __privateGet(this, _shutdown);
|
|
3585
|
+
}
|
|
3586
|
+
set __internal__shutdown(shutdown) {
|
|
3587
|
+
__privateSet(this, _shutdown, shutdown);
|
|
3588
|
+
}
|
|
3577
3589
|
seal() {
|
|
3578
3590
|
}
|
|
3579
3591
|
unseal() {
|
|
3580
3592
|
}
|
|
3581
3593
|
};
|
|
3582
3594
|
_inner = new WeakMap();
|
|
3595
|
+
_shutdown = new WeakMap();
|
|
3583
3596
|
_customModules = new WeakMap();
|
|
3584
3597
|
_Compilation_instances = new WeakSet();
|
|
3585
3598
|
createCachedAssets_fn = function() {
|
|
@@ -5402,12 +5415,26 @@ var DeterministicChunkIdsPlugin = create2(
|
|
|
5402
5415
|
|
|
5403
5416
|
// src/builtin-plugin/DeterministicModuleIdsPlugin.ts
|
|
5404
5417
|
var import_binding21 = require("@rspack/binding");
|
|
5405
|
-
var DeterministicModuleIdsPlugin =
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5418
|
+
var DeterministicModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
5419
|
+
constructor() {
|
|
5420
|
+
super(...arguments);
|
|
5421
|
+
this.name = import_binding21.BuiltinPluginName.DeterministicModuleIdsPlugin;
|
|
5422
|
+
this.affectedHooks = "compilation";
|
|
5423
|
+
}
|
|
5424
|
+
raw(compiler) {
|
|
5425
|
+
const incremental2 = compiler.options.experiments.incremental;
|
|
5426
|
+
const logger = compiler.getInfrastructureLogger(
|
|
5427
|
+
"rspack.DeterministicModuleIdsPlugin"
|
|
5428
|
+
);
|
|
5429
|
+
if (incremental2.moduleIds) {
|
|
5430
|
+
incremental2.moduleIds = false;
|
|
5431
|
+
logger.warn(
|
|
5432
|
+
"`optimization.moduleIds = 'deterministic'` can't be used with `incremental.moduleIds` as deterministic module ids is a global effect. `incremental.moduleIds` has been overridden to false."
|
|
5433
|
+
);
|
|
5434
|
+
}
|
|
5435
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
5436
|
+
}
|
|
5437
|
+
};
|
|
5411
5438
|
|
|
5412
5439
|
// src/builtin-plugin/DynamicEntryPlugin.ts
|
|
5413
5440
|
var import_binding25 = require("@rspack/binding");
|
|
@@ -6231,7 +6258,7 @@ async function runLoaders(compiler, context2) {
|
|
|
6231
6258
|
this.cacheable(false);
|
|
6232
6259
|
}
|
|
6233
6260
|
if (res.error) {
|
|
6234
|
-
reject(new Error(
|
|
6261
|
+
reject(new Error(res.error));
|
|
6235
6262
|
} else {
|
|
6236
6263
|
resolve2(
|
|
6237
6264
|
compiler.__internal__getModuleExecutionResult(res.id)
|
|
@@ -6770,6 +6797,7 @@ var getRawOptions = (options, compiler) => {
|
|
|
6770
6797
|
node: getRawNode(options.node),
|
|
6771
6798
|
// SAFETY: applied default value in `applyRspackOptionsDefaults`.
|
|
6772
6799
|
profile: options.profile,
|
|
6800
|
+
amd: options.amd,
|
|
6773
6801
|
// SAFETY: applied default value in `applyRspackOptionsDefaults`.
|
|
6774
6802
|
bail: options.bail,
|
|
6775
6803
|
__references: {}
|
|
@@ -6851,7 +6879,6 @@ function getRawOutput(output2) {
|
|
|
6851
6879
|
crossOriginLoading: getRawCrossOriginLoading(output2.crossOriginLoading),
|
|
6852
6880
|
cssFilename: output2.cssFilename,
|
|
6853
6881
|
cssChunkFilename: output2.cssChunkFilename,
|
|
6854
|
-
cssHeadDataCompression: output2.cssHeadDataCompression,
|
|
6855
6882
|
hotUpdateChunkFilename: output2.hotUpdateChunkFilename,
|
|
6856
6883
|
hotUpdateMainFilename: output2.hotUpdateMainFilename,
|
|
6857
6884
|
hotUpdateGlobal: output2.hotUpdateGlobal,
|
|
@@ -7378,6 +7405,8 @@ function getRawIncremental(incremental2) {
|
|
|
7378
7405
|
providedExports: incremental2.providedExports,
|
|
7379
7406
|
dependenciesDiagnostics: incremental2.dependenciesDiagnostics,
|
|
7380
7407
|
buildChunkGraph: incremental2.buildChunkGraph,
|
|
7408
|
+
moduleIds: incremental2.moduleIds,
|
|
7409
|
+
chunkIds: incremental2.chunkIds,
|
|
7381
7410
|
modulesHashes: incremental2.modulesHashes,
|
|
7382
7411
|
modulesCodegen: incremental2.modulesCodegen,
|
|
7383
7412
|
modulesRuntimeRequirements: incremental2.modulesRuntimeRequirements,
|
|
@@ -8593,6 +8622,8 @@ var applyExperimentsDefaults = (experiments3, { production }) => {
|
|
|
8593
8622
|
D(experiments3.incremental, "providedExports", false);
|
|
8594
8623
|
D(experiments3.incremental, "dependenciesDiagnostics", false);
|
|
8595
8624
|
D(experiments3.incremental, "buildChunkGraph", false);
|
|
8625
|
+
D(experiments3.incremental, "moduleIds", false);
|
|
8626
|
+
D(experiments3.incremental, "chunkIds", false);
|
|
8596
8627
|
D(experiments3.incremental, "modulesHashes", false);
|
|
8597
8628
|
D(experiments3.incremental, "modulesCodegen", false);
|
|
8598
8629
|
D(experiments3.incremental, "modulesRuntimeRequirements", false);
|
|
@@ -8903,7 +8934,6 @@ while determining default 'output.uniqueName' from 'name' in ${pkgPath}`;
|
|
|
8903
8934
|
const uniqueNameId = Template.toIdentifier(output2.uniqueName);
|
|
8904
8935
|
F(output2, "hotUpdateGlobal", () => `webpackHotUpdate${uniqueNameId}`);
|
|
8905
8936
|
F(output2, "chunkLoadingGlobal", () => `webpackChunk${uniqueNameId}`);
|
|
8906
|
-
D(output2, "cssHeadDataCompression", !development);
|
|
8907
8937
|
D(output2, "assetModuleFilename", "[hash][ext][query]");
|
|
8908
8938
|
D(output2, "webassemblyModuleFilename", "[hash].module.wasm");
|
|
8909
8939
|
D(output2, "compareBeforeEmit", true);
|
|
@@ -9026,6 +9056,7 @@ ${helpMessage}`
|
|
|
9026
9056
|
"policyName",
|
|
9027
9057
|
() => output2.uniqueName.replace(/[^a-zA-Z0-9\-#=_/@.%]+/g, "_") || "webpack"
|
|
9028
9058
|
);
|
|
9059
|
+
D(trustedTypes2, "onPolicyCreationFailure", "stop");
|
|
9029
9060
|
}
|
|
9030
9061
|
const forEachEntry = (fn2) => {
|
|
9031
9062
|
if (typeof entry2 === "function") {
|
|
@@ -9375,6 +9406,7 @@ var A = (obj, prop, factory) => {
|
|
|
9375
9406
|
};
|
|
9376
9407
|
|
|
9377
9408
|
// src/config/normalization.ts
|
|
9409
|
+
var import_node_util4 = __toESM(require("util"));
|
|
9378
9410
|
var getNormalizedRspackOptions = (config2) => {
|
|
9379
9411
|
return {
|
|
9380
9412
|
ignoreWarnings: config2.ignoreWarnings !== void 0 ? config2.ignoreWarnings.map((ignore) => {
|
|
@@ -9391,6 +9423,13 @@ var getNormalizedRspackOptions = (config2) => {
|
|
|
9391
9423
|
mode: config2.mode,
|
|
9392
9424
|
entry: config2.entry === void 0 ? { main: {} } : typeof config2.entry === "function" ? /* @__PURE__ */ ((fn2) => () => Promise.resolve().then(fn2).then(getNormalizedEntryStatic))(config2.entry) : getNormalizedEntryStatic(config2.entry),
|
|
9393
9425
|
output: nestedConfig(config2.output, (output2) => {
|
|
9426
|
+
if ("cssHeadDataCompression" in output2) {
|
|
9427
|
+
import_node_util4.default.deprecate(
|
|
9428
|
+
() => {
|
|
9429
|
+
},
|
|
9430
|
+
"cssHeadDataCompression is not used now, see https://github.com/web-infra-dev/rspack/pull/8534, this option could be removed in the future"
|
|
9431
|
+
)();
|
|
9432
|
+
}
|
|
9394
9433
|
const { library: library3 } = output2;
|
|
9395
9434
|
const libraryAsName = library3;
|
|
9396
9435
|
const libraryBase = typeof library3 === "object" && library3 && !Array.isArray(library3) && "type" in library3 ? library3 : libraryAsName || output2.libraryTarget ? {
|
|
@@ -9406,7 +9445,6 @@ var getNormalizedRspackOptions = (config2) => {
|
|
|
9406
9445
|
chunkLoading: output2.chunkLoading,
|
|
9407
9446
|
chunkFilename: output2.chunkFilename,
|
|
9408
9447
|
crossOriginLoading: output2.crossOriginLoading,
|
|
9409
|
-
cssHeadDataCompression: output2.cssHeadDataCompression,
|
|
9410
9448
|
cssFilename: output2.cssFilename,
|
|
9411
9449
|
cssChunkFilename: output2.cssChunkFilename,
|
|
9412
9450
|
hotUpdateMainFilename: output2.hotUpdateMainFilename,
|
|
@@ -9557,6 +9595,8 @@ var getNormalizedRspackOptions = (config2) => {
|
|
|
9557
9595
|
inferAsyncModules: true,
|
|
9558
9596
|
providedExports: true,
|
|
9559
9597
|
buildChunkGraph: true,
|
|
9598
|
+
moduleIds: true,
|
|
9599
|
+
chunkIds: true,
|
|
9560
9600
|
modulesHashes: true,
|
|
9561
9601
|
modulesCodegen: true,
|
|
9562
9602
|
modulesRuntimeRequirements: true,
|
|
@@ -9571,6 +9611,7 @@ var getNormalizedRspackOptions = (config2) => {
|
|
|
9571
9611
|
watchOptions: cloneObject(config2.watchOptions),
|
|
9572
9612
|
devServer: config2.devServer,
|
|
9573
9613
|
profile: config2.profile,
|
|
9614
|
+
amd: config2.amd ? JSON.stringify(config2.amd) : void 0,
|
|
9574
9615
|
bail: config2.bail
|
|
9575
9616
|
};
|
|
9576
9617
|
};
|
|
@@ -9938,7 +9979,12 @@ var chunkLoadingGlobal = import_zod2.z.string();
|
|
|
9938
9979
|
var enabledLibraryTypes = import_zod2.z.array(
|
|
9939
9980
|
libraryType
|
|
9940
9981
|
);
|
|
9941
|
-
var clean = import_zod2.z.
|
|
9982
|
+
var clean = import_zod2.z.union([
|
|
9983
|
+
import_zod2.z.boolean(),
|
|
9984
|
+
import_zod2.z.strictObject({
|
|
9985
|
+
keep: import_zod2.z.string().optional()
|
|
9986
|
+
})
|
|
9987
|
+
]);
|
|
9942
9988
|
var outputModule = import_zod2.z.boolean();
|
|
9943
9989
|
var strictModuleExceptionHandling = import_zod2.z.boolean();
|
|
9944
9990
|
var strictModuleErrorHandling = import_zod2.z.boolean();
|
|
@@ -9955,7 +10001,8 @@ var enabledChunkLoadingTypes = import_zod2.z.array(
|
|
|
9955
10001
|
var chunkFormat = import_zod2.z.literal(false).or(import_zod2.z.string());
|
|
9956
10002
|
var workerPublicPath = import_zod2.z.string();
|
|
9957
10003
|
var trustedTypes = import_zod2.z.strictObject({
|
|
9958
|
-
policyName: import_zod2.z.string().optional()
|
|
10004
|
+
policyName: import_zod2.z.string().optional(),
|
|
10005
|
+
onPolicyCreationFailure: import_zod2.z.enum(["continue", "stop"]).optional()
|
|
9959
10006
|
});
|
|
9960
10007
|
var hashDigest = import_zod2.z.string();
|
|
9961
10008
|
var hashDigestLength = import_zod2.z.number();
|
|
@@ -10428,8 +10475,18 @@ var externalItemFunctionData = import_zod2.z.strictObject({
|
|
|
10428
10475
|
dependencyType: import_zod2.z.string().optional(),
|
|
10429
10476
|
request: import_zod2.z.string().optional(),
|
|
10430
10477
|
contextInfo: import_zod2.z.strictObject({
|
|
10431
|
-
issuer: import_zod2.z.string()
|
|
10432
|
-
|
|
10478
|
+
issuer: import_zod2.z.string(),
|
|
10479
|
+
issuerLayer: import_zod2.z.string().or(import_zod2.z.null()).optional()
|
|
10480
|
+
}).optional(),
|
|
10481
|
+
getResolve: import_zod2.z.function().returns(
|
|
10482
|
+
import_zod2.z.function().args(import_zod2.z.string(), import_zod2.z.string()).returns(import_zod2.z.promise(import_zod2.z.string())).or(
|
|
10483
|
+
import_zod2.z.function().args(
|
|
10484
|
+
import_zod2.z.string(),
|
|
10485
|
+
import_zod2.z.string(),
|
|
10486
|
+
import_zod2.z.function().args(import_zod2.z.instanceof(Error).optional(), import_zod2.z.string().optional()).returns(import_zod2.z.void())
|
|
10487
|
+
).returns(import_zod2.z.void())
|
|
10488
|
+
)
|
|
10489
|
+
).optional()
|
|
10433
10490
|
});
|
|
10434
10491
|
var externalItem = import_zod2.z.string().or(import_zod2.z.instanceof(RegExp)).or(externalItemObjectUnknown).or(
|
|
10435
10492
|
import_zod2.z.function().args(
|
|
@@ -10733,6 +10790,8 @@ var incremental = import_zod2.z.strictObject({
|
|
|
10733
10790
|
providedExports: import_zod2.z.boolean().optional(),
|
|
10734
10791
|
dependenciesDiagnostics: import_zod2.z.boolean().optional(),
|
|
10735
10792
|
buildChunkGraph: import_zod2.z.boolean().optional(),
|
|
10793
|
+
moduleIds: import_zod2.z.boolean().optional(),
|
|
10794
|
+
chunkIds: import_zod2.z.boolean().optional(),
|
|
10736
10795
|
modulesHashes: import_zod2.z.boolean().optional(),
|
|
10737
10796
|
modulesCodegen: import_zod2.z.boolean().optional(),
|
|
10738
10797
|
modulesRuntimeRequirements: import_zod2.z.boolean().optional(),
|
|
@@ -10766,6 +10825,7 @@ var ignoreWarnings = import_zod2.z.instanceof(RegExp).or(
|
|
|
10766
10825
|
import_zod2.z.function().args(import_zod2.z.instanceof(Error), import_zod2.z.custom()).returns(import_zod2.z.boolean())
|
|
10767
10826
|
).array();
|
|
10768
10827
|
var profile = import_zod2.z.boolean();
|
|
10828
|
+
var amd = import_zod2.z.literal(false).or(import_zod2.z.record(import_zod2.z.any()));
|
|
10769
10829
|
var bail = import_zod2.z.boolean();
|
|
10770
10830
|
var performance = import_zod2.z.strictObject({
|
|
10771
10831
|
assetFilter: import_zod2.z.function().args(import_zod2.z.string()).returns(import_zod2.z.boolean()).optional(),
|
|
@@ -10802,6 +10862,7 @@ var rspackOptions = import_zod2.z.strictObject({
|
|
|
10802
10862
|
devServer: devServer.optional(),
|
|
10803
10863
|
module: moduleOptions.optional(),
|
|
10804
10864
|
profile: profile.optional(),
|
|
10865
|
+
amd: amd.optional(),
|
|
10805
10866
|
bail: bail.optional(),
|
|
10806
10867
|
performance: performance.optional()
|
|
10807
10868
|
});
|
|
@@ -10960,29 +11021,126 @@ var EvalSourceMapDevToolPlugin = create2(
|
|
|
10960
11021
|
|
|
10961
11022
|
// src/builtin-plugin/ExternalsPlugin.ts
|
|
10962
11023
|
var import_binding33 = require("@rspack/binding");
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
11024
|
+
|
|
11025
|
+
// src/Resolver.ts
|
|
11026
|
+
function isString(value) {
|
|
11027
|
+
return typeof value === "string";
|
|
11028
|
+
}
|
|
11029
|
+
var Resolver = class _Resolver {
|
|
11030
|
+
constructor(binding3) {
|
|
11031
|
+
this.binding = binding3;
|
|
11032
|
+
}
|
|
11033
|
+
resolveSync(context2, path10, request) {
|
|
11034
|
+
return this.binding.resolveSync(path10, request);
|
|
11035
|
+
}
|
|
11036
|
+
resolve(context2, path10, request, resolveContext, callback) {
|
|
11037
|
+
try {
|
|
11038
|
+
const res = this.binding.resolveSync(path10, request);
|
|
11039
|
+
callback(null, res);
|
|
11040
|
+
} catch (err) {
|
|
11041
|
+
callback(err);
|
|
11042
|
+
}
|
|
11043
|
+
}
|
|
11044
|
+
withOptions({
|
|
11045
|
+
dependencyCategory,
|
|
11046
|
+
resolveToContext,
|
|
11047
|
+
...resolve2
|
|
11048
|
+
}) {
|
|
11049
|
+
const rawResolve = getRawResolve(resolve2);
|
|
11050
|
+
if (Array.isArray(rawResolve.restrictions)) {
|
|
11051
|
+
rawResolve.restrictions = rawResolve.restrictions.filter(isString);
|
|
11052
|
+
}
|
|
11053
|
+
const binding3 = this.binding.withOptions({
|
|
11054
|
+
dependencyCategory,
|
|
11055
|
+
resolveToContext,
|
|
11056
|
+
...rawResolve
|
|
11057
|
+
});
|
|
11058
|
+
return new _Resolver(binding3);
|
|
11059
|
+
}
|
|
11060
|
+
};
|
|
11061
|
+
|
|
11062
|
+
// src/builtin-plugin/ExternalsPlugin.ts
|
|
11063
|
+
var ExternalsPlugin = class extends RspackBuiltinPlugin {
|
|
11064
|
+
constructor(type, externals2) {
|
|
11065
|
+
super();
|
|
11066
|
+
this.type = type;
|
|
11067
|
+
this.externals = externals2;
|
|
11068
|
+
this.name = import_binding33.BuiltinPluginName.ExternalsPlugin;
|
|
11069
|
+
}
|
|
11070
|
+
raw(compiler) {
|
|
11071
|
+
const { type, externals: externals2 } = this;
|
|
11072
|
+
const raw = {
|
|
10967
11073
|
type,
|
|
10968
|
-
externals: (Array.isArray(externals2) ? externals2 : [externals2]).filter(Boolean).map(getRawExternalItem)
|
|
11074
|
+
externals: (Array.isArray(externals2) ? externals2 : [externals2]).filter(Boolean).map((item) => getRawExternalItem(compiler, item))
|
|
10969
11075
|
};
|
|
11076
|
+
return createBuiltinPlugin(this.name, raw);
|
|
10970
11077
|
}
|
|
10971
|
-
|
|
10972
|
-
function getRawExternalItem(item) {
|
|
11078
|
+
};
|
|
11079
|
+
function getRawExternalItem(compiler, item) {
|
|
10973
11080
|
if (typeof item === "string" || item instanceof RegExp) {
|
|
10974
11081
|
return item;
|
|
10975
11082
|
}
|
|
10976
11083
|
if (typeof item === "function") {
|
|
10977
11084
|
return async (ctx) => {
|
|
10978
11085
|
return await new Promise((resolve2, reject) => {
|
|
10979
|
-
const
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
|
|
10985
|
-
|
|
11086
|
+
const data = ctx.data();
|
|
11087
|
+
const promise = item(
|
|
11088
|
+
{
|
|
11089
|
+
request: data.request,
|
|
11090
|
+
dependencyType: data.dependencyType,
|
|
11091
|
+
context: data.context,
|
|
11092
|
+
contextInfo: {
|
|
11093
|
+
issuer: data.contextInfo.issuer,
|
|
11094
|
+
issuerLayer: data.contextInfo.issuerLayer ?? null
|
|
11095
|
+
},
|
|
11096
|
+
getResolve: function getResolve(options) {
|
|
11097
|
+
const resolver = new Resolver(ctx.getResolver());
|
|
11098
|
+
const getResolveContext = () => ({
|
|
11099
|
+
fileDependencies: compiler._lastCompilation.fileDependencies,
|
|
11100
|
+
missingDependencies: compiler._lastCompilation.missingDependencies,
|
|
11101
|
+
contextDependencies: compiler._lastCompilation.contextDependencies
|
|
11102
|
+
});
|
|
11103
|
+
const child = options ? resolver.withOptions(options) : resolver;
|
|
11104
|
+
return (context2, request, callback) => {
|
|
11105
|
+
if (callback) {
|
|
11106
|
+
child.resolve(
|
|
11107
|
+
{},
|
|
11108
|
+
context2,
|
|
11109
|
+
request,
|
|
11110
|
+
getResolveContext(),
|
|
11111
|
+
(err, result2) => {
|
|
11112
|
+
if (err) return callback(err);
|
|
11113
|
+
callback(
|
|
11114
|
+
void 0,
|
|
11115
|
+
typeof result2 === "string" ? result2 : void 0
|
|
11116
|
+
);
|
|
11117
|
+
}
|
|
11118
|
+
);
|
|
11119
|
+
} else {
|
|
11120
|
+
return new Promise((resolve3, reject2) => {
|
|
11121
|
+
child.resolve(
|
|
11122
|
+
{},
|
|
11123
|
+
context2,
|
|
11124
|
+
request,
|
|
11125
|
+
getResolveContext(),
|
|
11126
|
+
(err, result2) => {
|
|
11127
|
+
if (err) reject2(err);
|
|
11128
|
+
else resolve3(result2);
|
|
11129
|
+
}
|
|
11130
|
+
);
|
|
11131
|
+
});
|
|
11132
|
+
}
|
|
11133
|
+
};
|
|
11134
|
+
}
|
|
11135
|
+
},
|
|
11136
|
+
(err, result2, type) => {
|
|
11137
|
+
if (err) reject(err);
|
|
11138
|
+
resolve2({
|
|
11139
|
+
result: getRawExternalItemValueFormFnResult(result2),
|
|
11140
|
+
externalType: type
|
|
11141
|
+
});
|
|
11142
|
+
}
|
|
11143
|
+
);
|
|
10986
11144
|
if (promise == null ? void 0 : promise.then) {
|
|
10987
11145
|
promise.then(
|
|
10988
11146
|
(result2) => resolve2({
|
|
@@ -11367,6 +11525,7 @@ var htmlRspackPluginOptions = import_zod3.z.strictObject({
|
|
|
11367
11525
|
scriptLoading: import_zod3.z.enum(["blocking", "defer", "module", "systemjs-module"]).optional(),
|
|
11368
11526
|
chunks: import_zod3.z.string().array().optional(),
|
|
11369
11527
|
excludeChunks: import_zod3.z.string().array().optional(),
|
|
11528
|
+
chunksSortMode: import_zod3.z.enum(["auto", "manual"]).optional(),
|
|
11370
11529
|
sri: import_zod3.z.enum(["sha256", "sha384", "sha512"]).optional(),
|
|
11371
11530
|
minify: import_zod3.z.boolean().optional(),
|
|
11372
11531
|
title: import_zod3.z.string().optional(),
|
|
@@ -11397,6 +11556,7 @@ var HtmlRspackPluginImpl = create2(
|
|
|
11397
11556
|
const configInject = c.inject ?? true;
|
|
11398
11557
|
const inject = configInject === true ? scriptLoading === "blocking" ? "body" : "head" : configInject === false ? "false" : configInject;
|
|
11399
11558
|
const base = typeof c.base === "string" ? { href: c.base } : c.base;
|
|
11559
|
+
const chunksSortMode = c.chunksSortMode ?? "auto";
|
|
11400
11560
|
let compilation = null;
|
|
11401
11561
|
this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance) => {
|
|
11402
11562
|
compilation = compilationInstance;
|
|
@@ -11525,6 +11685,7 @@ var HtmlRspackPluginImpl = create2(
|
|
|
11525
11685
|
publicPath: c.publicPath,
|
|
11526
11686
|
chunks: c.chunks,
|
|
11527
11687
|
excludeChunks: c.excludeChunks,
|
|
11688
|
+
chunksSortMode,
|
|
11528
11689
|
sri: c.sri,
|
|
11529
11690
|
minify: c.minify,
|
|
11530
11691
|
meta,
|
|
@@ -11950,6 +12111,12 @@ var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
|
|
11950
12111
|
const logger = compiler.getInfrastructureLogger(
|
|
11951
12112
|
"rspack.ModuleConcatenationPlugin"
|
|
11952
12113
|
);
|
|
12114
|
+
if (incremental2.moduleIds) {
|
|
12115
|
+
incremental2.moduleIds = false;
|
|
12116
|
+
logger.warn(
|
|
12117
|
+
"`optimization.concatenateModules` can't be used with `incremental.moduleIds` as module concatenation is a global effect. `incremental.moduleIds` has been overridden to false."
|
|
12118
|
+
);
|
|
12119
|
+
}
|
|
11953
12120
|
if (incremental2.modulesHashes) {
|
|
11954
12121
|
incremental2.modulesHashes = false;
|
|
11955
12122
|
logger.warn(
|
|
@@ -11968,6 +12135,24 @@ var ModuleConcatenationPlugin = class extends RspackBuiltinPlugin {
|
|
|
11968
12135
|
"`optimization.concatenateModules` can't be used with `incremental.modulesRuntimeRequirements` as module concatenation is a global effect. `incremental.modulesRuntimeRequirements` has been overridden to false."
|
|
11969
12136
|
);
|
|
11970
12137
|
}
|
|
12138
|
+
if (incremental2.chunksRuntimeRequirements) {
|
|
12139
|
+
incremental2.chunksRuntimeRequirements = false;
|
|
12140
|
+
logger.warn(
|
|
12141
|
+
"`optimization.concatenateModules` can't be used with `incremental.chunksRuntimeRequirements` as module concatenation is a global effect. `incremental.chunksRuntimeRequirements` has been overridden to false."
|
|
12142
|
+
);
|
|
12143
|
+
}
|
|
12144
|
+
if (incremental2.chunksHashes) {
|
|
12145
|
+
incremental2.chunksHashes = false;
|
|
12146
|
+
logger.warn(
|
|
12147
|
+
"`optimization.concatenateModules` can't be used with `incremental.chunksHashes` as module concatenation is a global effect. `incremental.chunksHashes` has been overridden to false."
|
|
12148
|
+
);
|
|
12149
|
+
}
|
|
12150
|
+
if (incremental2.chunksRender) {
|
|
12151
|
+
incremental2.chunksRender = false;
|
|
12152
|
+
logger.warn(
|
|
12153
|
+
"`optimization.concatenateModules` can't be used with `incremental.chunksRender` as module concatenation is a global effect. `incremental.chunksRender` has been overridden to false."
|
|
12154
|
+
);
|
|
12155
|
+
}
|
|
11971
12156
|
return createBuiltinPlugin(this.name, void 0);
|
|
11972
12157
|
}
|
|
11973
12158
|
};
|
|
@@ -12001,12 +12186,26 @@ var NaturalChunkIdsPlugin = create2(
|
|
|
12001
12186
|
|
|
12002
12187
|
// src/builtin-plugin/NaturalModuleIdsPlugin.ts
|
|
12003
12188
|
var import_binding54 = require("@rspack/binding");
|
|
12004
|
-
var NaturalModuleIdsPlugin =
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12189
|
+
var NaturalModuleIdsPlugin = class extends RspackBuiltinPlugin {
|
|
12190
|
+
constructor() {
|
|
12191
|
+
super(...arguments);
|
|
12192
|
+
this.name = import_binding54.BuiltinPluginName.NaturalModuleIdsPlugin;
|
|
12193
|
+
this.affectedHooks = "compilation";
|
|
12194
|
+
}
|
|
12195
|
+
raw(compiler) {
|
|
12196
|
+
const incremental2 = compiler.options.experiments.incremental;
|
|
12197
|
+
const logger = compiler.getInfrastructureLogger(
|
|
12198
|
+
"rspack.NaturalModuleIdsPlugin"
|
|
12199
|
+
);
|
|
12200
|
+
if (incremental2.moduleIds) {
|
|
12201
|
+
incremental2.moduleIds = false;
|
|
12202
|
+
logger.warn(
|
|
12203
|
+
"`optimization.moduleIds = 'natural'` can't be used with `incremental.moduleIds` as natural module ids is a global effect. `incremental.moduleIds` has been overridden to false."
|
|
12204
|
+
);
|
|
12205
|
+
}
|
|
12206
|
+
return createBuiltinPlugin(this.name, void 0);
|
|
12207
|
+
}
|
|
12208
|
+
};
|
|
12010
12209
|
|
|
12011
12210
|
// src/builtin-plugin/NodeTargetPlugin.ts
|
|
12012
12211
|
var import_binding55 = require("@rspack/binding");
|
|
@@ -12043,7 +12242,8 @@ var ProvidePlugin = create2(
|
|
|
12043
12242
|
return [key, value];
|
|
12044
12243
|
});
|
|
12045
12244
|
return Object.fromEntries(entries);
|
|
12046
|
-
}
|
|
12245
|
+
},
|
|
12246
|
+
"compilation"
|
|
12047
12247
|
);
|
|
12048
12248
|
|
|
12049
12249
|
// src/builtin-plugin/RealContentHashPlugin.ts
|
|
@@ -12500,7 +12700,7 @@ var ContextModuleFactory = class {
|
|
|
12500
12700
|
};
|
|
12501
12701
|
|
|
12502
12702
|
// src/FileSystem.ts
|
|
12503
|
-
var
|
|
12703
|
+
var import_node_util5 = __toESM(require("util"));
|
|
12504
12704
|
|
|
12505
12705
|
// src/util/fs.ts
|
|
12506
12706
|
var import_node_assert6 = __toESM(require("assert"));
|
|
@@ -12610,6 +12810,7 @@ var mkdirp = (fs5, p, callback) => {
|
|
|
12610
12810
|
};
|
|
12611
12811
|
|
|
12612
12812
|
// src/FileSystem.ts
|
|
12813
|
+
var BUFFER_SIZE = 1e3;
|
|
12613
12814
|
var NOOP_FILESYSTEM = {
|
|
12614
12815
|
writeFile() {
|
|
12615
12816
|
},
|
|
@@ -12628,29 +12829,45 @@ var NOOP_FILESYSTEM = {
|
|
|
12628
12829
|
stat: () => {
|
|
12629
12830
|
},
|
|
12630
12831
|
lstat: () => {
|
|
12832
|
+
},
|
|
12833
|
+
open: () => {
|
|
12834
|
+
},
|
|
12835
|
+
rename: () => {
|
|
12836
|
+
},
|
|
12837
|
+
close: () => {
|
|
12838
|
+
},
|
|
12839
|
+
write: () => {
|
|
12840
|
+
},
|
|
12841
|
+
writeAll: () => {
|
|
12842
|
+
},
|
|
12843
|
+
read: () => {
|
|
12844
|
+
},
|
|
12845
|
+
readUntil: () => {
|
|
12846
|
+
},
|
|
12847
|
+
readToEnd: () => {
|
|
12631
12848
|
}
|
|
12632
12849
|
};
|
|
12633
|
-
var
|
|
12850
|
+
var ThreadsafeOutputNodeFS = class _ThreadsafeOutputNodeFS {
|
|
12634
12851
|
constructor(fs5) {
|
|
12852
|
+
Object.assign(this, NOOP_FILESYSTEM);
|
|
12635
12853
|
if (!fs5) {
|
|
12636
|
-
Object.assign(this, NOOP_FILESYSTEM);
|
|
12637
12854
|
return;
|
|
12638
12855
|
}
|
|
12639
|
-
this.writeFile = memoizeFn(() =>
|
|
12640
|
-
this.removeFile = memoizeFn(() =>
|
|
12641
|
-
this.mkdir = memoizeFn(() =>
|
|
12642
|
-
this.mkdirp = memoizeFn(() =>
|
|
12643
|
-
this.removeDirAll = memoizeFn(() =>
|
|
12856
|
+
this.writeFile = memoizeFn(() => import_node_util5.default.promisify(fs5.writeFile.bind(fs5)));
|
|
12857
|
+
this.removeFile = memoizeFn(() => import_node_util5.default.promisify(fs5.unlink.bind(fs5)));
|
|
12858
|
+
this.mkdir = memoizeFn(() => import_node_util5.default.promisify(fs5.mkdir.bind(fs5)));
|
|
12859
|
+
this.mkdirp = memoizeFn(() => import_node_util5.default.promisify(mkdirp.bind(null, fs5)));
|
|
12860
|
+
this.removeDirAll = memoizeFn(() => import_node_util5.default.promisify(rmrf.bind(null, fs5)));
|
|
12644
12861
|
this.readDir = memoizeFn(() => {
|
|
12645
|
-
const readDirFn =
|
|
12862
|
+
const readDirFn = import_node_util5.default.promisify(fs5.readdir.bind(fs5));
|
|
12646
12863
|
return async (filePath) => {
|
|
12647
12864
|
const res = await readDirFn(filePath);
|
|
12648
12865
|
return res;
|
|
12649
12866
|
};
|
|
12650
12867
|
});
|
|
12651
|
-
this.readFile = memoizeFn(() =>
|
|
12868
|
+
this.readFile = memoizeFn(() => import_node_util5.default.promisify(fs5.readFile.bind(fs5)));
|
|
12652
12869
|
this.stat = memoizeFn(() => {
|
|
12653
|
-
const statFn =
|
|
12870
|
+
const statFn = import_node_util5.default.promisify(fs5.stat.bind(fs5));
|
|
12654
12871
|
return async (filePath) => {
|
|
12655
12872
|
const res = await statFn(filePath);
|
|
12656
12873
|
return res && {
|
|
@@ -12665,10 +12882,10 @@ var ThreadsafeWritableNodeFS = class _ThreadsafeWritableNodeFS {
|
|
|
12665
12882
|
};
|
|
12666
12883
|
});
|
|
12667
12884
|
this.lstat = memoizeFn(() => {
|
|
12668
|
-
const statFn =
|
|
12885
|
+
const statFn = import_node_util5.default.promisify((fs5.lstat || fs5.stat).bind(fs5));
|
|
12669
12886
|
return async (filePath) => {
|
|
12670
12887
|
const res = await statFn(filePath);
|
|
12671
|
-
return res &&
|
|
12888
|
+
return res && _ThreadsafeOutputNodeFS.__to_binding_stat(res);
|
|
12672
12889
|
};
|
|
12673
12890
|
});
|
|
12674
12891
|
}
|
|
@@ -12687,6 +12904,90 @@ var ThreadsafeWritableNodeFS = class _ThreadsafeWritableNodeFS {
|
|
|
12687
12904
|
};
|
|
12688
12905
|
}
|
|
12689
12906
|
};
|
|
12907
|
+
var ThreadsafeIntermediateNodeFS = class extends ThreadsafeOutputNodeFS {
|
|
12908
|
+
constructor(fs5) {
|
|
12909
|
+
super(fs5);
|
|
12910
|
+
if (!fs5) {
|
|
12911
|
+
return;
|
|
12912
|
+
}
|
|
12913
|
+
this.open = memoizeFn(() => import_node_util5.default.promisify(fs5.open.bind(fs5)));
|
|
12914
|
+
this.rename = memoizeFn(() => import_node_util5.default.promisify(fs5.rename.bind(fs5)));
|
|
12915
|
+
this.close = memoizeFn(() => import_node_util5.default.promisify(fs5.close.bind(fs5)));
|
|
12916
|
+
this.write = memoizeFn(() => {
|
|
12917
|
+
const writeFn = import_node_util5.default.promisify(fs5.write.bind(fs5));
|
|
12918
|
+
return async (fd, content, position) => {
|
|
12919
|
+
return await writeFn(fd, content, {
|
|
12920
|
+
position
|
|
12921
|
+
});
|
|
12922
|
+
};
|
|
12923
|
+
});
|
|
12924
|
+
this.writeAll = memoizeFn(() => {
|
|
12925
|
+
const writeFn = import_node_util5.default.promisify(fs5.writeFile.bind(fs5));
|
|
12926
|
+
return async (fd, content) => {
|
|
12927
|
+
return await writeFn(fd, content);
|
|
12928
|
+
};
|
|
12929
|
+
});
|
|
12930
|
+
this.read = memoizeFn(() => {
|
|
12931
|
+
const readFn = fs5.read.bind(fs5);
|
|
12932
|
+
return async (fd, length, position) => {
|
|
12933
|
+
new Promise((resolve2) => {
|
|
12934
|
+
readFn(
|
|
12935
|
+
fd,
|
|
12936
|
+
{
|
|
12937
|
+
position,
|
|
12938
|
+
length
|
|
12939
|
+
},
|
|
12940
|
+
(err, bytesRead, buffer) => {
|
|
12941
|
+
if (err) {
|
|
12942
|
+
resolve2(err);
|
|
12943
|
+
} else {
|
|
12944
|
+
resolve2(buffer);
|
|
12945
|
+
}
|
|
12946
|
+
}
|
|
12947
|
+
);
|
|
12948
|
+
});
|
|
12949
|
+
};
|
|
12950
|
+
});
|
|
12951
|
+
this.readUntil = memoizeFn(() => {
|
|
12952
|
+
return async (fd, delim, position) => {
|
|
12953
|
+
const res = [];
|
|
12954
|
+
let current_position = position;
|
|
12955
|
+
while (true) {
|
|
12956
|
+
const buffer = await this.read(fd, BUFFER_SIZE, current_position);
|
|
12957
|
+
if (!buffer || buffer.length === 0) {
|
|
12958
|
+
break;
|
|
12959
|
+
}
|
|
12960
|
+
const pos = buffer.indexOf(delim);
|
|
12961
|
+
if (pos >= 0) {
|
|
12962
|
+
res.push(buffer.slice(0, pos));
|
|
12963
|
+
break;
|
|
12964
|
+
}
|
|
12965
|
+
res.push(buffer);
|
|
12966
|
+
current_position += buffer.length;
|
|
12967
|
+
}
|
|
12968
|
+
return Buffer.concat(res);
|
|
12969
|
+
};
|
|
12970
|
+
});
|
|
12971
|
+
this.readToEnd = memoizeFn(() => {
|
|
12972
|
+
return async (fd, position) => {
|
|
12973
|
+
const res = [];
|
|
12974
|
+
let current_position = position;
|
|
12975
|
+
while (true) {
|
|
12976
|
+
const buffer = await this.read(fd, BUFFER_SIZE, current_position);
|
|
12977
|
+
if (!buffer || buffer.length === 0) {
|
|
12978
|
+
break;
|
|
12979
|
+
}
|
|
12980
|
+
res.push(buffer);
|
|
12981
|
+
current_position += buffer.length;
|
|
12982
|
+
}
|
|
12983
|
+
return Buffer.concat(res);
|
|
12984
|
+
};
|
|
12985
|
+
});
|
|
12986
|
+
}
|
|
12987
|
+
static __to_binding(fs5) {
|
|
12988
|
+
return new this(fs5);
|
|
12989
|
+
}
|
|
12990
|
+
};
|
|
12690
12991
|
|
|
12691
12992
|
// src/NormalModuleFactory.ts
|
|
12692
12993
|
var liteTapable6 = __toESM(require("@rspack/lite-tapable"));
|
|
@@ -12710,45 +13011,6 @@ var NormalModuleFactory = class {
|
|
|
12710
13011
|
|
|
12711
13012
|
// src/ResolverFactory.ts
|
|
12712
13013
|
var binding = __toESM(require("@rspack/binding"));
|
|
12713
|
-
|
|
12714
|
-
// src/Resolver.ts
|
|
12715
|
-
function isString(value) {
|
|
12716
|
-
return typeof value === "string";
|
|
12717
|
-
}
|
|
12718
|
-
var Resolver = class _Resolver {
|
|
12719
|
-
constructor(binding3) {
|
|
12720
|
-
this.binding = binding3;
|
|
12721
|
-
}
|
|
12722
|
-
resolveSync(context2, path10, request) {
|
|
12723
|
-
return this.binding.resolveSync(path10, request);
|
|
12724
|
-
}
|
|
12725
|
-
resolve(context2, path10, request, resolveContext, callback) {
|
|
12726
|
-
try {
|
|
12727
|
-
const res = this.binding.resolveSync(path10, request);
|
|
12728
|
-
callback(null, res);
|
|
12729
|
-
} catch (err) {
|
|
12730
|
-
callback(err);
|
|
12731
|
-
}
|
|
12732
|
-
}
|
|
12733
|
-
withOptions({
|
|
12734
|
-
dependencyCategory,
|
|
12735
|
-
resolveToContext,
|
|
12736
|
-
...resolve2
|
|
12737
|
-
}) {
|
|
12738
|
-
const rawResolve = getRawResolve(resolve2);
|
|
12739
|
-
if (Array.isArray(rawResolve.restrictions)) {
|
|
12740
|
-
rawResolve.restrictions = rawResolve.restrictions.filter(isString);
|
|
12741
|
-
}
|
|
12742
|
-
const binding3 = this.binding.withOptions({
|
|
12743
|
-
dependencyCategory,
|
|
12744
|
-
resolveToContext,
|
|
12745
|
-
...rawResolve
|
|
12746
|
-
});
|
|
12747
|
-
return new _Resolver(binding3);
|
|
12748
|
-
}
|
|
12749
|
-
};
|
|
12750
|
-
|
|
12751
|
-
// src/ResolverFactory.ts
|
|
12752
13014
|
var ResolverFactory = class {
|
|
12753
13015
|
#binding;
|
|
12754
13016
|
static __to_binding(resolver_factory) {
|
|
@@ -13211,7 +13473,10 @@ var Compiler = class _Compiler {
|
|
|
13211
13473
|
new ExecuteModulePlugin().apply(this);
|
|
13212
13474
|
this.hooks.shutdown.tap("rspack:cleanup", () => {
|
|
13213
13475
|
if (!this.running) {
|
|
13214
|
-
|
|
13476
|
+
process.nextTick(() => {
|
|
13477
|
+
this.#instance = void 0;
|
|
13478
|
+
this.#compilation && (this.#compilation.__internal__shutdown = true);
|
|
13479
|
+
});
|
|
13215
13480
|
}
|
|
13216
13481
|
});
|
|
13217
13482
|
}
|
|
@@ -13652,11 +13917,9 @@ var Compiler = class _Compiler {
|
|
|
13652
13917
|
this.#registers = {
|
|
13653
13918
|
registerCompilerThisCompilationTaps: this.#createHookRegisterTaps(
|
|
13654
13919
|
binding2.RegisterJsTapKind.CompilerThisCompilation,
|
|
13655
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13656
13920
|
function() {
|
|
13657
13921
|
return that.deref().hooks.thisCompilation;
|
|
13658
13922
|
},
|
|
13659
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13660
13923
|
function(queried) {
|
|
13661
13924
|
return function(native) {
|
|
13662
13925
|
that.deref().#createCompilation(native);
|
|
@@ -13669,11 +13932,9 @@ var Compiler = class _Compiler {
|
|
|
13669
13932
|
),
|
|
13670
13933
|
registerCompilerCompilationTaps: this.#createHookRegisterTaps(
|
|
13671
13934
|
binding2.RegisterJsTapKind.CompilerCompilation,
|
|
13672
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13673
13935
|
function() {
|
|
13674
13936
|
return that.deref().hooks.compilation;
|
|
13675
13937
|
},
|
|
13676
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13677
13938
|
function(queried) {
|
|
13678
13939
|
return function() {
|
|
13679
13940
|
return queried.call(
|
|
@@ -13685,11 +13946,9 @@ var Compiler = class _Compiler {
|
|
|
13685
13946
|
),
|
|
13686
13947
|
registerCompilerMakeTaps: this.#createHookRegisterTaps(
|
|
13687
13948
|
binding2.RegisterJsTapKind.CompilerMake,
|
|
13688
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13689
13949
|
function() {
|
|
13690
13950
|
return that.deref().hooks.make;
|
|
13691
13951
|
},
|
|
13692
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13693
13952
|
function(queried) {
|
|
13694
13953
|
return async function() {
|
|
13695
13954
|
return await queried.promise(that.deref().#compilation);
|
|
@@ -13698,11 +13957,9 @@ var Compiler = class _Compiler {
|
|
|
13698
13957
|
),
|
|
13699
13958
|
registerCompilerFinishMakeTaps: this.#createHookRegisterTaps(
|
|
13700
13959
|
binding2.RegisterJsTapKind.CompilerFinishMake,
|
|
13701
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13702
13960
|
function() {
|
|
13703
13961
|
return that.deref().hooks.finishMake;
|
|
13704
13962
|
},
|
|
13705
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13706
13963
|
function(queried) {
|
|
13707
13964
|
return async function() {
|
|
13708
13965
|
return await queried.promise(that.deref().#compilation);
|
|
@@ -13711,11 +13968,9 @@ var Compiler = class _Compiler {
|
|
|
13711
13968
|
),
|
|
13712
13969
|
registerCompilerShouldEmitTaps: this.#createHookRegisterTaps(
|
|
13713
13970
|
binding2.RegisterJsTapKind.CompilerShouldEmit,
|
|
13714
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13715
13971
|
function() {
|
|
13716
13972
|
return that.deref().hooks.shouldEmit;
|
|
13717
13973
|
},
|
|
13718
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13719
13974
|
function(queried) {
|
|
13720
13975
|
return function() {
|
|
13721
13976
|
return queried.call(that.deref().#compilation);
|
|
@@ -13724,11 +13979,9 @@ var Compiler = class _Compiler {
|
|
|
13724
13979
|
),
|
|
13725
13980
|
registerCompilerEmitTaps: this.#createHookRegisterTaps(
|
|
13726
13981
|
binding2.RegisterJsTapKind.CompilerEmit,
|
|
13727
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13728
13982
|
function() {
|
|
13729
13983
|
return that.deref().hooks.emit;
|
|
13730
13984
|
},
|
|
13731
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13732
13985
|
function(queried) {
|
|
13733
13986
|
return async function() {
|
|
13734
13987
|
return await queried.promise(that.deref().#compilation);
|
|
@@ -13737,11 +13990,9 @@ var Compiler = class _Compiler {
|
|
|
13737
13990
|
),
|
|
13738
13991
|
registerCompilerAfterEmitTaps: this.#createHookRegisterTaps(
|
|
13739
13992
|
binding2.RegisterJsTapKind.CompilerAfterEmit,
|
|
13740
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13741
13993
|
function() {
|
|
13742
13994
|
return that.deref().hooks.afterEmit;
|
|
13743
13995
|
},
|
|
13744
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13745
13996
|
function(queried) {
|
|
13746
13997
|
return async function() {
|
|
13747
13998
|
return await queried.promise(that.deref().#compilation);
|
|
@@ -13750,11 +14001,9 @@ var Compiler = class _Compiler {
|
|
|
13750
14001
|
),
|
|
13751
14002
|
registerCompilerAssetEmittedTaps: this.#createHookRegisterTaps(
|
|
13752
14003
|
binding2.RegisterJsTapKind.CompilerAssetEmitted,
|
|
13753
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13754
14004
|
function() {
|
|
13755
14005
|
return that.deref().hooks.assetEmitted;
|
|
13756
14006
|
},
|
|
13757
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13758
14007
|
function(queried) {
|
|
13759
14008
|
return async function({
|
|
13760
14009
|
filename: filename2,
|
|
@@ -13779,11 +14028,9 @@ var Compiler = class _Compiler {
|
|
|
13779
14028
|
),
|
|
13780
14029
|
registerCompilationAdditionalTreeRuntimeRequirements: this.#createHookRegisterTaps(
|
|
13781
14030
|
binding2.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements,
|
|
13782
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13783
14031
|
function() {
|
|
13784
14032
|
return that.deref().#compilation.hooks.additionalTreeRuntimeRequirements;
|
|
13785
14033
|
},
|
|
13786
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13787
14034
|
function(queried) {
|
|
13788
14035
|
return function({
|
|
13789
14036
|
chunk,
|
|
@@ -13802,11 +14049,9 @@ var Compiler = class _Compiler {
|
|
|
13802
14049
|
),
|
|
13803
14050
|
registerCompilationRuntimeRequirementInTree: this.#createHookMapRegisterTaps(
|
|
13804
14051
|
binding2.RegisterJsTapKind.CompilationRuntimeRequirementInTree,
|
|
13805
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13806
14052
|
function() {
|
|
13807
14053
|
return that.deref().#compilation.hooks.runtimeRequirementInTree;
|
|
13808
14054
|
},
|
|
13809
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13810
14055
|
function(queried) {
|
|
13811
14056
|
return function({
|
|
13812
14057
|
chunk: rawChunk,
|
|
@@ -13828,11 +14073,9 @@ var Compiler = class _Compiler {
|
|
|
13828
14073
|
),
|
|
13829
14074
|
registerCompilationRuntimeModuleTaps: this.#createHookRegisterTaps(
|
|
13830
14075
|
binding2.RegisterJsTapKind.CompilationRuntimeModule,
|
|
13831
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13832
14076
|
function() {
|
|
13833
14077
|
return that.deref().#compilation.hooks.runtimeModule;
|
|
13834
14078
|
},
|
|
13835
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13836
14079
|
function(queried) {
|
|
13837
14080
|
return function({ module: module2, chunk }) {
|
|
13838
14081
|
var _a, _b;
|
|
@@ -13851,11 +14094,9 @@ var Compiler = class _Compiler {
|
|
|
13851
14094
|
),
|
|
13852
14095
|
registerCompilationBuildModuleTaps: this.#createHookRegisterTaps(
|
|
13853
14096
|
binding2.RegisterJsTapKind.CompilationBuildModule,
|
|
13854
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13855
14097
|
function() {
|
|
13856
14098
|
return that.deref().#compilation.hooks.buildModule;
|
|
13857
14099
|
},
|
|
13858
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13859
14100
|
function(queried) {
|
|
13860
14101
|
return function(m) {
|
|
13861
14102
|
return queried.call(
|
|
@@ -13866,11 +14107,9 @@ var Compiler = class _Compiler {
|
|
|
13866
14107
|
),
|
|
13867
14108
|
registerCompilationStillValidModuleTaps: this.#createHookRegisterTaps(
|
|
13868
14109
|
binding2.RegisterJsTapKind.CompilationStillValidModule,
|
|
13869
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13870
14110
|
function() {
|
|
13871
14111
|
return that.deref().#compilation.hooks.stillValidModule;
|
|
13872
14112
|
},
|
|
13873
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13874
14113
|
function(queried) {
|
|
13875
14114
|
return function(m) {
|
|
13876
14115
|
return queried.call(
|
|
@@ -13881,11 +14120,9 @@ var Compiler = class _Compiler {
|
|
|
13881
14120
|
),
|
|
13882
14121
|
registerCompilationSucceedModuleTaps: this.#createHookRegisterTaps(
|
|
13883
14122
|
binding2.RegisterJsTapKind.CompilationSucceedModule,
|
|
13884
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13885
14123
|
function() {
|
|
13886
14124
|
return that.deref().#compilation.hooks.succeedModule;
|
|
13887
14125
|
},
|
|
13888
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13889
14126
|
function(queried) {
|
|
13890
14127
|
return function(m) {
|
|
13891
14128
|
return queried.call(
|
|
@@ -13896,11 +14133,9 @@ var Compiler = class _Compiler {
|
|
|
13896
14133
|
),
|
|
13897
14134
|
registerCompilationExecuteModuleTaps: this.#createHookRegisterTaps(
|
|
13898
14135
|
binding2.RegisterJsTapKind.CompilationExecuteModule,
|
|
13899
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13900
14136
|
function() {
|
|
13901
14137
|
return that.deref().#compilation.hooks.executeModule;
|
|
13902
14138
|
},
|
|
13903
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13904
14139
|
function(queried) {
|
|
13905
14140
|
return function({
|
|
13906
14141
|
entry: entry2,
|
|
@@ -13961,11 +14196,9 @@ var Compiler = class _Compiler {
|
|
|
13961
14196
|
),
|
|
13962
14197
|
registerCompilationFinishModulesTaps: this.#createHookRegisterTaps(
|
|
13963
14198
|
binding2.RegisterJsTapKind.CompilationFinishModules,
|
|
13964
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13965
14199
|
function() {
|
|
13966
14200
|
return that.deref().#compilation.hooks.finishModules;
|
|
13967
14201
|
},
|
|
13968
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13969
14202
|
function(queried) {
|
|
13970
14203
|
return async function() {
|
|
13971
14204
|
return await queried.promise(that.deref().#compilation.modules);
|
|
@@ -13974,11 +14207,9 @@ var Compiler = class _Compiler {
|
|
|
13974
14207
|
),
|
|
13975
14208
|
registerCompilationOptimizeModulesTaps: this.#createHookRegisterTaps(
|
|
13976
14209
|
binding2.RegisterJsTapKind.CompilationOptimizeModules,
|
|
13977
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13978
14210
|
function() {
|
|
13979
14211
|
return that.deref().#compilation.hooks.optimizeModules;
|
|
13980
14212
|
},
|
|
13981
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13982
14213
|
function(queried) {
|
|
13983
14214
|
return function() {
|
|
13984
14215
|
return queried.call(that.deref().#compilation.modules.values());
|
|
@@ -13987,11 +14218,9 @@ var Compiler = class _Compiler {
|
|
|
13987
14218
|
),
|
|
13988
14219
|
registerCompilationAfterOptimizeModulesTaps: this.#createHookRegisterTaps(
|
|
13989
14220
|
binding2.RegisterJsTapKind.CompilationAfterOptimizeModules,
|
|
13990
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13991
14221
|
function() {
|
|
13992
14222
|
return that.deref().#compilation.hooks.afterOptimizeModules;
|
|
13993
14223
|
},
|
|
13994
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
13995
14224
|
function(queried) {
|
|
13996
14225
|
return function() {
|
|
13997
14226
|
queried.call(that.deref().#compilation.modules.values());
|
|
@@ -14000,11 +14229,9 @@ var Compiler = class _Compiler {
|
|
|
14000
14229
|
),
|
|
14001
14230
|
registerCompilationOptimizeTreeTaps: this.#createHookRegisterTaps(
|
|
14002
14231
|
binding2.RegisterJsTapKind.CompilationOptimizeTree,
|
|
14003
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14004
14232
|
function() {
|
|
14005
14233
|
return that.deref().#compilation.hooks.optimizeTree;
|
|
14006
14234
|
},
|
|
14007
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14008
14235
|
function(queried) {
|
|
14009
14236
|
return async function() {
|
|
14010
14237
|
return await queried.promise(
|
|
@@ -14016,11 +14243,9 @@ var Compiler = class _Compiler {
|
|
|
14016
14243
|
),
|
|
14017
14244
|
registerCompilationOptimizeChunkModulesTaps: this.#createHookRegisterTaps(
|
|
14018
14245
|
binding2.RegisterJsTapKind.CompilationOptimizeChunkModules,
|
|
14019
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14020
14246
|
function() {
|
|
14021
14247
|
return that.deref().#compilation.hooks.optimizeChunkModules;
|
|
14022
14248
|
},
|
|
14023
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14024
14249
|
function(queried) {
|
|
14025
14250
|
return async function() {
|
|
14026
14251
|
return await queried.promise(
|
|
@@ -14032,11 +14257,9 @@ var Compiler = class _Compiler {
|
|
|
14032
14257
|
),
|
|
14033
14258
|
registerCompilationChunkHashTaps: this.#createHookRegisterTaps(
|
|
14034
14259
|
binding2.RegisterJsTapKind.CompilationChunkHash,
|
|
14035
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14036
14260
|
function() {
|
|
14037
14261
|
return that.deref().#compilation.hooks.chunkHash;
|
|
14038
14262
|
},
|
|
14039
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14040
14263
|
function(queried) {
|
|
14041
14264
|
return function(chunk) {
|
|
14042
14265
|
if (!that.deref().options.output.hashFunction) {
|
|
@@ -14056,11 +14279,9 @@ var Compiler = class _Compiler {
|
|
|
14056
14279
|
),
|
|
14057
14280
|
registerCompilationChunkAssetTaps: this.#createHookRegisterTaps(
|
|
14058
14281
|
binding2.RegisterJsTapKind.CompilationChunkAsset,
|
|
14059
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14060
14282
|
function() {
|
|
14061
14283
|
return that.deref().#compilation.hooks.chunkAsset;
|
|
14062
14284
|
},
|
|
14063
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14064
14285
|
function(queried) {
|
|
14065
14286
|
return function({ chunk, filename: filename2 }) {
|
|
14066
14287
|
return queried.call(
|
|
@@ -14072,11 +14293,9 @@ var Compiler = class _Compiler {
|
|
|
14072
14293
|
),
|
|
14073
14294
|
registerCompilationProcessAssetsTaps: this.#createHookRegisterTaps(
|
|
14074
14295
|
binding2.RegisterJsTapKind.CompilationProcessAssets,
|
|
14075
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14076
14296
|
function() {
|
|
14077
14297
|
return that.deref().#compilation.hooks.processAssets;
|
|
14078
14298
|
},
|
|
14079
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14080
14299
|
function(queried) {
|
|
14081
14300
|
return async function() {
|
|
14082
14301
|
return await queried.promise(that.deref().#compilation.assets);
|
|
@@ -14085,11 +14304,9 @@ var Compiler = class _Compiler {
|
|
|
14085
14304
|
),
|
|
14086
14305
|
registerCompilationAfterProcessAssetsTaps: this.#createHookRegisterTaps(
|
|
14087
14306
|
binding2.RegisterJsTapKind.CompilationAfterProcessAssets,
|
|
14088
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14089
14307
|
function() {
|
|
14090
14308
|
return that.deref().#compilation.hooks.afterProcessAssets;
|
|
14091
14309
|
},
|
|
14092
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14093
14310
|
function(queried) {
|
|
14094
14311
|
return function() {
|
|
14095
14312
|
return queried.call(that.deref().#compilation.assets);
|
|
@@ -14098,11 +14315,9 @@ var Compiler = class _Compiler {
|
|
|
14098
14315
|
),
|
|
14099
14316
|
registerCompilationSealTaps: this.#createHookRegisterTaps(
|
|
14100
14317
|
binding2.RegisterJsTapKind.CompilationSeal,
|
|
14101
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14102
14318
|
function() {
|
|
14103
14319
|
return that.deref().#compilation.hooks.seal;
|
|
14104
14320
|
},
|
|
14105
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14106
14321
|
function(queried) {
|
|
14107
14322
|
return function() {
|
|
14108
14323
|
return queried.call();
|
|
@@ -14111,11 +14326,9 @@ var Compiler = class _Compiler {
|
|
|
14111
14326
|
),
|
|
14112
14327
|
registerCompilationAfterSealTaps: this.#createHookRegisterTaps(
|
|
14113
14328
|
binding2.RegisterJsTapKind.CompilationAfterSeal,
|
|
14114
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14115
14329
|
function() {
|
|
14116
14330
|
return that.deref().#compilation.hooks.afterSeal;
|
|
14117
14331
|
},
|
|
14118
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14119
14332
|
function(queried) {
|
|
14120
14333
|
return async function() {
|
|
14121
14334
|
return await queried.promise();
|
|
@@ -14124,11 +14337,9 @@ var Compiler = class _Compiler {
|
|
|
14124
14337
|
),
|
|
14125
14338
|
registerNormalModuleFactoryBeforeResolveTaps: this.#createHookRegisterTaps(
|
|
14126
14339
|
binding2.RegisterJsTapKind.NormalModuleFactoryBeforeResolve,
|
|
14127
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14128
14340
|
function() {
|
|
14129
14341
|
return that.deref().#compilationParams.normalModuleFactory.hooks.beforeResolve;
|
|
14130
14342
|
},
|
|
14131
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14132
14343
|
function(queried) {
|
|
14133
14344
|
return async function(resolveData) {
|
|
14134
14345
|
const normalizedResolveData = {
|
|
@@ -14150,11 +14361,9 @@ var Compiler = class _Compiler {
|
|
|
14150
14361
|
),
|
|
14151
14362
|
registerNormalModuleFactoryFactorizeTaps: this.#createHookRegisterTaps(
|
|
14152
14363
|
binding2.RegisterJsTapKind.NormalModuleFactoryFactorize,
|
|
14153
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14154
14364
|
function() {
|
|
14155
14365
|
return that.deref().#compilationParams.normalModuleFactory.hooks.factorize;
|
|
14156
14366
|
},
|
|
14157
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14158
14367
|
function(queried) {
|
|
14159
14368
|
return async function(resolveData) {
|
|
14160
14369
|
const normalizedResolveData = {
|
|
@@ -14176,11 +14385,9 @@ var Compiler = class _Compiler {
|
|
|
14176
14385
|
),
|
|
14177
14386
|
registerNormalModuleFactoryResolveTaps: this.#createHookRegisterTaps(
|
|
14178
14387
|
binding2.RegisterJsTapKind.NormalModuleFactoryResolve,
|
|
14179
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14180
14388
|
function() {
|
|
14181
14389
|
return that.deref().#compilationParams.normalModuleFactory.hooks.resolve;
|
|
14182
14390
|
},
|
|
14183
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14184
14391
|
function(queried) {
|
|
14185
14392
|
return async function(resolveData) {
|
|
14186
14393
|
const normalizedResolveData = {
|
|
@@ -14202,11 +14409,9 @@ var Compiler = class _Compiler {
|
|
|
14202
14409
|
),
|
|
14203
14410
|
registerNormalModuleFactoryResolveForSchemeTaps: this.#createHookMapRegisterTaps(
|
|
14204
14411
|
binding2.RegisterJsTapKind.NormalModuleFactoryResolveForScheme,
|
|
14205
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14206
14412
|
function() {
|
|
14207
14413
|
return that.deref().#compilationParams.normalModuleFactory.hooks.resolveForScheme;
|
|
14208
14414
|
},
|
|
14209
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14210
14415
|
function(queried) {
|
|
14211
14416
|
return async function(args) {
|
|
14212
14417
|
const ret = await queried.for(args.scheme).promise(args.resourceData);
|
|
@@ -14216,11 +14421,9 @@ var Compiler = class _Compiler {
|
|
|
14216
14421
|
),
|
|
14217
14422
|
registerNormalModuleFactoryAfterResolveTaps: this.#createHookRegisterTaps(
|
|
14218
14423
|
binding2.RegisterJsTapKind.NormalModuleFactoryAfterResolve,
|
|
14219
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14220
14424
|
function() {
|
|
14221
14425
|
return that.deref().#compilationParams.normalModuleFactory.hooks.afterResolve;
|
|
14222
14426
|
},
|
|
14223
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14224
14427
|
function(queried) {
|
|
14225
14428
|
return async function(arg) {
|
|
14226
14429
|
const data = {
|
|
@@ -14241,11 +14444,9 @@ var Compiler = class _Compiler {
|
|
|
14241
14444
|
),
|
|
14242
14445
|
registerNormalModuleFactoryCreateModuleTaps: this.#createHookRegisterTaps(
|
|
14243
14446
|
binding2.RegisterJsTapKind.NormalModuleFactoryCreateModule,
|
|
14244
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14245
14447
|
function() {
|
|
14246
14448
|
return that.deref().#compilationParams.normalModuleFactory.hooks.createModule;
|
|
14247
14449
|
},
|
|
14248
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14249
14450
|
function(queried) {
|
|
14250
14451
|
return async function(args) {
|
|
14251
14452
|
const data = {
|
|
@@ -14258,11 +14459,9 @@ var Compiler = class _Compiler {
|
|
|
14258
14459
|
),
|
|
14259
14460
|
registerContextModuleFactoryBeforeResolveTaps: this.#createHookRegisterTaps(
|
|
14260
14461
|
binding2.RegisterJsTapKind.ContextModuleFactoryBeforeResolve,
|
|
14261
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14262
14462
|
function() {
|
|
14263
14463
|
return that.deref().#compilationParams.contextModuleFactory.hooks.beforeResolve;
|
|
14264
14464
|
},
|
|
14265
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14266
14465
|
function(queried) {
|
|
14267
14466
|
return async function(bindingData) {
|
|
14268
14467
|
const data = bindingData ? ContextModuleFactoryBeforeResolveData.__from_binding(
|
|
@@ -14275,11 +14474,9 @@ var Compiler = class _Compiler {
|
|
|
14275
14474
|
),
|
|
14276
14475
|
registerContextModuleFactoryAfterResolveTaps: this.#createHookRegisterTaps(
|
|
14277
14476
|
binding2.RegisterJsTapKind.ContextModuleFactoryAfterResolve,
|
|
14278
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14279
14477
|
function() {
|
|
14280
14478
|
return that.deref().#compilationParams.contextModuleFactory.hooks.afterResolve;
|
|
14281
14479
|
},
|
|
14282
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14283
14480
|
function(queried) {
|
|
14284
14481
|
return async function(bindingData) {
|
|
14285
14482
|
const data = bindingData ? ContextModuleFactoryAfterResolveData.__from_binding(
|
|
@@ -14292,13 +14489,11 @@ var Compiler = class _Compiler {
|
|
|
14292
14489
|
),
|
|
14293
14490
|
registerJavascriptModulesChunkHashTaps: this.#createHookRegisterTaps(
|
|
14294
14491
|
binding2.RegisterJsTapKind.JavascriptModulesChunkHash,
|
|
14295
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14296
14492
|
function() {
|
|
14297
14493
|
return JavascriptModulesPlugin.getCompilationHooks(
|
|
14298
14494
|
that.deref().#compilation
|
|
14299
14495
|
).chunkHash;
|
|
14300
14496
|
},
|
|
14301
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14302
14497
|
function(queried) {
|
|
14303
14498
|
return function(chunk) {
|
|
14304
14499
|
if (!that.deref().options.output.hashFunction) {
|
|
@@ -14318,13 +14513,11 @@ var Compiler = class _Compiler {
|
|
|
14318
14513
|
),
|
|
14319
14514
|
registerHtmlPluginBeforeAssetTagGenerationTaps: this.#createHookRegisterTaps(
|
|
14320
14515
|
binding2.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration,
|
|
14321
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14322
14516
|
function() {
|
|
14323
14517
|
return HtmlRspackPlugin.getCompilationHooks(
|
|
14324
14518
|
that.deref().#compilation
|
|
14325
14519
|
).beforeAssetTagGeneration;
|
|
14326
14520
|
},
|
|
14327
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14328
14521
|
function(queried) {
|
|
14329
14522
|
return async function(data) {
|
|
14330
14523
|
return await queried.promise({
|
|
@@ -14340,13 +14533,11 @@ var Compiler = class _Compiler {
|
|
|
14340
14533
|
),
|
|
14341
14534
|
registerHtmlPluginAlterAssetTagsTaps: this.#createHookRegisterTaps(
|
|
14342
14535
|
binding2.RegisterJsTapKind.HtmlPluginAlterAssetTags,
|
|
14343
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14344
14536
|
function() {
|
|
14345
14537
|
return HtmlRspackPlugin.getCompilationHooks(
|
|
14346
14538
|
that.deref().#compilation
|
|
14347
14539
|
).alterAssetTags;
|
|
14348
14540
|
},
|
|
14349
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14350
14541
|
function(queried) {
|
|
14351
14542
|
return async function(data) {
|
|
14352
14543
|
return await queried.promise(data);
|
|
@@ -14355,13 +14546,11 @@ var Compiler = class _Compiler {
|
|
|
14355
14546
|
),
|
|
14356
14547
|
registerHtmlPluginAlterAssetTagGroupsTaps: this.#createHookRegisterTaps(
|
|
14357
14548
|
binding2.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups,
|
|
14358
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14359
14549
|
function() {
|
|
14360
14550
|
return HtmlRspackPlugin.getCompilationHooks(
|
|
14361
14551
|
that.deref().#compilation
|
|
14362
14552
|
).alterAssetTagGroups;
|
|
14363
14553
|
},
|
|
14364
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14365
14554
|
function(queried) {
|
|
14366
14555
|
return async function(data) {
|
|
14367
14556
|
return await queried.promise({
|
|
@@ -14377,13 +14566,11 @@ var Compiler = class _Compiler {
|
|
|
14377
14566
|
),
|
|
14378
14567
|
registerHtmlPluginAfterTemplateExecutionTaps: this.#createHookRegisterTaps(
|
|
14379
14568
|
binding2.RegisterJsTapKind.HtmlPluginAfterTemplateExecution,
|
|
14380
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14381
14569
|
function() {
|
|
14382
14570
|
return HtmlRspackPlugin.getCompilationHooks(
|
|
14383
14571
|
that.deref().#compilation
|
|
14384
14572
|
).afterTemplateExecution;
|
|
14385
14573
|
},
|
|
14386
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14387
14574
|
function(queried) {
|
|
14388
14575
|
return async function(data) {
|
|
14389
14576
|
return await queried.promise({
|
|
@@ -14399,13 +14586,11 @@ var Compiler = class _Compiler {
|
|
|
14399
14586
|
),
|
|
14400
14587
|
registerHtmlPluginBeforeEmitTaps: this.#createHookRegisterTaps(
|
|
14401
14588
|
binding2.RegisterJsTapKind.HtmlPluginBeforeEmit,
|
|
14402
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14403
14589
|
function() {
|
|
14404
14590
|
return HtmlRspackPlugin.getCompilationHooks(
|
|
14405
14591
|
that.deref().#compilation
|
|
14406
14592
|
).beforeEmit;
|
|
14407
14593
|
},
|
|
14408
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14409
14594
|
function(queried) {
|
|
14410
14595
|
return async function(data) {
|
|
14411
14596
|
return await queried.promise({
|
|
@@ -14421,13 +14606,11 @@ var Compiler = class _Compiler {
|
|
|
14421
14606
|
),
|
|
14422
14607
|
registerHtmlPluginAfterEmitTaps: this.#createHookRegisterTaps(
|
|
14423
14608
|
binding2.RegisterJsTapKind.HtmlPluginAfterEmit,
|
|
14424
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14425
14609
|
function() {
|
|
14426
14610
|
return HtmlRspackPlugin.getCompilationHooks(
|
|
14427
14611
|
that.deref().#compilation
|
|
14428
14612
|
).afterEmit;
|
|
14429
14613
|
},
|
|
14430
|
-
// biome-ignore lint/complexity/useArrowFunction: <explanation>
|
|
14431
14614
|
function(queried) {
|
|
14432
14615
|
return async function(data) {
|
|
14433
14616
|
return await queried.promise({
|
|
@@ -14446,7 +14629,8 @@ var Compiler = class _Compiler {
|
|
|
14446
14629
|
rawOptions,
|
|
14447
14630
|
this.#builtinPlugins,
|
|
14448
14631
|
this.#registers,
|
|
14449
|
-
|
|
14632
|
+
ThreadsafeOutputNodeFS.__to_binding(this.outputFileSystem),
|
|
14633
|
+
ThreadsafeIntermediateNodeFS.__to_binding(this.intermediateFileSystem),
|
|
14450
14634
|
ResolverFactory.__to_binding(this.resolverFactory)
|
|
14451
14635
|
);
|
|
14452
14636
|
callback(null, this.#instance);
|
|
@@ -15266,7 +15450,7 @@ _MemoryCachePlugin.PLUGIN_NAME = "MemoryCachePlugin";
|
|
|
15266
15450
|
var MemoryCachePlugin = _MemoryCachePlugin;
|
|
15267
15451
|
|
|
15268
15452
|
// src/stats/DefaultStatsFactoryPlugin.ts
|
|
15269
|
-
var
|
|
15453
|
+
var util4 = __toESM(require("util"));
|
|
15270
15454
|
|
|
15271
15455
|
// src/stats/statsFactoryUtils.ts
|
|
15272
15456
|
var iterateConfig = (config2, options, fn2) => {
|
|
@@ -16131,7 +16315,7 @@ var SIMPLE_EXTRACTORS = {
|
|
|
16131
16315
|
if (depthInCollapsedGroup > 0) depthInCollapsedGroup--;
|
|
16132
16316
|
continue;
|
|
16133
16317
|
}
|
|
16134
|
-
const message = entry2.args && entry2.args.length > 0 ?
|
|
16318
|
+
const message = entry2.args && entry2.args.length > 0 ? util4.format(entry2.args[0], ...entry2.args.slice(1)) : "";
|
|
16135
16319
|
const newEntry = {
|
|
16136
16320
|
type,
|
|
16137
16321
|
message,
|
|
@@ -18920,7 +19104,7 @@ var createConsoleLogger = ({
|
|
|
18920
19104
|
};
|
|
18921
19105
|
|
|
18922
19106
|
// src/node/NodeWatchFileSystem.ts
|
|
18923
|
-
var
|
|
19107
|
+
var import_node_util6 = __toESM(require("util"));
|
|
18924
19108
|
var import_watchpack = __toESM(require("../compiled/watchpack/index.js"));
|
|
18925
19109
|
var NodeWatchFileSystem = class {
|
|
18926
19110
|
constructor(inputFileSystem) {
|
|
@@ -19005,7 +19189,7 @@ var NodeWatchFileSystem = class {
|
|
|
19005
19189
|
this.watcher.pause();
|
|
19006
19190
|
}
|
|
19007
19191
|
},
|
|
19008
|
-
getAggregatedRemovals:
|
|
19192
|
+
getAggregatedRemovals: import_node_util6.default.deprecate(
|
|
19009
19193
|
() => {
|
|
19010
19194
|
var _a, _b, _c;
|
|
19011
19195
|
const items = (_a = this.watcher) == null ? void 0 : _a.aggregatedRemovals;
|
|
@@ -19020,7 +19204,7 @@ var NodeWatchFileSystem = class {
|
|
|
19020
19204
|
"Watcher.getAggregatedRemovals is deprecated in favor of Watcher.getInfo since that's more performant.",
|
|
19021
19205
|
"DEP_WEBPACK_WATCHER_GET_AGGREGATED_REMOVALS"
|
|
19022
19206
|
),
|
|
19023
|
-
getAggregatedChanges:
|
|
19207
|
+
getAggregatedChanges: import_node_util6.default.deprecate(
|
|
19024
19208
|
() => {
|
|
19025
19209
|
var _a, _b, _c;
|
|
19026
19210
|
const items = (_a = this.watcher) == null ? void 0 : _a.aggregatedChanges;
|
|
@@ -19035,14 +19219,14 @@ var NodeWatchFileSystem = class {
|
|
|
19035
19219
|
"Watcher.getAggregatedChanges is deprecated in favor of Watcher.getInfo since that's more performant.",
|
|
19036
19220
|
"DEP_WEBPACK_WATCHER_GET_AGGREGATED_CHANGES"
|
|
19037
19221
|
),
|
|
19038
|
-
getFileTimeInfoEntries:
|
|
19222
|
+
getFileTimeInfoEntries: import_node_util6.default.deprecate(
|
|
19039
19223
|
() => {
|
|
19040
19224
|
return fetchTimeInfo().fileTimeInfoEntries;
|
|
19041
19225
|
},
|
|
19042
19226
|
"Watcher.getFileTimeInfoEntries is deprecated in favor of Watcher.getInfo since that's more performant.",
|
|
19043
19227
|
"DEP_WEBPACK_WATCHER_FILE_TIME_INFO_ENTRIES"
|
|
19044
19228
|
),
|
|
19045
|
-
getContextTimeInfoEntries:
|
|
19229
|
+
getContextTimeInfoEntries: import_node_util6.default.deprecate(
|
|
19046
19230
|
() => {
|
|
19047
19231
|
return fetchTimeInfo().contextTimeInfoEntries;
|
|
19048
19232
|
},
|
|
@@ -19079,7 +19263,7 @@ var NodeWatchFileSystem = class {
|
|
|
19079
19263
|
};
|
|
19080
19264
|
|
|
19081
19265
|
// src/node/nodeConsole.ts
|
|
19082
|
-
var
|
|
19266
|
+
var util6 = __toESM(require("util"));
|
|
19083
19267
|
|
|
19084
19268
|
// src/logging/truncateArgs.ts
|
|
19085
19269
|
var arraySum = (array) => {
|
|
@@ -19179,7 +19363,7 @@ ${prefix}`);
|
|
|
19179
19363
|
if (currentCollapsed > 0) return;
|
|
19180
19364
|
clearStatusMessage();
|
|
19181
19365
|
const str = indent3(
|
|
19182
|
-
|
|
19366
|
+
util6.format(...args),
|
|
19183
19367
|
prefix,
|
|
19184
19368
|
colorPrefix,
|
|
19185
19369
|
colorSuffix
|
|
@@ -19854,7 +20038,7 @@ var config = {
|
|
|
19854
20038
|
getNormalizedWebpackOptions: getNormalizedRspackOptions,
|
|
19855
20039
|
applyWebpackOptionsDefaults: applyRspackOptionsDefaults
|
|
19856
20040
|
};
|
|
19857
|
-
var
|
|
20041
|
+
var util7 = { createHash, cleverMerge: cachedCleverMerge };
|
|
19858
20042
|
var web = {
|
|
19859
20043
|
FetchCompileAsyncWasmPlugin
|
|
19860
20044
|
};
|
|
@@ -19897,7 +20081,7 @@ var experiments2 = {
|
|
|
19897
20081
|
|
|
19898
20082
|
// src/rspack.ts
|
|
19899
20083
|
var import_node_assert9 = __toESM(require("assert"));
|
|
19900
|
-
var
|
|
20084
|
+
var import_node_util7 = __toESM(require("util"));
|
|
19901
20085
|
function createMultiCompiler(options) {
|
|
19902
20086
|
const compilers = options.map(createCompiler);
|
|
19903
20087
|
const compiler = new MultiCompiler(
|
|
@@ -19985,7 +20169,7 @@ function rspack2(options, callback) {
|
|
|
19985
20169
|
} else {
|
|
19986
20170
|
const { compiler, watch: watch2 } = create3();
|
|
19987
20171
|
if (watch2) {
|
|
19988
|
-
|
|
20172
|
+
import_node_util7.default.deprecate(
|
|
19989
20173
|
() => {
|
|
19990
20174
|
},
|
|
19991
20175
|
"A 'callback' argument needs to be provided to the 'rspack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback."
|