@rspack/core 1.2.0 → 1.2.1

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/index.js CHANGED
@@ -821,40 +821,40 @@ var liteTapable = __toESM(require("@rspack/lite-tapable"));
821
821
  // src/Dependency.ts
822
822
  var Dependency = class _Dependency {
823
823
  #inner;
824
- static __from_binding(binding3) {
825
- return new _Dependency(binding3);
824
+ static __from_binding(binding8) {
825
+ return new _Dependency(binding8);
826
826
  }
827
827
  static __to_binding(data) {
828
828
  return data.#inner;
829
829
  }
830
- constructor(binding3) {
831
- this.#inner = binding3;
830
+ constructor(binding8) {
831
+ this.#inner = binding8;
832
832
  Object.defineProperties(this, {
833
833
  type: {
834
834
  enumerable: true,
835
835
  get() {
836
- return binding3.type;
836
+ return binding8.type;
837
837
  }
838
838
  },
839
839
  category: {
840
840
  enumerable: true,
841
841
  get() {
842
- return binding3.category;
842
+ return binding8.category;
843
843
  }
844
844
  },
845
845
  request: {
846
846
  enumerable: true,
847
847
  get() {
848
- return binding3.request;
848
+ return binding8.request;
849
849
  }
850
850
  },
851
851
  critical: {
852
852
  enumerable: true,
853
853
  get() {
854
- return binding3.critical;
854
+ return binding8.critical;
855
855
  },
856
856
  set(val) {
857
- binding3.critical = val;
857
+ binding8.critical = val;
858
858
  }
859
859
  }
860
860
  });
@@ -864,25 +864,25 @@ var Dependency = class _Dependency {
864
864
  // src/DependenciesBlock.ts
865
865
  var DependenciesBlock = class _DependenciesBlock {
866
866
  #binding;
867
- static __from_binding(binding3) {
868
- return new _DependenciesBlock(binding3);
867
+ static __from_binding(binding8) {
868
+ return new _DependenciesBlock(binding8);
869
869
  }
870
870
  static __to_binding(block) {
871
871
  return block.#binding;
872
872
  }
873
- constructor(binding3) {
874
- this.#binding = binding3;
873
+ constructor(binding8) {
874
+ this.#binding = binding8;
875
875
  Object.defineProperties(this, {
876
876
  dependencies: {
877
877
  enumerable: true,
878
878
  get() {
879
- return binding3.dependencies.map((d) => Dependency.__from_binding(d));
879
+ return binding8.dependencies.map((d) => Dependency.__from_binding(d));
880
880
  }
881
881
  },
882
882
  blocks: {
883
883
  enumerable: true,
884
884
  get() {
885
- return binding3.blocks.map((b) => _DependenciesBlock.__from_binding(b));
885
+ return binding8.blocks.map((b) => _DependenciesBlock.__from_binding(b));
886
886
  }
887
887
  }
888
888
  });
@@ -935,49 +935,49 @@ var JsSource = class extends import_webpack_sources.Source {
935
935
  // src/Module.ts
936
936
  var ContextModuleFactoryBeforeResolveData = class _ContextModuleFactoryBeforeResolveData {
937
937
  #inner;
938
- static __from_binding(binding3) {
939
- return new _ContextModuleFactoryBeforeResolveData(binding3);
938
+ static __from_binding(binding8) {
939
+ return new _ContextModuleFactoryBeforeResolveData(binding8);
940
940
  }
941
941
  static __to_binding(data) {
942
942
  return data.#inner;
943
943
  }
944
- constructor(binding3) {
945
- this.#inner = binding3;
944
+ constructor(binding8) {
945
+ this.#inner = binding8;
946
946
  Object.defineProperties(this, {
947
947
  context: {
948
948
  enumerable: true,
949
949
  get() {
950
- return binding3.context;
950
+ return binding8.context;
951
951
  },
952
952
  set(val) {
953
- binding3.context = val;
953
+ binding8.context = val;
954
954
  }
955
955
  },
956
956
  request: {
957
957
  enumerable: true,
958
958
  get() {
959
- return binding3.request;
959
+ return binding8.request;
960
960
  },
961
961
  set(val) {
962
- binding3.request = val;
962
+ binding8.request = val;
963
963
  }
964
964
  },
965
965
  regExp: {
966
966
  enumerable: true,
967
967
  get() {
968
- return binding3.regExp;
968
+ return binding8.regExp;
969
969
  },
970
970
  set(val) {
971
- binding3.regExp = val;
971
+ binding8.regExp = val;
972
972
  }
973
973
  },
974
974
  recursive: {
975
975
  enumerable: true,
976
976
  get() {
977
- return binding3.recursive;
977
+ return binding8.recursive;
978
978
  },
979
979
  set(val) {
980
- binding3.recursive = val;
980
+ binding8.recursive = val;
981
981
  }
982
982
  }
983
983
  });
@@ -985,64 +985,64 @@ var ContextModuleFactoryBeforeResolveData = class _ContextModuleFactoryBeforeRes
985
985
  };
986
986
  var ContextModuleFactoryAfterResolveData = class _ContextModuleFactoryAfterResolveData {
987
987
  #inner;
988
- static __from_binding(binding3) {
989
- return new _ContextModuleFactoryAfterResolveData(binding3);
988
+ static __from_binding(binding8) {
989
+ return new _ContextModuleFactoryAfterResolveData(binding8);
990
990
  }
991
991
  static __to_binding(data) {
992
992
  return data.#inner;
993
993
  }
994
- constructor(binding3) {
995
- this.#inner = binding3;
994
+ constructor(binding8) {
995
+ this.#inner = binding8;
996
996
  Object.defineProperties(this, {
997
997
  resource: {
998
998
  enumerable: true,
999
999
  get() {
1000
- return binding3.resource;
1000
+ return binding8.resource;
1001
1001
  },
1002
1002
  set(val) {
1003
- binding3.resource = val;
1003
+ binding8.resource = val;
1004
1004
  }
1005
1005
  },
1006
1006
  context: {
1007
1007
  enumerable: true,
1008
1008
  get() {
1009
- return binding3.context;
1009
+ return binding8.context;
1010
1010
  },
1011
1011
  set(val) {
1012
- binding3.context = val;
1012
+ binding8.context = val;
1013
1013
  }
1014
1014
  },
1015
1015
  request: {
1016
1016
  enumerable: true,
1017
1017
  get() {
1018
- return binding3.request;
1018
+ return binding8.request;
1019
1019
  },
1020
1020
  set(val) {
1021
- binding3.request = val;
1021
+ binding8.request = val;
1022
1022
  }
1023
1023
  },
1024
1024
  regExp: {
1025
1025
  enumerable: true,
1026
1026
  get() {
1027
- return binding3.regExp;
1027
+ return binding8.regExp;
1028
1028
  },
1029
1029
  set(val) {
1030
- binding3.regExp = val;
1030
+ binding8.regExp = val;
1031
1031
  }
1032
1032
  },
1033
1033
  recursive: {
1034
1034
  enumerable: true,
1035
1035
  get() {
1036
- return binding3.recursive;
1036
+ return binding8.recursive;
1037
1037
  },
1038
1038
  set(val) {
1039
- binding3.recursive = val;
1039
+ binding8.recursive = val;
1040
1040
  }
1041
1041
  },
1042
1042
  dependencies: {
1043
1043
  enumerable: true,
1044
1044
  get() {
1045
- return binding3.dependencies.map(
1045
+ return binding8.dependencies.map(
1046
1046
  (dep) => Dependency.__from_binding(dep)
1047
1047
  );
1048
1048
  }
@@ -1053,13 +1053,13 @@ var ContextModuleFactoryAfterResolveData = class _ContextModuleFactoryAfterResol
1053
1053
  var MODULE_MAPPINGS = /* @__PURE__ */ new WeakMap();
1054
1054
  var Module = class _Module {
1055
1055
  #inner;
1056
- static __from_binding(binding3) {
1057
- let module2 = MODULE_MAPPINGS.get(binding3);
1056
+ static __from_binding(binding8) {
1057
+ let module2 = MODULE_MAPPINGS.get(binding8);
1058
1058
  if (module2) {
1059
1059
  return module2;
1060
1060
  }
1061
- module2 = new _Module(binding3);
1062
- MODULE_MAPPINGS.set(binding3, module2);
1061
+ module2 = new _Module(binding8);
1062
+ MODULE_MAPPINGS.set(binding8, module2);
1063
1063
  return module2;
1064
1064
  }
1065
1065
  static __to_binding(module2) {
@@ -1183,13 +1183,13 @@ var CodeGenerationResult = class {
1183
1183
  var CHUNK_GROUP_MAPPINGS = /* @__PURE__ */ new WeakMap();
1184
1184
  var ChunkGroup = class _ChunkGroup {
1185
1185
  #inner;
1186
- static __from_binding(binding3) {
1187
- let chunkGroup = CHUNK_GROUP_MAPPINGS.get(binding3);
1186
+ static __from_binding(binding8) {
1187
+ let chunkGroup = CHUNK_GROUP_MAPPINGS.get(binding8);
1188
1188
  if (chunkGroup) {
1189
1189
  return chunkGroup;
1190
1190
  }
1191
- chunkGroup = new _ChunkGroup(binding3);
1192
- CHUNK_GROUP_MAPPINGS.set(binding3, chunkGroup);
1191
+ chunkGroup = new _ChunkGroup(binding8);
1192
+ CHUNK_GROUP_MAPPINGS.set(binding8, chunkGroup);
1193
1193
  return chunkGroup;
1194
1194
  }
1195
1195
  constructor(inner) {
@@ -1199,7 +1199,7 @@ var ChunkGroup = class _ChunkGroup {
1199
1199
  enumerable: true,
1200
1200
  get: () => {
1201
1201
  return this.#inner.chunks.map(
1202
- (binding3) => Chunk.__from_binding(binding3)
1202
+ (binding8) => Chunk.__from_binding(binding8)
1203
1203
  );
1204
1204
  }
1205
1205
  },
@@ -1230,7 +1230,7 @@ var ChunkGroup = class _ChunkGroup {
1230
1230
  return this.#inner.getFiles();
1231
1231
  }
1232
1232
  getParents() {
1233
- return this.#inner.getParents().map((binding3) => _ChunkGroup.__from_binding(binding3));
1233
+ return this.#inner.getParents().map((binding8) => _ChunkGroup.__from_binding(binding8));
1234
1234
  }
1235
1235
  isInitial() {
1236
1236
  return this.#inner.isInitial();
@@ -1247,97 +1247,97 @@ var ChunkGroup = class _ChunkGroup {
1247
1247
  var CHUNK_MAPPINGS = /* @__PURE__ */ new WeakMap();
1248
1248
  var Chunk = class _Chunk {
1249
1249
  #inner;
1250
- static __from_binding(binding3) {
1251
- let chunk = CHUNK_MAPPINGS.get(binding3);
1250
+ static __from_binding(binding8) {
1251
+ let chunk = CHUNK_MAPPINGS.get(binding8);
1252
1252
  if (chunk) {
1253
1253
  return chunk;
1254
1254
  }
1255
- chunk = new _Chunk(binding3);
1256
- CHUNK_MAPPINGS.set(binding3, chunk);
1255
+ chunk = new _Chunk(binding8);
1256
+ CHUNK_MAPPINGS.set(binding8, chunk);
1257
1257
  return chunk;
1258
1258
  }
1259
1259
  static __to_binding(chunk) {
1260
1260
  return chunk.#inner;
1261
1261
  }
1262
- constructor(binding3) {
1263
- this.#inner = binding3;
1262
+ constructor(binding8) {
1263
+ this.#inner = binding8;
1264
1264
  Object.defineProperties(this, {
1265
1265
  name: {
1266
1266
  enumerable: true,
1267
1267
  get: () => {
1268
- return binding3.name;
1268
+ return binding8.name;
1269
1269
  }
1270
1270
  },
1271
1271
  id: {
1272
1272
  enumerable: true,
1273
1273
  get: () => {
1274
- return binding3.id;
1274
+ return binding8.id;
1275
1275
  }
1276
1276
  },
1277
1277
  ids: {
1278
1278
  enumerable: true,
1279
1279
  get: () => {
1280
- return binding3.ids;
1280
+ return binding8.ids;
1281
1281
  }
1282
1282
  },
1283
1283
  idNameHints: {
1284
1284
  enumerable: true,
1285
1285
  get: () => {
1286
- return binding3.idNameHints;
1286
+ return binding8.idNameHints;
1287
1287
  }
1288
1288
  },
1289
1289
  filenameTemplate: {
1290
1290
  enumerable: true,
1291
1291
  get: () => {
1292
- return binding3.filenameTemplate;
1292
+ return binding8.filenameTemplate;
1293
1293
  }
1294
1294
  },
1295
1295
  cssFilenameTemplate: {
1296
1296
  enumerable: true,
1297
1297
  get: () => {
1298
- return binding3.cssFilenameTemplate;
1298
+ return binding8.cssFilenameTemplate;
1299
1299
  }
1300
1300
  },
1301
1301
  files: {
1302
1302
  enumerable: true,
1303
1303
  get: () => {
1304
- return new Set(binding3.files);
1304
+ return new Set(binding8.files);
1305
1305
  }
1306
1306
  },
1307
1307
  runtime: {
1308
1308
  enumerable: true,
1309
1309
  get: () => {
1310
- return new Set(binding3.runtime);
1310
+ return new Set(binding8.runtime);
1311
1311
  }
1312
1312
  },
1313
1313
  hash: {
1314
1314
  enumerable: true,
1315
1315
  get: () => {
1316
- return binding3.hash;
1316
+ return binding8.hash;
1317
1317
  }
1318
1318
  },
1319
1319
  contentHash: {
1320
1320
  enumerable: true,
1321
1321
  get: () => {
1322
- return binding3.contentHash;
1322
+ return binding8.contentHash;
1323
1323
  }
1324
1324
  },
1325
1325
  renderedHash: {
1326
1326
  enumerable: true,
1327
1327
  get: () => {
1328
- return binding3.renderedHash;
1328
+ return binding8.renderedHash;
1329
1329
  }
1330
1330
  },
1331
1331
  chunkReason: {
1332
1332
  enumerable: true,
1333
1333
  get: () => {
1334
- return binding3.chunkReason;
1334
+ return binding8.chunkReason;
1335
1335
  }
1336
1336
  },
1337
1337
  auxiliaryFiles: {
1338
1338
  enumerable: true,
1339
1339
  get: () => {
1340
- return new Set(binding3.auxiliaryFiles);
1340
+ return new Set(binding8.auxiliaryFiles);
1341
1341
  }
1342
1342
  }
1343
1343
  });
@@ -1353,7 +1353,7 @@ var Chunk = class _Chunk {
1353
1353
  }
1354
1354
  get groupsIterable() {
1355
1355
  return new Set(
1356
- this.#inner.groups().map((binding3) => ChunkGroup.__from_binding(binding3))
1356
+ this.#inner.groups().map((binding8) => ChunkGroup.__from_binding(binding8))
1357
1357
  );
1358
1358
  }
1359
1359
  getChunkMaps(realHash) {
@@ -1385,17 +1385,17 @@ var Chunk = class _Chunk {
1385
1385
  }
1386
1386
  getAllAsyncChunks() {
1387
1387
  return new Set(
1388
- this.#inner.getAllAsyncChunks().map((binding3) => _Chunk.__from_binding(binding3))
1388
+ this.#inner.getAllAsyncChunks().map((binding8) => _Chunk.__from_binding(binding8))
1389
1389
  );
1390
1390
  }
1391
1391
  getAllInitialChunks() {
1392
1392
  return new Set(
1393
- this.#inner.getAllInitialChunks().map((binding3) => _Chunk.__from_binding(binding3))
1393
+ this.#inner.getAllInitialChunks().map((binding8) => _Chunk.__from_binding(binding8))
1394
1394
  );
1395
1395
  }
1396
1396
  getAllReferencedChunks() {
1397
1397
  return new Set(
1398
- this.#inner.getAllReferencedChunks().map((binding3) => _Chunk.__from_binding(binding3))
1398
+ this.#inner.getAllReferencedChunks().map((binding8) => _Chunk.__from_binding(binding8))
1399
1399
  );
1400
1400
  }
1401
1401
  };
@@ -1403,38 +1403,38 @@ var Chunk = class _Chunk {
1403
1403
  // src/ChunkGraph.ts
1404
1404
  var ChunkGraph = class _ChunkGraph {
1405
1405
  #inner;
1406
- static __from_binding(binding3) {
1407
- return new _ChunkGraph(binding3);
1406
+ static __from_binding(binding8) {
1407
+ return new _ChunkGraph(binding8);
1408
1408
  }
1409
- constructor(binding3) {
1410
- this.#inner = binding3;
1409
+ constructor(binding8) {
1410
+ this.#inner = binding8;
1411
1411
  }
1412
1412
  getChunkModules(chunk) {
1413
- return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1413
+ return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding8) => Module.__from_binding(binding8));
1414
1414
  }
1415
1415
  getChunkModulesIterable(chunk) {
1416
- return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1416
+ return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding8) => Module.__from_binding(binding8));
1417
1417
  }
1418
1418
  getChunkEntryModulesIterable(chunk) {
1419
- return this.#inner.getChunkEntryModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1419
+ return this.#inner.getChunkEntryModules(Chunk.__to_binding(chunk)).map((binding8) => Module.__from_binding(binding8));
1420
1420
  }
1421
1421
  getNumberOfEntryModules(chunk) {
1422
1422
  return this.#inner.getNumberOfEntryModules(Chunk.__to_binding(chunk));
1423
1423
  }
1424
1424
  getChunkEntryDependentChunksIterable(chunk) {
1425
- return this.#inner.getChunkEntryDependentChunksIterable(Chunk.__to_binding(chunk)).map((binding3) => Chunk.__from_binding(binding3));
1425
+ return this.#inner.getChunkEntryDependentChunksIterable(Chunk.__to_binding(chunk)).map((binding8) => Chunk.__from_binding(binding8));
1426
1426
  }
1427
1427
  getChunkModulesIterableBySourceType(chunk, sourceType) {
1428
1428
  return this.#inner.getChunkModulesIterableBySourceType(
1429
1429
  Chunk.__to_binding(chunk),
1430
1430
  sourceType
1431
- ).map((binding3) => Module.__from_binding(binding3));
1431
+ ).map((binding8) => Module.__from_binding(binding8));
1432
1432
  }
1433
1433
  getModuleChunks(module2) {
1434
- return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
1434
+ return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding8) => Chunk.__from_binding(binding8));
1435
1435
  }
1436
1436
  getModuleChunksIterable(module2) {
1437
- return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
1437
+ return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding8) => Chunk.__from_binding(binding8));
1438
1438
  }
1439
1439
  getModuleId(module2) {
1440
1440
  return this.#inner.getModuleId(Module.__to_binding(module2));
@@ -1445,18 +1445,18 @@ var ChunkGraph = class _ChunkGraph {
1445
1445
  var ENTRYPOINT_MAPPINGS = /* @__PURE__ */ new WeakMap();
1446
1446
  var Entrypoint = class _Entrypoint extends ChunkGroup {
1447
1447
  #inner;
1448
- static __from_binding(binding3) {
1449
- let entrypoint = ENTRYPOINT_MAPPINGS.get(binding3);
1448
+ static __from_binding(binding8) {
1449
+ let entrypoint = ENTRYPOINT_MAPPINGS.get(binding8);
1450
1450
  if (entrypoint) {
1451
1451
  return entrypoint;
1452
1452
  }
1453
- entrypoint = new _Entrypoint(binding3);
1454
- ENTRYPOINT_MAPPINGS.set(binding3, entrypoint);
1453
+ entrypoint = new _Entrypoint(binding8);
1454
+ ENTRYPOINT_MAPPINGS.set(binding8, entrypoint);
1455
1455
  return entrypoint;
1456
1456
  }
1457
- constructor(binding3) {
1458
- super(binding3);
1459
- this.#inner = binding3;
1457
+ constructor(binding8) {
1458
+ super(binding8);
1459
+ this.#inner = binding8;
1460
1460
  }
1461
1461
  getRuntimeChunk() {
1462
1462
  const chunkBinding = this.#inner.getRuntimeChunk();
@@ -1480,11 +1480,11 @@ var cutOffLoaderExecution = (stack) => cutOffByFlag(stack, loaderFlag);
1480
1480
  // src/ExportsInfo.ts
1481
1481
  var ExportsInfo = class _ExportsInfo {
1482
1482
  #inner;
1483
- static __from_binding(binding3) {
1484
- return new _ExportsInfo(binding3);
1483
+ static __from_binding(binding8) {
1484
+ return new _ExportsInfo(binding8);
1485
1485
  }
1486
- constructor(binding3) {
1487
- this.#inner = binding3;
1486
+ constructor(binding8) {
1487
+ this.#inner = binding8;
1488
1488
  }
1489
1489
  isUsed(runtime) {
1490
1490
  return this.#inner.isUsed(runtime);
@@ -1504,31 +1504,31 @@ var ExportsInfo = class _ExportsInfo {
1504
1504
  var MODULE_GRAPH_CONNECTION_MAPPINGS = /* @__PURE__ */ new WeakMap();
1505
1505
  var ModuleGraphConnection = class _ModuleGraphConnection {
1506
1506
  #inner;
1507
- static __from_binding(binding3) {
1508
- let connection = MODULE_GRAPH_CONNECTION_MAPPINGS.get(binding3);
1507
+ static __from_binding(binding8) {
1508
+ let connection = MODULE_GRAPH_CONNECTION_MAPPINGS.get(binding8);
1509
1509
  if (connection) {
1510
1510
  return connection;
1511
1511
  }
1512
- connection = new _ModuleGraphConnection(binding3);
1513
- MODULE_GRAPH_CONNECTION_MAPPINGS.set(binding3, connection);
1512
+ connection = new _ModuleGraphConnection(binding8);
1513
+ MODULE_GRAPH_CONNECTION_MAPPINGS.set(binding8, connection);
1514
1514
  return connection;
1515
1515
  }
1516
1516
  static __to_binding(data) {
1517
1517
  return data.#inner;
1518
1518
  }
1519
- constructor(binding3) {
1520
- this.#inner = binding3;
1519
+ constructor(binding8) {
1520
+ this.#inner = binding8;
1521
1521
  Object.defineProperties(this, {
1522
1522
  module: {
1523
1523
  enumerable: true,
1524
1524
  get() {
1525
- return binding3.module ? Module.__from_binding(binding3.module) : null;
1525
+ return binding8.module ? Module.__from_binding(binding8.module) : null;
1526
1526
  }
1527
1527
  },
1528
1528
  dependency: {
1529
1529
  enumerable: true,
1530
1530
  get() {
1531
- return Dependency.__from_binding(binding3.dependency);
1531
+ return Dependency.__from_binding(binding8.dependency);
1532
1532
  }
1533
1533
  }
1534
1534
  });
@@ -1537,26 +1537,26 @@ var ModuleGraphConnection = class _ModuleGraphConnection {
1537
1537
 
1538
1538
  // src/ModuleGraph.ts
1539
1539
  var ModuleGraph = class _ModuleGraph {
1540
- static __from_binding(binding3) {
1541
- return new _ModuleGraph(binding3);
1540
+ static __from_binding(binding8) {
1541
+ return new _ModuleGraph(binding8);
1542
1542
  }
1543
1543
  #inner;
1544
- constructor(binding3) {
1545
- this.#inner = binding3;
1544
+ constructor(binding8) {
1545
+ this.#inner = binding8;
1546
1546
  }
1547
1547
  getModule(dependency) {
1548
- const binding3 = this.#inner.getModule(Dependency.__to_binding(dependency));
1549
- return binding3 ? Module.__from_binding(binding3) : null;
1548
+ const binding8 = this.#inner.getModule(Dependency.__to_binding(dependency));
1549
+ return binding8 ? Module.__from_binding(binding8) : null;
1550
1550
  }
1551
1551
  getResolvedModule(dependency) {
1552
- const binding3 = this.#inner.getResolvedModule(
1552
+ const binding8 = this.#inner.getResolvedModule(
1553
1553
  Dependency.__to_binding(dependency)
1554
1554
  );
1555
- return binding3 ? Module.__from_binding(binding3) : null;
1555
+ return binding8 ? Module.__from_binding(binding8) : null;
1556
1556
  }
1557
1557
  getIssuer(module2) {
1558
- const binding3 = this.#inner.getIssuer(Module.__to_binding(module2));
1559
- return binding3 ? Module.__from_binding(binding3) : null;
1558
+ const binding8 = this.#inner.getIssuer(Module.__to_binding(module2));
1559
+ return binding8 ? Module.__from_binding(binding8) : null;
1560
1560
  }
1561
1561
  getExportsInfo(module2) {
1562
1562
  return ExportsInfo.__from_binding(
@@ -1564,13 +1564,13 @@ var ModuleGraph = class _ModuleGraph {
1564
1564
  );
1565
1565
  }
1566
1566
  getConnection(dependency) {
1567
- const binding3 = this.#inner.getConnection(
1567
+ const binding8 = this.#inner.getConnection(
1568
1568
  Dependency.__to_binding(dependency)
1569
1569
  );
1570
- return binding3 ? ModuleGraphConnection.__from_binding(binding3) : null;
1570
+ return binding8 ? ModuleGraphConnection.__from_binding(binding8) : null;
1571
1571
  }
1572
1572
  getOutgoingConnections(module2) {
1573
- return this.#inner.getOutgoingConnections(Module.__to_binding(module2)).map((binding3) => ModuleGraphConnection.__from_binding(binding3));
1573
+ return this.#inner.getOutgoingConnections(Module.__to_binding(module2)).map((binding8) => ModuleGraphConnection.__from_binding(binding8));
1574
1574
  }
1575
1575
  };
1576
1576
 
@@ -3057,7 +3057,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3057
3057
  }
3058
3058
  get chunkGroups() {
3059
3059
  return memoizeValue(
3060
- () => __privateGet(this, _inner).chunkGroups.map((binding3) => ChunkGroup.__from_binding(binding3))
3060
+ () => __privateGet(this, _inner).chunkGroups.map((binding8) => ChunkGroup.__from_binding(binding8))
3061
3061
  );
3062
3062
  }
3063
3063
  /**
@@ -3073,8 +3073,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3073
3073
  },
3074
3074
  get: (property) => {
3075
3075
  if (typeof property === "string") {
3076
- const binding3 = __privateGet(this, _inner).getNamedChunkGroup(property);
3077
- return ChunkGroup.__from_binding(binding3);
3076
+ const binding8 = __privateGet(this, _inner).getNamedChunkGroup(property);
3077
+ return ChunkGroup.__from_binding(binding8);
3078
3078
  }
3079
3079
  }
3080
3080
  });
@@ -3105,8 +3105,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3105
3105
  },
3106
3106
  get: (property) => {
3107
3107
  if (typeof property === "string") {
3108
- const binding3 = __privateGet(this, _inner).getNamedChunk(property);
3109
- return Chunk.__from_binding(binding3);
3108
+ const binding8 = __privateGet(this, _inner).getNamedChunk(property);
3109
+ return Chunk.__from_binding(binding8);
3110
3110
  }
3111
3111
  }
3112
3112
  });
@@ -3643,7 +3643,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3643
3643
  * @internal
3644
3644
  */
3645
3645
  __internal__getChunks() {
3646
- return __privateGet(this, _inner).getChunks().map((binding3) => Chunk.__from_binding(binding3));
3646
+ return __privateGet(this, _inner).getChunks().map((binding8) => Chunk.__from_binding(binding8));
3647
3647
  }
3648
3648
  /**
3649
3649
  * Note: This is not a webpack public API, maybe removed in future.
@@ -3761,8 +3761,8 @@ var AddIncludeDispatcher = class {
3761
3761
  }
3762
3762
  });
3763
3763
  };
3764
- constructor(binding3) {
3765
- this.#inner = binding3;
3764
+ constructor(binding8) {
3765
+ this.#inner = binding8;
3766
3766
  this.#running = false;
3767
3767
  }
3768
3768
  call(context2, dependency, options, callback) {
@@ -3774,15 +3774,15 @@ var AddIncludeDispatcher = class {
3774
3774
  }
3775
3775
  };
3776
3776
  var EntryData = class _EntryData {
3777
- static __from_binding(binding3) {
3778
- return new _EntryData(binding3);
3777
+ static __from_binding(binding8) {
3778
+ return new _EntryData(binding8);
3779
3779
  }
3780
- constructor(binding3) {
3781
- this.dependencies = binding3.dependencies.map(Dependency.__from_binding);
3782
- this.includeDependencies = binding3.includeDependencies.map(
3780
+ constructor(binding8) {
3781
+ this.dependencies = binding8.dependencies.map(Dependency.__from_binding);
3782
+ this.includeDependencies = binding8.includeDependencies.map(
3783
3783
  Dependency.__from_binding
3784
3784
  );
3785
- this.options = binding3.options;
3785
+ this.options = binding8.options;
3786
3786
  }
3787
3787
  };
3788
3788
  var Entries = class {
@@ -3794,8 +3794,8 @@ var Entries = class {
3794
3794
  this.#data.clear();
3795
3795
  }
3796
3796
  forEach(callback, thisArg) {
3797
- for (const [key, binding3] of this) {
3798
- const value = EntryData.__from_binding(binding3);
3797
+ for (const [key, binding8] of this) {
3798
+ const value = EntryData.__from_binding(binding8);
3799
3799
  callback.call(thisArg, value, key, this);
3800
3800
  }
3801
3801
  }
@@ -3827,8 +3827,8 @@ var Entries = class {
3827
3827
  return this.#data.delete(key);
3828
3828
  }
3829
3829
  get(key) {
3830
- const binding3 = this.#data.get(key);
3831
- return binding3 ? EntryData.__from_binding(binding3) : void 0;
3830
+ const binding8 = this.#data.get(key);
3831
+ return binding8 ? EntryData.__from_binding(binding8) : void 0;
3832
3832
  }
3833
3833
  keys() {
3834
3834
  return this.#data.keys()[Symbol.iterator]();
@@ -3836,7 +3836,6 @@ var Entries = class {
3836
3836
  };
3837
3837
 
3838
3838
  // src/Compiler.ts
3839
- var binding2 = __toESM(require("@rspack/binding"));
3840
3839
  var liteTapable7 = __toESM(require("@rspack/lite-tapable"));
3841
3840
 
3842
3841
  // src/ExecuteModulePlugin.ts
@@ -4859,395 +4858,52 @@ var CacheFacade = class _CacheFacade {
4859
4858
  };
4860
4859
  var CacheFacade_default = CacheFacade;
4861
4860
 
4862
- // src/RuntimeGlobals.ts
4863
- var REVERSE_RUNTIME_GLOBALS = /* @__PURE__ */ new Map();
4864
- function __from_binding_runtime_globals(runtimeRequirements) {
4865
- const res = /* @__PURE__ */ new Set();
4866
- for (const flag of runtimeRequirements.value) {
4867
- if (flag in RuntimeGlobals) {
4868
- res.add(RuntimeGlobals[flag]);
4869
- } else {
4870
- res.add(flag);
4871
- }
4861
+ // src/builtin-plugin/base.ts
4862
+ var HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
4863
+ "make",
4864
+ "compile",
4865
+ "emit",
4866
+ "afterEmit",
4867
+ "invalid",
4868
+ "done",
4869
+ "thisCompilation"
4870
+ ];
4871
+ function canInherentFromParent(affectedHooks) {
4872
+ if (typeof affectedHooks === "undefined") {
4873
+ return false;
4872
4874
  }
4873
- return res;
4875
+ return !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
4874
4876
  }
4875
- function __to_binding_runtime_globals(runtimeRequirements) {
4876
- const res = {
4877
- value: []
4877
+ var RspackBuiltinPlugin = class {
4878
+ apply(compiler) {
4879
+ const raw = this.raw(compiler);
4880
+ if (raw) {
4881
+ raw.canInherentFromParent = canInherentFromParent(this.affectedHooks);
4882
+ compiler.__internal__registerBuiltinPlugin(raw);
4883
+ }
4884
+ }
4885
+ };
4886
+ function createBuiltinPlugin(name2, options) {
4887
+ return {
4888
+ name: name2,
4889
+ options: options ?? false
4890
+ // undefined or null will cause napi error, so false for fallback
4878
4891
  };
4879
- for (const flag of Array.from(runtimeRequirements)) {
4880
- const item = REVERSE_RUNTIME_GLOBALS.get(flag);
4881
- if (typeof item === "string") {
4882
- res.value.push(item);
4883
- } else {
4884
- res.value.push(flag);
4892
+ }
4893
+ function create2(name2, resolve2, affectedHooks) {
4894
+ class Plugin extends RspackBuiltinPlugin {
4895
+ constructor(...args) {
4896
+ super();
4897
+ this.name = name2;
4898
+ this.affectedHooks = affectedHooks;
4899
+ this._args = args;
4900
+ }
4901
+ raw(compiler) {
4902
+ return createBuiltinPlugin(name2, resolve2.apply(compiler, this._args));
4885
4903
  }
4886
4904
  }
4887
- return res;
4888
- }
4889
- var RuntimeGlobals = {
4890
- /**
4891
- * the internal require function
4892
- */
4893
- require: "__webpack_require__",
4894
- /**
4895
- * access to properties of the internal require function/object
4896
- */
4897
- requireScope: "__webpack_require__.*",
4898
- /**
4899
- * the internal exports object
4900
- */
4901
- exports: "__webpack_exports__",
4902
- /**
4903
- * top-level this need to be the exports object
4904
- */
4905
- thisAsExports: "top-level-this-exports",
4906
- /**
4907
- * runtime need to return the exports of the last entry module
4908
- */
4909
- returnExportsFromRuntime: "return-exports-from-runtime",
4910
- /**
4911
- * the internal module object
4912
- */
4913
- module: "module",
4914
- /**
4915
- * the internal module object
4916
- */
4917
- moduleId: "module.id",
4918
- /**
4919
- * the internal module object
4920
- */
4921
- moduleLoaded: "module.loaded",
4922
- /**
4923
- * the bundle public path
4924
- */
4925
- publicPath: "__webpack_require__.p",
4926
- /**
4927
- * the module id of the entry point
4928
- */
4929
- entryModuleId: "__webpack_require__.s",
4930
- /**
4931
- * the module cache
4932
- */
4933
- moduleCache: "__webpack_require__.c",
4934
- /**
4935
- * the module functions
4936
- */
4937
- moduleFactories: "__webpack_require__.m",
4938
- /**
4939
- * the module functions, with only write access
4940
- */
4941
- moduleFactoriesAddOnly: "__webpack_require__.m (add only)",
4942
- /**
4943
- * the chunk ensure function
4944
- */
4945
- ensureChunk: "__webpack_require__.e",
4946
- /**
4947
- * an object with handlers to ensure a chunk
4948
- */
4949
- ensureChunkHandlers: "__webpack_require__.f",
4950
- /**
4951
- * a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
4952
- */
4953
- ensureChunkIncludeEntries: "__webpack_require__.f (include entries)",
4954
- /**
4955
- * the chunk prefetch function
4956
- */
4957
- prefetchChunk: "__webpack_require__.E",
4958
- /**
4959
- * an object with handlers to prefetch a chunk
4960
- */
4961
- prefetchChunkHandlers: "__webpack_require__.F",
4962
- /**
4963
- * the chunk preload function
4964
- */
4965
- preloadChunk: "__webpack_require__.G",
4966
- /**
4967
- * an object with handlers to preload a chunk
4968
- */
4969
- preloadChunkHandlers: "__webpack_require__.H",
4970
- /**
4971
- * the exported property define getters function
4972
- */
4973
- definePropertyGetters: "__webpack_require__.d",
4974
- /**
4975
- * define compatibility on export
4976
- */
4977
- makeNamespaceObject: "__webpack_require__.r",
4978
- /**
4979
- * create a fake namespace object
4980
- */
4981
- createFakeNamespaceObject: "__webpack_require__.t",
4982
- /**
4983
- * compatibility get default export
4984
- */
4985
- compatGetDefaultExport: "__webpack_require__.n",
4986
- /**
4987
- * ES modules decorator
4988
- */
4989
- harmonyModuleDecorator: "__webpack_require__.hmd",
4990
- /**
4991
- * node.js module decorator
4992
- */
4993
- nodeModuleDecorator: "__webpack_require__.nmd",
4994
- /**
4995
- * the webpack hash
4996
- */
4997
- getFullHash: "__webpack_require__.h",
4998
- /**
4999
- * an object containing all installed WebAssembly.Instance export objects keyed by module id
5000
- */
5001
- wasmInstances: "__webpack_require__.w",
5002
- /**
5003
- * instantiate a wasm instance from module exports object, id, hash and importsObject
5004
- */
5005
- instantiateWasm: "__webpack_require__.v",
5006
- /**
5007
- * the uncaught error handler for the webpack runtime
5008
- */
5009
- uncaughtErrorHandler: "__webpack_require__.oe",
5010
- /**
5011
- * the script nonce
5012
- */
5013
- scriptNonce: "__webpack_require__.nc",
5014
- /**
5015
- * function to load a script tag.
5016
- * Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
5017
- * done function is called when loading has finished or timeout occurred.
5018
- * It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
5019
- */
5020
- loadScript: "__webpack_require__.l",
5021
- /**
5022
- * function to promote a string to a TrustedScript using webpack's Trusted
5023
- * Types policy
5024
- * Arguments: (script: string) =\> TrustedScript
5025
- */
5026
- createScript: "__webpack_require__.ts",
5027
- /**
5028
- * function to promote a string to a TrustedScriptURL using webpack's Trusted
5029
- * Types policy
5030
- * Arguments: (url: string) =\> TrustedScriptURL
5031
- */
5032
- createScriptUrl: "__webpack_require__.tu",
5033
- /**
5034
- * function to return webpack's Trusted Types policy
5035
- * Arguments: () =\> TrustedTypePolicy
5036
- */
5037
- getTrustedTypesPolicy: "__webpack_require__.tt",
5038
- /**
5039
- * a flag when a chunk has a fetch priority
5040
- */
5041
- hasFetchPriority: "has fetch priority",
5042
- /**
5043
- * the chunk name of the chunk with the runtime
5044
- */
5045
- chunkName: "__webpack_require__.cn",
5046
- /**
5047
- * the runtime id of the current runtime
5048
- */
5049
- runtimeId: "__webpack_require__.j",
5050
- /**
5051
- * the filename of the script part of the chunk
5052
- */
5053
- getChunkScriptFilename: "__webpack_require__.u",
5054
- /**
5055
- * the filename of the css part of the chunk
5056
- */
5057
- getChunkCssFilename: "__webpack_require__.k",
5058
- /**
5059
- * a flag when a module/chunk/tree has css modules
5060
- */
5061
- hasCssModules: "has css modules",
5062
- /**
5063
- * the filename of the script part of the hot update chunk
5064
- */
5065
- getChunkUpdateScriptFilename: "__webpack_require__.hu",
5066
- /**
5067
- * the filename of the css part of the hot update chunk
5068
- */
5069
- getChunkUpdateCssFilename: "__webpack_require__.hk",
5070
- /**
5071
- * startup signal from runtime
5072
- * This will be called when the runtime chunk has been loaded.
5073
- */
5074
- startup: "__webpack_require__.x",
5075
- /**
5076
- * @deprecated
5077
- * creating a default startup function with the entry modules
5078
- */
5079
- startupNoDefault: "__webpack_require__.x (no default handler)",
5080
- /**
5081
- * startup signal from runtime but only used to add logic after the startup
5082
- */
5083
- startupOnlyAfter: "__webpack_require__.x (only after)",
5084
- /**
5085
- * startup signal from runtime but only used to add sync logic before the startup
5086
- */
5087
- startupOnlyBefore: "__webpack_require__.x (only before)",
5088
- /**
5089
- * global callback functions for installing chunks
5090
- */
5091
- chunkCallback: "webpackChunk",
5092
- /**
5093
- * method to startup an entrypoint with needed chunks.
5094
- * Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
5095
- * Returns the exports of the module or a Promise
5096
- */
5097
- startupEntrypoint: "__webpack_require__.X",
5098
- /**
5099
- * register deferred code, which will run when certain
5100
- * chunks are loaded.
5101
- * Signature: (chunkIds: Id[], fn: () =\> any, priority: int \>= 0 = 0) =\> any
5102
- * Returned value will be returned directly when all chunks are already loaded
5103
- * When (priority & 1) it will wait for all other handlers with lower priority to
5104
- * be executed before itself is executed
5105
- */
5106
- onChunksLoaded: "__webpack_require__.O",
5107
- /**
5108
- * method to install a chunk that was loaded somehow
5109
- * Signature: (\{ id, ids, modules, runtime \}) =\> void
5110
- */
5111
- externalInstallChunk: "__webpack_require__.C",
5112
- /**
5113
- * interceptor for module executions
5114
- */
5115
- interceptModuleExecution: "__webpack_require__.i",
5116
- /**
5117
- * the global object
5118
- */
5119
- global: "__webpack_require__.g",
5120
- /**
5121
- * an object with all share scopes
5122
- */
5123
- shareScopeMap: "__webpack_require__.S",
5124
- /**
5125
- * The sharing init sequence function (only runs once per share scope).
5126
- * Has one argument, the name of the share scope.
5127
- * Creates a share scope if not existing
5128
- */
5129
- initializeSharing: "__webpack_require__.I",
5130
- /**
5131
- * The current scope when getting a module from a remote
5132
- */
5133
- currentRemoteGetScope: "__webpack_require__.R",
5134
- /**
5135
- * the filename of the HMR manifest
5136
- */
5137
- getUpdateManifestFilename: "__webpack_require__.hmrF",
5138
- /**
5139
- * function downloading the update manifest
5140
- */
5141
- hmrDownloadManifest: "__webpack_require__.hmrM",
5142
- /**
5143
- * array with handler functions to download chunk updates
5144
- */
5145
- hmrDownloadUpdateHandlers: "__webpack_require__.hmrC",
5146
- /**
5147
- * object with all hmr module data for all modules
5148
- */
5149
- hmrModuleData: "__webpack_require__.hmrD",
5150
- /**
5151
- * array with handler functions when a module should be invalidated
5152
- */
5153
- hmrInvalidateModuleHandlers: "__webpack_require__.hmrI",
5154
- /**
5155
- * the prefix for storing state of runtime modules when hmr is enabled
5156
- */
5157
- hmrRuntimeStatePrefix: "__webpack_require__.hmrS",
5158
- /**
5159
- * the AMD define function
5160
- */
5161
- amdDefine: "__webpack_require__.amdD",
5162
- /**
5163
- * the AMD options
5164
- */
5165
- amdOptions: "__webpack_require__.amdO",
5166
- /**
5167
- * the System polyfill object
5168
- */
5169
- system: "__webpack_require__.System",
5170
- /**
5171
- * the shorthand for Object.prototype.hasOwnProperty
5172
- * using of it decreases the compiled bundle size
5173
- */
5174
- hasOwnProperty: "__webpack_require__.o",
5175
- /**
5176
- * the System.register context object
5177
- */
5178
- systemContext: "__webpack_require__.y",
5179
- /**
5180
- * the baseURI of current document
5181
- */
5182
- baseURI: "__webpack_require__.b",
5183
- /**
5184
- * a RelativeURL class when relative URLs are used
5185
- */
5186
- relativeUrl: "__webpack_require__.U",
5187
- /**
5188
- * Creates an async module. The body function must be a async function.
5189
- * "module.exports" will be decorated with an AsyncModulePromise.
5190
- * The body function will be called.
5191
- * To handle async dependencies correctly do this: "([a, b, c] = await handleDependencies([a, b, c]));".
5192
- * If "hasAwaitAfterDependencies" is truthy, "handleDependencies()" must be called at the end of the body function.
5193
- * Signature: function(
5194
- * module: Module,
5195
- * body: (handleDependencies: (deps: AsyncModulePromise[]) =\> Promise\<any[]\> & () =\> void,
5196
- * hasAwaitAfterDependencies?: boolean
5197
- * ) =\> void
5198
- */
5199
- asyncModule: "__webpack_require__.a"
5200
- };
5201
- for (const entry2 of Object.entries(RuntimeGlobals)) {
5202
- REVERSE_RUNTIME_GLOBALS.set(entry2[1], entry2[0]);
5203
- }
5204
-
5205
- // src/builtin-plugin/base.ts
5206
- var HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
5207
- "make",
5208
- "compile",
5209
- "emit",
5210
- "afterEmit",
5211
- "invalid",
5212
- "done",
5213
- "thisCompilation"
5214
- ];
5215
- function canInherentFromParent(affectedHooks) {
5216
- if (typeof affectedHooks === "undefined") {
5217
- return false;
5218
- }
5219
- return !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
5220
- }
5221
- var RspackBuiltinPlugin = class {
5222
- apply(compiler) {
5223
- const raw = this.raw(compiler);
5224
- if (raw) {
5225
- raw.canInherentFromParent = canInherentFromParent(this.affectedHooks);
5226
- compiler.__internal__registerBuiltinPlugin(raw);
5227
- }
5228
- }
5229
- };
5230
- function createBuiltinPlugin(name2, options) {
5231
- return {
5232
- name: name2,
5233
- options: options ?? false
5234
- // undefined or null will cause napi error, so false for fallback
5235
- };
5236
- }
5237
- function create2(name2, resolve2, affectedHooks) {
5238
- class Plugin extends RspackBuiltinPlugin {
5239
- constructor(...args) {
5240
- super();
5241
- this.name = name2;
5242
- this.affectedHooks = affectedHooks;
5243
- this._args = args;
5244
- }
5245
- raw(compiler) {
5246
- return createBuiltinPlugin(name2, resolve2.apply(compiler, this._args));
5247
- }
5248
- }
5249
- Object.defineProperty(Plugin, "name", { value: name2 });
5250
- return Plugin;
4905
+ Object.defineProperty(Plugin, "name", { value: name2 });
4906
+ return Plugin;
5251
4907
  }
5252
4908
 
5253
4909
  // src/builtin-plugin/APIPlugin.ts
@@ -9488,7 +9144,7 @@ var getResolveDefaults = ({
9488
9144
  });
9489
9145
  const resolveOptions2 = {
9490
9146
  // enable pnp only in pnp environment, see https://yarnpkg.com/advanced/pnpapi#processversionspnp
9491
- // IGNORE(resolve.pnp): Rspack use `resolve.enable` to enable yarn pnp feature
9147
+ // IGNORE(resolve.pnp): Rspack use `resolve.enable` to enable Yarn PnP feature
9492
9148
  pnp: !!process.versions.pnp,
9493
9149
  modules: ["node_modules"],
9494
9150
  conditionNames: conditions,
@@ -11079,8 +10735,8 @@ function isString(value) {
11079
10735
  return typeof value === "string";
11080
10736
  }
11081
10737
  var Resolver = class _Resolver {
11082
- constructor(binding3) {
11083
- this.binding = binding3;
10738
+ constructor(binding8) {
10739
+ this.binding = binding8;
11084
10740
  }
11085
10741
  resolveSync(context2, path11, request) {
11086
10742
  return this.binding.resolveSync(path11, request);
@@ -11102,12 +10758,12 @@ var Resolver = class _Resolver {
11102
10758
  if (Array.isArray(rawResolve.restrictions)) {
11103
10759
  rawResolve.restrictions = rawResolve.restrictions.filter(isString);
11104
10760
  }
11105
- const binding3 = this.binding.withOptions({
10761
+ const binding8 = this.binding.withOptions({
11106
10762
  dependencyCategory,
11107
10763
  resolveToContext,
11108
10764
  ...rawResolve
11109
10765
  });
11110
- return new _Resolver(binding3);
10766
+ return new _Resolver(binding8);
11111
10767
  }
11112
10768
  };
11113
10769
 
@@ -11300,11 +10956,43 @@ var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
11300
10956
  }
11301
10957
  };
11302
10958
 
11303
- // src/builtin-plugin/HtmlRspackPlugin.ts
10959
+ // src/builtin-plugin/html-plugin/plugin.ts
11304
10960
  var import_node_fs2 = __toESM(require("fs"));
11305
10961
  var import_node_path9 = __toESM(require("path"));
11306
10962
  var import_binding33 = require("@rspack/binding");
10963
+
10964
+ // src/builtin-plugin/html-plugin/hooks.ts
11307
10965
  var liteTapable3 = __toESM(require("@rspack/lite-tapable"));
10966
+ var compilationHooksMap2 = /* @__PURE__ */ new WeakMap();
10967
+ var getPluginHooks = (compilation) => {
10968
+ if (!(compilation instanceof Compilation)) {
10969
+ throw new TypeError(
10970
+ "The 'compilation' argument must be an instance of Compilation"
10971
+ );
10972
+ }
10973
+ let hooks = compilationHooksMap2.get(compilation);
10974
+ if (hooks === void 0) {
10975
+ hooks = {
10976
+ beforeAssetTagGeneration: new liteTapable3.AsyncSeriesWaterfallHook([
10977
+ "data"
10978
+ ]),
10979
+ alterAssetTags: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
10980
+ alterAssetTagGroups: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
10981
+ afterTemplateExecution: new liteTapable3.AsyncSeriesWaterfallHook([
10982
+ "data"
10983
+ ]),
10984
+ beforeEmit: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
10985
+ afterEmit: new liteTapable3.AsyncSeriesWaterfallHook(["data"])
10986
+ };
10987
+ compilationHooksMap2.set(compilation, hooks);
10988
+ }
10989
+ return hooks;
10990
+ };
10991
+ var cleanPluginHooks = (compilation) => {
10992
+ compilationHooksMap2.delete(compilation);
10993
+ };
10994
+
10995
+ // src/builtin-plugin/html-plugin/options.ts
11308
10996
  var import_zod3 = require("../compiled/zod/index.js");
11309
10997
 
11310
10998
  // ../../node_modules/.pnpm/zod-validation-error@3.4.0_zod@3.23.8/node_modules/zod-validation-error/dist/index.mjs
@@ -11555,7 +11243,8 @@ function isValidate(opts, schema) {
11555
11243
  }
11556
11244
  }
11557
11245
 
11558
- // src/builtin-plugin/HtmlRspackPlugin.ts
11246
+ // src/builtin-plugin/html-plugin/options.ts
11247
+ var compilationOptionsMap = /* @__PURE__ */ new WeakMap();
11559
11248
  var templateRenderFunction = import_zod3.z.function().args(import_zod3.z.record(import_zod3.z.string(), import_zod3.z.any())).returns(
11560
11249
  import_zod3.z.string().or(import_zod3.z.promise(import_zod3.z.string()))
11561
11250
  );
@@ -11563,7 +11252,7 @@ var templateParamFunction = import_zod3.z.function().args(import_zod3.z.record(i
11563
11252
  import_zod3.z.record(import_zod3.z.string(), import_zod3.z.any()).or(import_zod3.z.promise(import_zod3.z.record(import_zod3.z.string(), import_zod3.z.any())))
11564
11253
  );
11565
11254
  var templateFilenameFunction = import_zod3.z.function().args(import_zod3.z.string()).returns(import_zod3.z.string());
11566
- var htmlRspackPluginOptions = import_zod3.z.strictObject({
11255
+ var pluginOptionsSchema = import_zod3.z.strictObject({
11567
11256
  filename: import_zod3.z.string().or(templateFilenameFunction).optional(),
11568
11257
  template: import_zod3.z.string().refine(
11569
11258
  (val) => !val.includes("!"),
@@ -11592,10 +11281,29 @@ var htmlRspackPluginOptions = import_zod3.z.strictObject({
11592
11281
  meta: import_zod3.z.record(import_zod3.z.string().or(import_zod3.z.record(import_zod3.z.string()))).optional(),
11593
11282
  hash: import_zod3.z.boolean().optional()
11594
11283
  });
11284
+ function validateHtmlPluginOptions(options) {
11285
+ return validate(options, pluginOptionsSchema);
11286
+ }
11287
+ var getPluginOptions = (compilation) => {
11288
+ if (!(compilation instanceof Compilation)) {
11289
+ throw new TypeError(
11290
+ "The 'compilation' argument must be an instance of Compilation"
11291
+ );
11292
+ }
11293
+ return compilationOptionsMap.get(compilation);
11294
+ };
11295
+ var setPluginOptions = (compilation, options) => {
11296
+ compilationOptionsMap.set(compilation, options);
11297
+ };
11298
+ var cleanPluginOptions = (compilation) => {
11299
+ compilationOptionsMap.delete(compilation);
11300
+ };
11301
+
11302
+ // src/builtin-plugin/html-plugin/plugin.ts
11595
11303
  var HtmlRspackPluginImpl = create2(
11596
11304
  import_binding33.BuiltinPluginName.HtmlRspackPlugin,
11597
11305
  function(c = {}) {
11598
- validate(c, htmlRspackPluginOptions);
11306
+ validateHtmlPluginOptions(c);
11599
11307
  const meta = {};
11600
11308
  for (const key in c.meta) {
11601
11309
  const value = c.meta[key];
@@ -11619,11 +11327,11 @@ var HtmlRspackPluginImpl = create2(
11619
11327
  let compilation = null;
11620
11328
  this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance) => {
11621
11329
  compilation = compilationInstance;
11622
- compilationOptionsMap.set(compilation, c);
11330
+ setPluginOptions(compilation, c);
11623
11331
  });
11624
11332
  this.hooks.done.tap("HtmlRspackPlugin", (stats) => {
11625
- compilationHooksMap2.delete(stats.compilation);
11626
- compilationOptionsMap.delete(stats.compilation);
11333
+ cleanPluginHooks(stats.compilation);
11334
+ cleanPluginOptions(stats.compilation);
11627
11335
  });
11628
11336
  function generateRenderData(data) {
11629
11337
  var _a, _b, _c, _d;
@@ -11769,8 +11477,6 @@ function htmlTagObjectToString(tag) {
11769
11477
  const res = `<${[tag.tagName].concat(attributes).join(" ")}${tag.voidTag && !tag.innerHTML ? "/" : ""}>${tag.innerHTML || ""}${tag.voidTag && !tag.innerHTML ? "" : `</${tag.tagName}>`}`;
11770
11478
  return res;
11771
11479
  }
11772
- var compilationHooksMap2 = /* @__PURE__ */ new WeakMap();
11773
- var compilationOptionsMap = /* @__PURE__ */ new WeakMap();
11774
11480
  var HtmlRspackPlugin = HtmlRspackPluginImpl;
11775
11481
  var voidTags = [
11776
11482
  "area",
@@ -11797,38 +11503,8 @@ HtmlRspackPlugin.createHtmlTagObject = (tagName, attributes, innerHTML) => {
11797
11503
  innerHTML
11798
11504
  };
11799
11505
  };
11800
- HtmlRspackPlugin.getCompilationOptions = (compilation) => {
11801
- if (!(compilation instanceof Compilation)) {
11802
- throw new TypeError(
11803
- "The 'compilation' argument must be an instance of Compilation"
11804
- );
11805
- }
11806
- return compilationOptionsMap.get(compilation);
11807
- };
11808
- HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = (compilation) => {
11809
- if (!(compilation instanceof Compilation)) {
11810
- throw new TypeError(
11811
- "The 'compilation' argument must be an instance of Compilation"
11812
- );
11813
- }
11814
- let hooks = compilationHooksMap2.get(compilation);
11815
- if (hooks === void 0) {
11816
- hooks = {
11817
- beforeAssetTagGeneration: new liteTapable3.AsyncSeriesWaterfallHook([
11818
- "data"
11819
- ]),
11820
- alterAssetTags: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
11821
- alterAssetTagGroups: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
11822
- afterTemplateExecution: new liteTapable3.AsyncSeriesWaterfallHook([
11823
- "data"
11824
- ]),
11825
- beforeEmit: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
11826
- afterEmit: new liteTapable3.AsyncSeriesWaterfallHook(["data"])
11827
- };
11828
- compilationHooksMap2.set(compilation, hooks);
11829
- }
11830
- return hooks;
11831
- };
11506
+ HtmlRspackPlugin.getCompilationOptions = getPluginOptions;
11507
+ HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = getPluginHooks;
11832
11508
  HtmlRspackPlugin.version = 5;
11833
11509
 
11834
11510
  // src/builtin-plugin/HttpExternalsRspackPlugin.ts
@@ -13072,12 +12748,12 @@ var ResolverFactory = class {
13072
12748
  }
13073
12749
  get(type, resolveOptions2) {
13074
12750
  const { dependencyCategory, resolveToContext, ...resolve2 } = resolveOptions2 || {};
13075
- const binding3 = this.#binding.get(type, {
12751
+ const binding8 = this.#binding.get(type, {
13076
12752
  ...getRawResolve(resolve2),
13077
12753
  dependencyCategory,
13078
12754
  resolveToContext
13079
12755
  });
13080
- return new Resolver(binding3);
12756
+ return new Resolver(binding8);
13081
12757
  }
13082
12758
  };
13083
12759
 
@@ -13416,19 +13092,19 @@ var BINDING_VERSION = require("@rspack/binding/package.json").version;
13416
13092
  var CORE_VERSION = require("../package.json").version;
13417
13093
  var getAddonPlatformArchAbi = () => {
13418
13094
  const { platform, arch } = process;
13419
- let binding3 = "";
13420
- binding3 += platform;
13095
+ let binding8 = "";
13096
+ binding8 += platform;
13421
13097
  const abi = NodePlatformArchToAbi[platform][arch];
13422
13098
  if (abi === void 0) return new Error(`unsupported cpu arch: ${arch}`);
13423
- binding3 += `-${arch}`;
13099
+ binding8 += `-${arch}`;
13424
13100
  if (typeof abi === "string") {
13425
- binding3 += abi.length ? `-${abi}` : "";
13101
+ binding8 += abi.length ? `-${abi}` : "";
13426
13102
  } else if (typeof abi === "object") {
13427
- binding3 += `-${abi[isMusl() ? "musl" : "gnu"]}`;
13103
+ binding8 += `-${abi[isMusl() ? "musl" : "gnu"]}`;
13428
13104
  } else {
13429
13105
  return new Error(`unsupported abi: ${abi}`);
13430
13106
  }
13431
- return binding3;
13107
+ return binding8;
13432
13108
  };
13433
13109
  var result;
13434
13110
  var checkVersion = () => {
@@ -13474,21 +13150,1112 @@ Rspack requires these versions to be the same or you may have installed the wron
13474
13150
  return result = null;
13475
13151
  };
13476
13152
 
13477
- // src/Compiler.ts
13478
- var COMPILATION_WEAK_MAP = /* @__PURE__ */ new WeakMap();
13479
- var Compiler = class _Compiler {
13480
- #instance;
13481
- #initial;
13482
- #compilation;
13483
- #compilationParams;
13484
- #builtinPlugins;
13485
- #moduleExecutionResultsMap;
13486
- #nonSkippableRegisters;
13487
- #registers;
13488
- #ruleSet;
13489
- constructor(context2, options) {
13490
- this.#initial = true;
13491
- this.#builtinPlugins = [];
13153
+ // src/builtin-plugin/html-plugin/taps.ts
13154
+ var binding2 = __toESM(require("@rspack/binding"));
13155
+ var createHtmlPluginHooksRegisters = (getCompiler, createTap, createMapTap) => {
13156
+ return {
13157
+ registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(
13158
+ binding2.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration,
13159
+ function() {
13160
+ return HtmlRspackPlugin.getCompilationHooks(
13161
+ getCompiler().__internal__get_compilation()
13162
+ ).beforeAssetTagGeneration;
13163
+ },
13164
+ function(queried) {
13165
+ return async function(data) {
13166
+ return await queried.promise({
13167
+ ...data,
13168
+ plugin: {
13169
+ options: HtmlRspackPlugin.getCompilationOptions(
13170
+ getCompiler().__internal__get_compilation()
13171
+ ) || {}
13172
+ }
13173
+ });
13174
+ };
13175
+ }
13176
+ ),
13177
+ registerHtmlPluginAlterAssetTagsTaps: createTap(
13178
+ binding2.RegisterJsTapKind.HtmlPluginAlterAssetTags,
13179
+ function() {
13180
+ return HtmlRspackPlugin.getCompilationHooks(
13181
+ getCompiler().__internal__get_compilation()
13182
+ ).alterAssetTags;
13183
+ },
13184
+ function(queried) {
13185
+ return async function(data) {
13186
+ return await queried.promise(data);
13187
+ };
13188
+ }
13189
+ ),
13190
+ registerHtmlPluginAlterAssetTagGroupsTaps: createTap(
13191
+ binding2.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups,
13192
+ function() {
13193
+ return HtmlRspackPlugin.getCompilationHooks(
13194
+ getCompiler().__internal__get_compilation()
13195
+ ).alterAssetTagGroups;
13196
+ },
13197
+ function(queried) {
13198
+ return async function(data) {
13199
+ return await queried.promise({
13200
+ ...data,
13201
+ plugin: {
13202
+ options: HtmlRspackPlugin.getCompilationOptions(
13203
+ getCompiler().__internal__get_compilation()
13204
+ ) || {}
13205
+ }
13206
+ });
13207
+ };
13208
+ }
13209
+ ),
13210
+ registerHtmlPluginAfterTemplateExecutionTaps: createTap(
13211
+ binding2.RegisterJsTapKind.HtmlPluginAfterTemplateExecution,
13212
+ function() {
13213
+ return HtmlRspackPlugin.getCompilationHooks(
13214
+ getCompiler().__internal__get_compilation()
13215
+ ).afterTemplateExecution;
13216
+ },
13217
+ function(queried) {
13218
+ return async function(data) {
13219
+ return await queried.promise({
13220
+ ...data,
13221
+ plugin: {
13222
+ options: HtmlRspackPlugin.getCompilationOptions(
13223
+ getCompiler().__internal__get_compilation()
13224
+ ) || {}
13225
+ }
13226
+ });
13227
+ };
13228
+ }
13229
+ ),
13230
+ registerHtmlPluginBeforeEmitTaps: createTap(
13231
+ binding2.RegisterJsTapKind.HtmlPluginBeforeEmit,
13232
+ function() {
13233
+ return HtmlRspackPlugin.getCompilationHooks(
13234
+ getCompiler().__internal__get_compilation()
13235
+ ).beforeEmit;
13236
+ },
13237
+ function(queried) {
13238
+ return async function(data) {
13239
+ return await queried.promise({
13240
+ ...data,
13241
+ plugin: {
13242
+ options: HtmlRspackPlugin.getCompilationOptions(
13243
+ getCompiler().__internal__get_compilation()
13244
+ ) || {}
13245
+ }
13246
+ });
13247
+ };
13248
+ }
13249
+ ),
13250
+ registerHtmlPluginAfterEmitTaps: createTap(
13251
+ binding2.RegisterJsTapKind.HtmlPluginAfterEmit,
13252
+ function() {
13253
+ return HtmlRspackPlugin.getCompilationHooks(
13254
+ getCompiler().__internal__get_compilation()
13255
+ ).afterEmit;
13256
+ },
13257
+ function(queried) {
13258
+ return async function(data) {
13259
+ return await queried.promise({
13260
+ ...data,
13261
+ plugin: {
13262
+ options: HtmlRspackPlugin.getCompilationOptions(
13263
+ getCompiler().__internal__get_compilation()
13264
+ ) || {}
13265
+ }
13266
+ });
13267
+ };
13268
+ }
13269
+ )
13270
+ };
13271
+ };
13272
+
13273
+ // src/taps/compilation.ts
13274
+ var binding3 = __toESM(require("@rspack/binding"));
13275
+
13276
+ // src/RuntimeGlobals.ts
13277
+ var REVERSE_RUNTIME_GLOBALS = /* @__PURE__ */ new Map();
13278
+ function __from_binding_runtime_globals(runtimeRequirements) {
13279
+ const res = /* @__PURE__ */ new Set();
13280
+ for (const flag of runtimeRequirements.value) {
13281
+ if (flag in RuntimeGlobals) {
13282
+ res.add(RuntimeGlobals[flag]);
13283
+ } else {
13284
+ res.add(flag);
13285
+ }
13286
+ }
13287
+ return res;
13288
+ }
13289
+ function __to_binding_runtime_globals(runtimeRequirements) {
13290
+ const res = {
13291
+ value: []
13292
+ };
13293
+ for (const flag of Array.from(runtimeRequirements)) {
13294
+ const item = REVERSE_RUNTIME_GLOBALS.get(flag);
13295
+ if (typeof item === "string") {
13296
+ res.value.push(item);
13297
+ } else {
13298
+ res.value.push(flag);
13299
+ }
13300
+ }
13301
+ return res;
13302
+ }
13303
+ var RuntimeGlobals = {
13304
+ /**
13305
+ * the internal require function
13306
+ */
13307
+ require: "__webpack_require__",
13308
+ /**
13309
+ * access to properties of the internal require function/object
13310
+ */
13311
+ requireScope: "__webpack_require__.*",
13312
+ /**
13313
+ * the internal exports object
13314
+ */
13315
+ exports: "__webpack_exports__",
13316
+ /**
13317
+ * top-level this need to be the exports object
13318
+ */
13319
+ thisAsExports: "top-level-this-exports",
13320
+ /**
13321
+ * runtime need to return the exports of the last entry module
13322
+ */
13323
+ returnExportsFromRuntime: "return-exports-from-runtime",
13324
+ /**
13325
+ * the internal module object
13326
+ */
13327
+ module: "module",
13328
+ /**
13329
+ * the internal module object
13330
+ */
13331
+ moduleId: "module.id",
13332
+ /**
13333
+ * the internal module object
13334
+ */
13335
+ moduleLoaded: "module.loaded",
13336
+ /**
13337
+ * the bundle public path
13338
+ */
13339
+ publicPath: "__webpack_require__.p",
13340
+ /**
13341
+ * the module id of the entry point
13342
+ */
13343
+ entryModuleId: "__webpack_require__.s",
13344
+ /**
13345
+ * the module cache
13346
+ */
13347
+ moduleCache: "__webpack_require__.c",
13348
+ /**
13349
+ * the module functions
13350
+ */
13351
+ moduleFactories: "__webpack_require__.m",
13352
+ /**
13353
+ * the module functions, with only write access
13354
+ */
13355
+ moduleFactoriesAddOnly: "__webpack_require__.m (add only)",
13356
+ /**
13357
+ * the chunk ensure function
13358
+ */
13359
+ ensureChunk: "__webpack_require__.e",
13360
+ /**
13361
+ * an object with handlers to ensure a chunk
13362
+ */
13363
+ ensureChunkHandlers: "__webpack_require__.f",
13364
+ /**
13365
+ * a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
13366
+ */
13367
+ ensureChunkIncludeEntries: "__webpack_require__.f (include entries)",
13368
+ /**
13369
+ * the chunk prefetch function
13370
+ */
13371
+ prefetchChunk: "__webpack_require__.E",
13372
+ /**
13373
+ * an object with handlers to prefetch a chunk
13374
+ */
13375
+ prefetchChunkHandlers: "__webpack_require__.F",
13376
+ /**
13377
+ * the chunk preload function
13378
+ */
13379
+ preloadChunk: "__webpack_require__.G",
13380
+ /**
13381
+ * an object with handlers to preload a chunk
13382
+ */
13383
+ preloadChunkHandlers: "__webpack_require__.H",
13384
+ /**
13385
+ * the exported property define getters function
13386
+ */
13387
+ definePropertyGetters: "__webpack_require__.d",
13388
+ /**
13389
+ * define compatibility on export
13390
+ */
13391
+ makeNamespaceObject: "__webpack_require__.r",
13392
+ /**
13393
+ * create a fake namespace object
13394
+ */
13395
+ createFakeNamespaceObject: "__webpack_require__.t",
13396
+ /**
13397
+ * compatibility get default export
13398
+ */
13399
+ compatGetDefaultExport: "__webpack_require__.n",
13400
+ /**
13401
+ * ES modules decorator
13402
+ */
13403
+ harmonyModuleDecorator: "__webpack_require__.hmd",
13404
+ /**
13405
+ * node.js module decorator
13406
+ */
13407
+ nodeModuleDecorator: "__webpack_require__.nmd",
13408
+ /**
13409
+ * the webpack hash
13410
+ */
13411
+ getFullHash: "__webpack_require__.h",
13412
+ /**
13413
+ * an object containing all installed WebAssembly.Instance export objects keyed by module id
13414
+ */
13415
+ wasmInstances: "__webpack_require__.w",
13416
+ /**
13417
+ * instantiate a wasm instance from module exports object, id, hash and importsObject
13418
+ */
13419
+ instantiateWasm: "__webpack_require__.v",
13420
+ /**
13421
+ * the uncaught error handler for the webpack runtime
13422
+ */
13423
+ uncaughtErrorHandler: "__webpack_require__.oe",
13424
+ /**
13425
+ * the script nonce
13426
+ */
13427
+ scriptNonce: "__webpack_require__.nc",
13428
+ /**
13429
+ * function to load a script tag.
13430
+ * Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
13431
+ * done function is called when loading has finished or timeout occurred.
13432
+ * It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
13433
+ */
13434
+ loadScript: "__webpack_require__.l",
13435
+ /**
13436
+ * function to promote a string to a TrustedScript using webpack's Trusted
13437
+ * Types policy
13438
+ * Arguments: (script: string) =\> TrustedScript
13439
+ */
13440
+ createScript: "__webpack_require__.ts",
13441
+ /**
13442
+ * function to promote a string to a TrustedScriptURL using webpack's Trusted
13443
+ * Types policy
13444
+ * Arguments: (url: string) =\> TrustedScriptURL
13445
+ */
13446
+ createScriptUrl: "__webpack_require__.tu",
13447
+ /**
13448
+ * function to return webpack's Trusted Types policy
13449
+ * Arguments: () =\> TrustedTypePolicy
13450
+ */
13451
+ getTrustedTypesPolicy: "__webpack_require__.tt",
13452
+ /**
13453
+ * a flag when a chunk has a fetch priority
13454
+ */
13455
+ hasFetchPriority: "has fetch priority",
13456
+ /**
13457
+ * the chunk name of the chunk with the runtime
13458
+ */
13459
+ chunkName: "__webpack_require__.cn",
13460
+ /**
13461
+ * the runtime id of the current runtime
13462
+ */
13463
+ runtimeId: "__webpack_require__.j",
13464
+ /**
13465
+ * the filename of the script part of the chunk
13466
+ */
13467
+ getChunkScriptFilename: "__webpack_require__.u",
13468
+ /**
13469
+ * the filename of the css part of the chunk
13470
+ */
13471
+ getChunkCssFilename: "__webpack_require__.k",
13472
+ /**
13473
+ * a flag when a module/chunk/tree has css modules
13474
+ */
13475
+ hasCssModules: "has css modules",
13476
+ /**
13477
+ * the filename of the script part of the hot update chunk
13478
+ */
13479
+ getChunkUpdateScriptFilename: "__webpack_require__.hu",
13480
+ /**
13481
+ * the filename of the css part of the hot update chunk
13482
+ */
13483
+ getChunkUpdateCssFilename: "__webpack_require__.hk",
13484
+ /**
13485
+ * startup signal from runtime
13486
+ * This will be called when the runtime chunk has been loaded.
13487
+ */
13488
+ startup: "__webpack_require__.x",
13489
+ /**
13490
+ * @deprecated
13491
+ * creating a default startup function with the entry modules
13492
+ */
13493
+ startupNoDefault: "__webpack_require__.x (no default handler)",
13494
+ /**
13495
+ * startup signal from runtime but only used to add logic after the startup
13496
+ */
13497
+ startupOnlyAfter: "__webpack_require__.x (only after)",
13498
+ /**
13499
+ * startup signal from runtime but only used to add sync logic before the startup
13500
+ */
13501
+ startupOnlyBefore: "__webpack_require__.x (only before)",
13502
+ /**
13503
+ * global callback functions for installing chunks
13504
+ */
13505
+ chunkCallback: "webpackChunk",
13506
+ /**
13507
+ * method to startup an entrypoint with needed chunks.
13508
+ * Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
13509
+ * Returns the exports of the module or a Promise
13510
+ */
13511
+ startupEntrypoint: "__webpack_require__.X",
13512
+ /**
13513
+ * register deferred code, which will run when certain
13514
+ * chunks are loaded.
13515
+ * Signature: (chunkIds: Id[], fn: () =\> any, priority: int \>= 0 = 0) =\> any
13516
+ * Returned value will be returned directly when all chunks are already loaded
13517
+ * When (priority & 1) it will wait for all other handlers with lower priority to
13518
+ * be executed before itself is executed
13519
+ */
13520
+ onChunksLoaded: "__webpack_require__.O",
13521
+ /**
13522
+ * method to install a chunk that was loaded somehow
13523
+ * Signature: (\{ id, ids, modules, runtime \}) =\> void
13524
+ */
13525
+ externalInstallChunk: "__webpack_require__.C",
13526
+ /**
13527
+ * interceptor for module executions
13528
+ */
13529
+ interceptModuleExecution: "__webpack_require__.i",
13530
+ /**
13531
+ * the global object
13532
+ */
13533
+ global: "__webpack_require__.g",
13534
+ /**
13535
+ * an object with all share scopes
13536
+ */
13537
+ shareScopeMap: "__webpack_require__.S",
13538
+ /**
13539
+ * The sharing init sequence function (only runs once per share scope).
13540
+ * Has one argument, the name of the share scope.
13541
+ * Creates a share scope if not existing
13542
+ */
13543
+ initializeSharing: "__webpack_require__.I",
13544
+ /**
13545
+ * The current scope when getting a module from a remote
13546
+ */
13547
+ currentRemoteGetScope: "__webpack_require__.R",
13548
+ /**
13549
+ * the filename of the HMR manifest
13550
+ */
13551
+ getUpdateManifestFilename: "__webpack_require__.hmrF",
13552
+ /**
13553
+ * function downloading the update manifest
13554
+ */
13555
+ hmrDownloadManifest: "__webpack_require__.hmrM",
13556
+ /**
13557
+ * array with handler functions to download chunk updates
13558
+ */
13559
+ hmrDownloadUpdateHandlers: "__webpack_require__.hmrC",
13560
+ /**
13561
+ * object with all hmr module data for all modules
13562
+ */
13563
+ hmrModuleData: "__webpack_require__.hmrD",
13564
+ /**
13565
+ * array with handler functions when a module should be invalidated
13566
+ */
13567
+ hmrInvalidateModuleHandlers: "__webpack_require__.hmrI",
13568
+ /**
13569
+ * the prefix for storing state of runtime modules when hmr is enabled
13570
+ */
13571
+ hmrRuntimeStatePrefix: "__webpack_require__.hmrS",
13572
+ /**
13573
+ * the AMD define function
13574
+ */
13575
+ amdDefine: "__webpack_require__.amdD",
13576
+ /**
13577
+ * the AMD options
13578
+ */
13579
+ amdOptions: "__webpack_require__.amdO",
13580
+ /**
13581
+ * the System polyfill object
13582
+ */
13583
+ system: "__webpack_require__.System",
13584
+ /**
13585
+ * the shorthand for Object.prototype.hasOwnProperty
13586
+ * using of it decreases the compiled bundle size
13587
+ */
13588
+ hasOwnProperty: "__webpack_require__.o",
13589
+ /**
13590
+ * the System.register context object
13591
+ */
13592
+ systemContext: "__webpack_require__.y",
13593
+ /**
13594
+ * the baseURI of current document
13595
+ */
13596
+ baseURI: "__webpack_require__.b",
13597
+ /**
13598
+ * a RelativeURL class when relative URLs are used
13599
+ */
13600
+ relativeUrl: "__webpack_require__.U",
13601
+ /**
13602
+ * Creates an async module. The body function must be a async function.
13603
+ * "module.exports" will be decorated with an AsyncModulePromise.
13604
+ * The body function will be called.
13605
+ * To handle async dependencies correctly do this: "([a, b, c] = await handleDependencies([a, b, c]));".
13606
+ * If "hasAwaitAfterDependencies" is truthy, "handleDependencies()" must be called at the end of the body function.
13607
+ * Signature: function(
13608
+ * module: Module,
13609
+ * body: (handleDependencies: (deps: AsyncModulePromise[]) =\> Promise\<any[]\> & () =\> void,
13610
+ * hasAwaitAfterDependencies?: boolean
13611
+ * ) =\> void
13612
+ */
13613
+ asyncModule: "__webpack_require__.a"
13614
+ };
13615
+ for (const entry2 of Object.entries(RuntimeGlobals)) {
13616
+ REVERSE_RUNTIME_GLOBALS.set(entry2[1], entry2[0]);
13617
+ }
13618
+
13619
+ // src/taps/compilation.ts
13620
+ var createCompilationHooksRegisters = (getCompiler, createTap, createMapTap) => {
13621
+ return {
13622
+ registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap(
13623
+ binding3.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements,
13624
+ function() {
13625
+ return getCompiler().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
13626
+ },
13627
+ function(queried) {
13628
+ return function({
13629
+ chunk,
13630
+ runtimeRequirements
13631
+ }) {
13632
+ const set = __from_binding_runtime_globals(runtimeRequirements);
13633
+ queried.call(Chunk.__from_binding(chunk), set);
13634
+ return {
13635
+ runtimeRequirements: __to_binding_runtime_globals(set)
13636
+ };
13637
+ };
13638
+ }
13639
+ ),
13640
+ registerCompilationRuntimeRequirementInTreeTaps: createMapTap(
13641
+ binding3.RegisterJsTapKind.CompilationRuntimeRequirementInTree,
13642
+ function() {
13643
+ return getCompiler().__internal__get_compilation().hooks.runtimeRequirementInTree;
13644
+ },
13645
+ function(queried) {
13646
+ return function({
13647
+ chunk: chunkBinding,
13648
+ runtimeRequirements
13649
+ }) {
13650
+ const set = __from_binding_runtime_globals(runtimeRequirements);
13651
+ const chunk = Chunk.__from_binding(chunkBinding);
13652
+ for (const r of set) {
13653
+ queried.for(r).call(chunk, set);
13654
+ }
13655
+ return {
13656
+ runtimeRequirements: __to_binding_runtime_globals(set)
13657
+ };
13658
+ };
13659
+ }
13660
+ ),
13661
+ registerCompilationRuntimeModuleTaps: createTap(
13662
+ binding3.RegisterJsTapKind.CompilationRuntimeModule,
13663
+ function() {
13664
+ return getCompiler().__internal__get_compilation().hooks.runtimeModule;
13665
+ },
13666
+ function(queried) {
13667
+ return function({ module: module2, chunk }) {
13668
+ var _a, _b;
13669
+ const originSource = (_a = module2.source) == null ? void 0 : _a.source;
13670
+ queried.call(module2, Chunk.__from_binding(chunk));
13671
+ const newSource = (_b = module2.source) == null ? void 0 : _b.source;
13672
+ if (newSource && newSource !== originSource) {
13673
+ return module2;
13674
+ }
13675
+ return;
13676
+ };
13677
+ }
13678
+ ),
13679
+ registerCompilationBuildModuleTaps: createTap(
13680
+ binding3.RegisterJsTapKind.CompilationBuildModule,
13681
+ function() {
13682
+ return getCompiler().__internal__get_compilation().hooks.buildModule;
13683
+ },
13684
+ function(queried) {
13685
+ return function(m) {
13686
+ return queried.call(Module.__from_binding(m));
13687
+ };
13688
+ }
13689
+ ),
13690
+ registerCompilationStillValidModuleTaps: createTap(
13691
+ binding3.RegisterJsTapKind.CompilationStillValidModule,
13692
+ function() {
13693
+ return getCompiler().__internal__get_compilation().hooks.stillValidModule;
13694
+ },
13695
+ function(queried) {
13696
+ return function(m) {
13697
+ return queried.call(Module.__from_binding(m));
13698
+ };
13699
+ }
13700
+ ),
13701
+ registerCompilationSucceedModuleTaps: createTap(
13702
+ binding3.RegisterJsTapKind.CompilationSucceedModule,
13703
+ function() {
13704
+ return getCompiler().__internal__get_compilation().hooks.succeedModule;
13705
+ },
13706
+ function(queried) {
13707
+ return function(m) {
13708
+ return queried.call(Module.__from_binding(m));
13709
+ };
13710
+ }
13711
+ ),
13712
+ registerCompilationExecuteModuleTaps: createTap(
13713
+ binding3.RegisterJsTapKind.CompilationExecuteModule,
13714
+ function() {
13715
+ return getCompiler().__internal__get_compilation().hooks.executeModule;
13716
+ },
13717
+ function(queried) {
13718
+ return function({
13719
+ entry: entry2,
13720
+ id,
13721
+ codegenResults,
13722
+ runtimeModules
13723
+ }) {
13724
+ try {
13725
+ const __webpack_require__ = (id2) => {
13726
+ const cached = moduleCache[id2];
13727
+ if (cached !== void 0) {
13728
+ if (cached.error) throw cached.error;
13729
+ return cached.exports;
13730
+ }
13731
+ const execOptions = {
13732
+ id: id2,
13733
+ module: {
13734
+ id: id2,
13735
+ exports: {},
13736
+ loaded: false,
13737
+ error: void 0
13738
+ },
13739
+ require: __webpack_require__
13740
+ };
13741
+ for (const handler of interceptModuleExecution) {
13742
+ handler(execOptions);
13743
+ }
13744
+ const result2 = codegenResults.map[id2]["build time"];
13745
+ const moduleObject = execOptions.module;
13746
+ if (id2) moduleCache[id2] = moduleObject;
13747
+ tryRunOrWebpackError(
13748
+ () => queried.call(
13749
+ {
13750
+ codeGenerationResult: new CodeGenerationResult(result2),
13751
+ moduleObject
13752
+ },
13753
+ { __webpack_require__ }
13754
+ ),
13755
+ "Compilation.hooks.executeModule"
13756
+ );
13757
+ moduleObject.loaded = true;
13758
+ return moduleObject.exports;
13759
+ };
13760
+ const moduleCache = __webpack_require__[RuntimeGlobals.moduleCache.replace(
13761
+ `${RuntimeGlobals.require}.`,
13762
+ ""
13763
+ )] = {};
13764
+ const interceptModuleExecution = __webpack_require__[RuntimeGlobals.interceptModuleExecution.replace(
13765
+ `${RuntimeGlobals.require}.`,
13766
+ ""
13767
+ )] = [];
13768
+ for (const runtimeModule of runtimeModules) {
13769
+ __webpack_require__(runtimeModule);
13770
+ }
13771
+ const executeResult = __webpack_require__(entry2);
13772
+ getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
13773
+ } catch (e) {
13774
+ getCompiler().__internal__get_module_execution_results_map().set(id, e);
13775
+ throw e;
13776
+ }
13777
+ };
13778
+ }
13779
+ ),
13780
+ registerCompilationFinishModulesTaps: createTap(
13781
+ binding3.RegisterJsTapKind.CompilationFinishModules,
13782
+ function() {
13783
+ return getCompiler().__internal__get_compilation().hooks.finishModules;
13784
+ },
13785
+ function(queried) {
13786
+ return async function() {
13787
+ return await queried.promise(
13788
+ getCompiler().__internal__get_compilation().modules
13789
+ );
13790
+ };
13791
+ }
13792
+ ),
13793
+ registerCompilationOptimizeModulesTaps: createTap(
13794
+ binding3.RegisterJsTapKind.CompilationOptimizeModules,
13795
+ function() {
13796
+ return getCompiler().__internal__get_compilation().hooks.optimizeModules;
13797
+ },
13798
+ function(queried) {
13799
+ return function() {
13800
+ return queried.call(
13801
+ getCompiler().__internal__get_compilation().modules.values()
13802
+ );
13803
+ };
13804
+ }
13805
+ ),
13806
+ registerCompilationAfterOptimizeModulesTaps: createTap(
13807
+ binding3.RegisterJsTapKind.CompilationAfterOptimizeModules,
13808
+ function() {
13809
+ return getCompiler().__internal__get_compilation().hooks.afterOptimizeModules;
13810
+ },
13811
+ function(queried) {
13812
+ return function() {
13813
+ queried.call(
13814
+ getCompiler().__internal__get_compilation().modules.values()
13815
+ );
13816
+ };
13817
+ }
13818
+ ),
13819
+ registerCompilationOptimizeTreeTaps: createTap(
13820
+ binding3.RegisterJsTapKind.CompilationOptimizeTree,
13821
+ function() {
13822
+ return getCompiler().__internal__get_compilation().hooks.optimizeTree;
13823
+ },
13824
+ function(queried) {
13825
+ return async function() {
13826
+ return await queried.promise(
13827
+ getCompiler().__internal__get_compilation().chunks,
13828
+ getCompiler().__internal__get_compilation().modules
13829
+ );
13830
+ };
13831
+ }
13832
+ ),
13833
+ registerCompilationOptimizeChunkModulesTaps: createTap(
13834
+ binding3.RegisterJsTapKind.CompilationOptimizeChunkModules,
13835
+ function() {
13836
+ return getCompiler().__internal__get_compilation().hooks.optimizeChunkModules;
13837
+ },
13838
+ function(queried) {
13839
+ return async function() {
13840
+ return await queried.promise(
13841
+ getCompiler().__internal__get_compilation().chunks,
13842
+ getCompiler().__internal__get_compilation().modules
13843
+ );
13844
+ };
13845
+ }
13846
+ ),
13847
+ registerCompilationChunkHashTaps: createTap(
13848
+ binding3.RegisterJsTapKind.CompilationChunkHash,
13849
+ function() {
13850
+ return getCompiler().__internal__get_compilation().hooks.chunkHash;
13851
+ },
13852
+ function(queried) {
13853
+ return function(chunk) {
13854
+ if (!getCompiler().options.output.hashFunction) {
13855
+ throw new Error("'output.hashFunction' cannot be undefined");
13856
+ }
13857
+ const hash = createHash(getCompiler().options.output.hashFunction);
13858
+ queried.call(Chunk.__from_binding(chunk), hash);
13859
+ const digestResult = hash.digest(
13860
+ getCompiler().options.output.hashDigest
13861
+ );
13862
+ return Buffer.from(digestResult);
13863
+ };
13864
+ }
13865
+ ),
13866
+ registerCompilationChunkAssetTaps: createTap(
13867
+ binding3.RegisterJsTapKind.CompilationChunkAsset,
13868
+ function() {
13869
+ return getCompiler().__internal__get_compilation().hooks.chunkAsset;
13870
+ },
13871
+ function(queried) {
13872
+ return function({ chunk, filename: filename2 }) {
13873
+ return queried.call(Chunk.__from_binding(chunk), filename2);
13874
+ };
13875
+ }
13876
+ ),
13877
+ registerCompilationProcessAssetsTaps: createTap(
13878
+ binding3.RegisterJsTapKind.CompilationProcessAssets,
13879
+ function() {
13880
+ return getCompiler().__internal__get_compilation().hooks.processAssets;
13881
+ },
13882
+ function(queried) {
13883
+ return async function() {
13884
+ return await queried.promise(
13885
+ getCompiler().__internal__get_compilation().assets
13886
+ );
13887
+ };
13888
+ }
13889
+ ),
13890
+ registerCompilationAfterProcessAssetsTaps: createTap(
13891
+ binding3.RegisterJsTapKind.CompilationAfterProcessAssets,
13892
+ function() {
13893
+ return getCompiler().__internal__get_compilation().hooks.afterProcessAssets;
13894
+ },
13895
+ function(queried) {
13896
+ return function() {
13897
+ return queried.call(
13898
+ getCompiler().__internal__get_compilation().assets
13899
+ );
13900
+ };
13901
+ }
13902
+ ),
13903
+ registerCompilationSealTaps: createTap(
13904
+ binding3.RegisterJsTapKind.CompilationSeal,
13905
+ function() {
13906
+ return getCompiler().__internal__get_compilation().hooks.seal;
13907
+ },
13908
+ function(queried) {
13909
+ return function() {
13910
+ return queried.call();
13911
+ };
13912
+ }
13913
+ ),
13914
+ registerCompilationAfterSealTaps: createTap(
13915
+ binding3.RegisterJsTapKind.CompilationAfterSeal,
13916
+ function() {
13917
+ return getCompiler().__internal__get_compilation().hooks.afterSeal;
13918
+ },
13919
+ function(queried) {
13920
+ return async function() {
13921
+ return await queried.promise();
13922
+ };
13923
+ }
13924
+ )
13925
+ };
13926
+ };
13927
+
13928
+ // src/taps/compiler.ts
13929
+ var binding4 = __toESM(require("@rspack/binding"));
13930
+ var createCompilerHooksRegisters = (getCompiler, createTap, createMapTap) => {
13931
+ return {
13932
+ registerCompilerThisCompilationTaps: createTap(
13933
+ binding4.RegisterJsTapKind.CompilerThisCompilation,
13934
+ function() {
13935
+ return getCompiler().hooks.thisCompilation;
13936
+ },
13937
+ function(queried) {
13938
+ return function(native) {
13939
+ getCompiler().__internal__create_compilation(native);
13940
+ return queried.call(
13941
+ getCompiler().__internal__get_compilation(),
13942
+ getCompiler().__internal__get_compilation_params()
13943
+ );
13944
+ };
13945
+ }
13946
+ ),
13947
+ registerCompilerCompilationTaps: createTap(
13948
+ binding4.RegisterJsTapKind.CompilerCompilation,
13949
+ function() {
13950
+ return getCompiler().hooks.compilation;
13951
+ },
13952
+ function(queried) {
13953
+ return function() {
13954
+ return queried.call(
13955
+ getCompiler().__internal__get_compilation(),
13956
+ getCompiler().__internal__get_compilation_params()
13957
+ );
13958
+ };
13959
+ }
13960
+ ),
13961
+ registerCompilerMakeTaps: createTap(
13962
+ binding4.RegisterJsTapKind.CompilerMake,
13963
+ function() {
13964
+ return getCompiler().hooks.make;
13965
+ },
13966
+ function(queried) {
13967
+ return async function() {
13968
+ return await queried.promise(
13969
+ getCompiler().__internal__get_compilation()
13970
+ );
13971
+ };
13972
+ }
13973
+ ),
13974
+ registerCompilerFinishMakeTaps: createTap(
13975
+ binding4.RegisterJsTapKind.CompilerFinishMake,
13976
+ function() {
13977
+ return getCompiler().hooks.finishMake;
13978
+ },
13979
+ function(queried) {
13980
+ return async function() {
13981
+ return await queried.promise(
13982
+ getCompiler().__internal__get_compilation()
13983
+ );
13984
+ };
13985
+ }
13986
+ ),
13987
+ registerCompilerShouldEmitTaps: createTap(
13988
+ binding4.RegisterJsTapKind.CompilerShouldEmit,
13989
+ function() {
13990
+ return getCompiler().hooks.shouldEmit;
13991
+ },
13992
+ function(queried) {
13993
+ return function() {
13994
+ return queried.call(getCompiler().__internal__get_compilation());
13995
+ };
13996
+ }
13997
+ ),
13998
+ registerCompilerEmitTaps: createTap(
13999
+ binding4.RegisterJsTapKind.CompilerEmit,
14000
+ function() {
14001
+ return getCompiler().hooks.emit;
14002
+ },
14003
+ function(queried) {
14004
+ return async function() {
14005
+ return await queried.promise(
14006
+ getCompiler().__internal__get_compilation()
14007
+ );
14008
+ };
14009
+ }
14010
+ ),
14011
+ registerCompilerAfterEmitTaps: createTap(
14012
+ binding4.RegisterJsTapKind.CompilerAfterEmit,
14013
+ function() {
14014
+ return getCompiler().hooks.afterEmit;
14015
+ },
14016
+ function(queried) {
14017
+ return async function() {
14018
+ return await queried.promise(
14019
+ getCompiler().__internal__get_compilation()
14020
+ );
14021
+ };
14022
+ }
14023
+ ),
14024
+ registerCompilerAssetEmittedTaps: createTap(
14025
+ binding4.RegisterJsTapKind.CompilerAssetEmitted,
14026
+ function() {
14027
+ return getCompiler().hooks.assetEmitted;
14028
+ },
14029
+ function(queried) {
14030
+ return async function({
14031
+ filename: filename2,
14032
+ targetPath,
14033
+ outputPath
14034
+ }) {
14035
+ return queried.promise(filename2, {
14036
+ compilation: getCompiler().__internal__get_compilation(),
14037
+ targetPath,
14038
+ outputPath,
14039
+ get source() {
14040
+ var _a;
14041
+ return (_a = getCompiler().__internal__get_compilation().getAsset(filename2)) == null ? void 0 : _a.source;
14042
+ },
14043
+ get content() {
14044
+ var _a;
14045
+ return (_a = this.source) == null ? void 0 : _a.buffer();
14046
+ }
14047
+ });
14048
+ };
14049
+ }
14050
+ )
14051
+ };
14052
+ };
14053
+
14054
+ // src/taps/contextModuleFactory.ts
14055
+ var binding5 = __toESM(require("@rspack/binding"));
14056
+ var createContextModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap) => {
14057
+ return {
14058
+ registerContextModuleFactoryBeforeResolveTaps: createTap(
14059
+ binding5.RegisterJsTapKind.ContextModuleFactoryBeforeResolve,
14060
+ function() {
14061
+ return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
14062
+ },
14063
+ function(queried) {
14064
+ return async function(bindingData) {
14065
+ const data = bindingData ? ContextModuleFactoryBeforeResolveData.__from_binding(bindingData) : false;
14066
+ const result2 = await queried.promise(data);
14067
+ return result2 ? ContextModuleFactoryBeforeResolveData.__to_binding(result2) : false;
14068
+ };
14069
+ }
14070
+ ),
14071
+ registerContextModuleFactoryAfterResolveTaps: createTap(
14072
+ binding5.RegisterJsTapKind.ContextModuleFactoryAfterResolve,
14073
+ function() {
14074
+ return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
14075
+ },
14076
+ function(queried) {
14077
+ return async function(bindingData) {
14078
+ const data = bindingData ? ContextModuleFactoryAfterResolveData.__from_binding(bindingData) : false;
14079
+ const result2 = await queried.promise(data);
14080
+ return result2 ? ContextModuleFactoryAfterResolveData.__to_binding(result2) : false;
14081
+ };
14082
+ }
14083
+ )
14084
+ };
14085
+ };
14086
+
14087
+ // src/taps/javascriptModules.ts
14088
+ var binding6 = __toESM(require("@rspack/binding"));
14089
+ var createJavaScriptModulesHooksRegisters = (getCompiler, createTap, createMapTap) => {
14090
+ return {
14091
+ registerJavascriptModulesChunkHashTaps: createTap(
14092
+ binding6.RegisterJsTapKind.JavascriptModulesChunkHash,
14093
+ function() {
14094
+ return JavascriptModulesPlugin.getCompilationHooks(
14095
+ getCompiler().__internal__get_compilation()
14096
+ ).chunkHash;
14097
+ },
14098
+ function(queried) {
14099
+ return function(chunk) {
14100
+ if (!getCompiler().options.output.hashFunction) {
14101
+ throw new Error("'output.hashFunction' cannot be undefined");
14102
+ }
14103
+ const hash = createHash(getCompiler().options.output.hashFunction);
14104
+ queried.call(Chunk.__from_binding(chunk), hash);
14105
+ const digestResult = hash.digest(
14106
+ getCompiler().options.output.hashDigest
14107
+ );
14108
+ return Buffer.from(digestResult);
14109
+ };
14110
+ }
14111
+ )
14112
+ };
14113
+ };
14114
+
14115
+ // src/taps/normalModuleFactory.ts
14116
+ var binding7 = __toESM(require("@rspack/binding"));
14117
+ var createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap) => {
14118
+ return {
14119
+ registerNormalModuleFactoryBeforeResolveTaps: createTap(
14120
+ binding7.RegisterJsTapKind.NormalModuleFactoryBeforeResolve,
14121
+ function() {
14122
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
14123
+ },
14124
+ function(queried) {
14125
+ return async function(resolveData) {
14126
+ const normalizedResolveData = {
14127
+ contextInfo: {
14128
+ issuer: resolveData.issuer
14129
+ },
14130
+ request: resolveData.request,
14131
+ context: resolveData.context,
14132
+ fileDependencies: [],
14133
+ missingDependencies: [],
14134
+ contextDependencies: []
14135
+ };
14136
+ const ret = await queried.promise(normalizedResolveData);
14137
+ resolveData.request = normalizedResolveData.request;
14138
+ resolveData.context = normalizedResolveData.context;
14139
+ return [ret, resolveData];
14140
+ };
14141
+ }
14142
+ ),
14143
+ registerNormalModuleFactoryFactorizeTaps: createTap(
14144
+ binding7.RegisterJsTapKind.NormalModuleFactoryFactorize,
14145
+ function() {
14146
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
14147
+ },
14148
+ function(queried) {
14149
+ return async function(resolveData) {
14150
+ const normalizedResolveData = {
14151
+ contextInfo: {
14152
+ issuer: resolveData.issuer
14153
+ },
14154
+ request: resolveData.request,
14155
+ context: resolveData.context,
14156
+ fileDependencies: [],
14157
+ missingDependencies: [],
14158
+ contextDependencies: []
14159
+ };
14160
+ await queried.promise(normalizedResolveData);
14161
+ resolveData.request = normalizedResolveData.request;
14162
+ resolveData.context = normalizedResolveData.context;
14163
+ return resolveData;
14164
+ };
14165
+ }
14166
+ ),
14167
+ registerNormalModuleFactoryResolveTaps: createTap(
14168
+ binding7.RegisterJsTapKind.NormalModuleFactoryResolve,
14169
+ function() {
14170
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
14171
+ },
14172
+ function(queried) {
14173
+ return async function(resolveData) {
14174
+ const normalizedResolveData = {
14175
+ contextInfo: {
14176
+ issuer: resolveData.issuer
14177
+ },
14178
+ request: resolveData.request,
14179
+ context: resolveData.context,
14180
+ fileDependencies: [],
14181
+ missingDependencies: [],
14182
+ contextDependencies: []
14183
+ };
14184
+ await queried.promise(normalizedResolveData);
14185
+ resolveData.request = normalizedResolveData.request;
14186
+ resolveData.context = normalizedResolveData.context;
14187
+ return resolveData;
14188
+ };
14189
+ }
14190
+ ),
14191
+ registerNormalModuleFactoryResolveForSchemeTaps: createMapTap(
14192
+ binding7.RegisterJsTapKind.NormalModuleFactoryResolveForScheme,
14193
+ function() {
14194
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
14195
+ },
14196
+ function(queried) {
14197
+ return async function(args) {
14198
+ const ret = await queried.for(args.scheme).promise(args.resourceData);
14199
+ return [ret, args.resourceData];
14200
+ };
14201
+ }
14202
+ ),
14203
+ registerNormalModuleFactoryAfterResolveTaps: createTap(
14204
+ binding7.RegisterJsTapKind.NormalModuleFactoryAfterResolve,
14205
+ function() {
14206
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
14207
+ },
14208
+ function(queried) {
14209
+ return async function(arg) {
14210
+ const data = {
14211
+ contextInfo: {
14212
+ issuer: arg.issuer
14213
+ },
14214
+ request: arg.request,
14215
+ context: arg.context,
14216
+ fileDependencies: arg.fileDependencies,
14217
+ missingDependencies: arg.missingDependencies,
14218
+ contextDependencies: arg.contextDependencies,
14219
+ createData: arg.createData
14220
+ };
14221
+ const ret = await queried.promise(data);
14222
+ return [ret, data.createData];
14223
+ };
14224
+ }
14225
+ ),
14226
+ registerNormalModuleFactoryCreateModuleTaps: createTap(
14227
+ binding7.RegisterJsTapKind.NormalModuleFactoryCreateModule,
14228
+ function() {
14229
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
14230
+ },
14231
+ function(queried) {
14232
+ return async function(args) {
14233
+ const data = {
14234
+ ...args,
14235
+ settings: {}
14236
+ };
14237
+ await queried.promise(data, {});
14238
+ };
14239
+ }
14240
+ )
14241
+ };
14242
+ };
14243
+
14244
+ // src/Compiler.ts
14245
+ var COMPILATION_WEAK_MAP = /* @__PURE__ */ new WeakMap();
14246
+ var Compiler = class _Compiler {
14247
+ #instance;
14248
+ #initial;
14249
+ #compilation;
14250
+ #compilationParams;
14251
+ #builtinPlugins;
14252
+ #moduleExecutionResultsMap;
14253
+ #nonSkippableRegisters;
14254
+ #registers;
14255
+ #ruleSet;
14256
+ constructor(context2, options) {
14257
+ this.#initial = true;
14258
+ this.#builtinPlugins = [];
13492
14259
  this.#nonSkippableRegisters = [];
13493
14260
  this.#moduleExecutionResultsMap = /* @__PURE__ */ new Map();
13494
14261
  this.#ruleSet = new RuleSetCompiler();
@@ -13959,7 +14726,11 @@ var Compiler = class _Compiler {
13959
14726
  );
13960
14727
  });
13961
14728
  }
13962
- #createCompilation(native) {
14729
+ /**
14730
+ * Note: This is not a webpack public API, maybe removed in future.
14731
+ * @internal
14732
+ */
14733
+ __internal__create_compilation(native) {
13963
14734
  let compilation = COMPILATION_WEAK_MAP.get(native);
13964
14735
  if (!compilation) {
13965
14736
  compilation = new Compilation(this, native);
@@ -14005,699 +14776,7 @@ var Compiler = class _Compiler {
14005
14776
  this.#ruleSet.builtinReferences.entries()
14006
14777
  );
14007
14778
  const instanceBinding = require("@rspack/binding");
14008
- const that = new WeakRef(this);
14009
- this.#registers = {
14010
- registerCompilerThisCompilationTaps: this.#createHookRegisterTaps(
14011
- binding2.RegisterJsTapKind.CompilerThisCompilation,
14012
- function() {
14013
- return that.deref().hooks.thisCompilation;
14014
- },
14015
- function(queried) {
14016
- return function(native) {
14017
- that.deref().#createCompilation(native);
14018
- return queried.call(
14019
- that.deref().#compilation,
14020
- that.deref().#compilationParams
14021
- );
14022
- };
14023
- }
14024
- ),
14025
- registerCompilerCompilationTaps: this.#createHookRegisterTaps(
14026
- binding2.RegisterJsTapKind.CompilerCompilation,
14027
- function() {
14028
- return that.deref().hooks.compilation;
14029
- },
14030
- function(queried) {
14031
- return function() {
14032
- return queried.call(
14033
- that.deref().#compilation,
14034
- that.deref().#compilationParams
14035
- );
14036
- };
14037
- }
14038
- ),
14039
- registerCompilerMakeTaps: this.#createHookRegisterTaps(
14040
- binding2.RegisterJsTapKind.CompilerMake,
14041
- function() {
14042
- return that.deref().hooks.make;
14043
- },
14044
- function(queried) {
14045
- return async function() {
14046
- return await queried.promise(that.deref().#compilation);
14047
- };
14048
- }
14049
- ),
14050
- registerCompilerFinishMakeTaps: this.#createHookRegisterTaps(
14051
- binding2.RegisterJsTapKind.CompilerFinishMake,
14052
- function() {
14053
- return that.deref().hooks.finishMake;
14054
- },
14055
- function(queried) {
14056
- return async function() {
14057
- return await queried.promise(that.deref().#compilation);
14058
- };
14059
- }
14060
- ),
14061
- registerCompilerShouldEmitTaps: this.#createHookRegisterTaps(
14062
- binding2.RegisterJsTapKind.CompilerShouldEmit,
14063
- function() {
14064
- return that.deref().hooks.shouldEmit;
14065
- },
14066
- function(queried) {
14067
- return function() {
14068
- return queried.call(that.deref().#compilation);
14069
- };
14070
- }
14071
- ),
14072
- registerCompilerEmitTaps: this.#createHookRegisterTaps(
14073
- binding2.RegisterJsTapKind.CompilerEmit,
14074
- function() {
14075
- return that.deref().hooks.emit;
14076
- },
14077
- function(queried) {
14078
- return async function() {
14079
- return await queried.promise(that.deref().#compilation);
14080
- };
14081
- }
14082
- ),
14083
- registerCompilerAfterEmitTaps: this.#createHookRegisterTaps(
14084
- binding2.RegisterJsTapKind.CompilerAfterEmit,
14085
- function() {
14086
- return that.deref().hooks.afterEmit;
14087
- },
14088
- function(queried) {
14089
- return async function() {
14090
- return await queried.promise(that.deref().#compilation);
14091
- };
14092
- }
14093
- ),
14094
- registerCompilerAssetEmittedTaps: this.#createHookRegisterTaps(
14095
- binding2.RegisterJsTapKind.CompilerAssetEmitted,
14096
- function() {
14097
- return that.deref().hooks.assetEmitted;
14098
- },
14099
- function(queried) {
14100
- return async function({
14101
- filename: filename2,
14102
- targetPath,
14103
- outputPath
14104
- }) {
14105
- return queried.promise(filename2, {
14106
- compilation: that.deref().#compilation,
14107
- targetPath,
14108
- outputPath,
14109
- get source() {
14110
- var _a;
14111
- return (_a = that.deref().#compilation.getAsset(filename2)) == null ? void 0 : _a.source;
14112
- },
14113
- get content() {
14114
- var _a;
14115
- return (_a = this.source) == null ? void 0 : _a.buffer();
14116
- }
14117
- });
14118
- };
14119
- }
14120
- ),
14121
- registerCompilationAdditionalTreeRuntimeRequirements: this.#createHookRegisterTaps(
14122
- binding2.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements,
14123
- function() {
14124
- return that.deref().#compilation.hooks.additionalTreeRuntimeRequirements;
14125
- },
14126
- function(queried) {
14127
- return function({
14128
- chunk,
14129
- runtimeRequirements
14130
- }) {
14131
- const set = __from_binding_runtime_globals(runtimeRequirements);
14132
- queried.call(Chunk.__from_binding(chunk), set);
14133
- return {
14134
- runtimeRequirements: __to_binding_runtime_globals(set)
14135
- };
14136
- };
14137
- }
14138
- ),
14139
- registerCompilationRuntimeRequirementInTree: this.#createHookMapRegisterTaps(
14140
- binding2.RegisterJsTapKind.CompilationRuntimeRequirementInTree,
14141
- function() {
14142
- return that.deref().#compilation.hooks.runtimeRequirementInTree;
14143
- },
14144
- function(queried) {
14145
- return function({
14146
- chunk: chunkBinding,
14147
- runtimeRequirements
14148
- }) {
14149
- const set = __from_binding_runtime_globals(runtimeRequirements);
14150
- const chunk = Chunk.__from_binding(chunkBinding);
14151
- for (const r of set) {
14152
- queried.for(r).call(chunk, set);
14153
- }
14154
- return {
14155
- runtimeRequirements: __to_binding_runtime_globals(set)
14156
- };
14157
- };
14158
- }
14159
- ),
14160
- registerCompilationRuntimeModuleTaps: this.#createHookRegisterTaps(
14161
- binding2.RegisterJsTapKind.CompilationRuntimeModule,
14162
- function() {
14163
- return that.deref().#compilation.hooks.runtimeModule;
14164
- },
14165
- function(queried) {
14166
- return function({ module: module2, chunk }) {
14167
- var _a, _b;
14168
- const originSource = (_a = module2.source) == null ? void 0 : _a.source;
14169
- queried.call(module2, Chunk.__from_binding(chunk));
14170
- const newSource = (_b = module2.source) == null ? void 0 : _b.source;
14171
- if (newSource && newSource !== originSource) {
14172
- return module2;
14173
- }
14174
- return;
14175
- };
14176
- }
14177
- ),
14178
- registerCompilationBuildModuleTaps: this.#createHookRegisterTaps(
14179
- binding2.RegisterJsTapKind.CompilationBuildModule,
14180
- function() {
14181
- return that.deref().#compilation.hooks.buildModule;
14182
- },
14183
- function(queried) {
14184
- return function(m) {
14185
- return queried.call(Module.__from_binding(m));
14186
- };
14187
- }
14188
- ),
14189
- registerCompilationStillValidModuleTaps: this.#createHookRegisterTaps(
14190
- binding2.RegisterJsTapKind.CompilationStillValidModule,
14191
- function() {
14192
- return that.deref().#compilation.hooks.stillValidModule;
14193
- },
14194
- function(queried) {
14195
- return function(m) {
14196
- return queried.call(Module.__from_binding(m));
14197
- };
14198
- }
14199
- ),
14200
- registerCompilationSucceedModuleTaps: this.#createHookRegisterTaps(
14201
- binding2.RegisterJsTapKind.CompilationSucceedModule,
14202
- function() {
14203
- return that.deref().#compilation.hooks.succeedModule;
14204
- },
14205
- function(queried) {
14206
- return function(m) {
14207
- return queried.call(Module.__from_binding(m));
14208
- };
14209
- }
14210
- ),
14211
- registerCompilationExecuteModuleTaps: this.#createHookRegisterTaps(
14212
- binding2.RegisterJsTapKind.CompilationExecuteModule,
14213
- function() {
14214
- return that.deref().#compilation.hooks.executeModule;
14215
- },
14216
- function(queried) {
14217
- return function({
14218
- entry: entry2,
14219
- id,
14220
- codegenResults,
14221
- runtimeModules
14222
- }) {
14223
- try {
14224
- const __webpack_require__ = (id2) => {
14225
- const cached = moduleCache[id2];
14226
- if (cached !== void 0) {
14227
- if (cached.error) throw cached.error;
14228
- return cached.exports;
14229
- }
14230
- const execOptions = {
14231
- id: id2,
14232
- module: {
14233
- id: id2,
14234
- exports: {},
14235
- loaded: false,
14236
- error: void 0
14237
- },
14238
- require: __webpack_require__
14239
- };
14240
- for (const handler of interceptModuleExecution) {
14241
- handler(execOptions);
14242
- }
14243
- const result2 = codegenResults.map[id2]["build time"];
14244
- const moduleObject = execOptions.module;
14245
- if (id2) moduleCache[id2] = moduleObject;
14246
- tryRunOrWebpackError(
14247
- () => queried.call(
14248
- {
14249
- codeGenerationResult: new CodeGenerationResult(result2),
14250
- moduleObject
14251
- },
14252
- { __webpack_require__ }
14253
- ),
14254
- "Compilation.hooks.executeModule"
14255
- );
14256
- moduleObject.loaded = true;
14257
- return moduleObject.exports;
14258
- };
14259
- const moduleCache = __webpack_require__[RuntimeGlobals.moduleCache.replace(
14260
- `${RuntimeGlobals.require}.`,
14261
- ""
14262
- )] = {};
14263
- const interceptModuleExecution = __webpack_require__[RuntimeGlobals.interceptModuleExecution.replace(
14264
- `${RuntimeGlobals.require}.`,
14265
- ""
14266
- )] = [];
14267
- for (const runtimeModule of runtimeModules) {
14268
- __webpack_require__(runtimeModule);
14269
- }
14270
- const executeResult = __webpack_require__(entry2);
14271
- that.deref().#moduleExecutionResultsMap.set(id, executeResult);
14272
- } catch (e) {
14273
- that.deref().#moduleExecutionResultsMap.set(id, e);
14274
- throw e;
14275
- }
14276
- };
14277
- }
14278
- ),
14279
- registerCompilationFinishModulesTaps: this.#createHookRegisterTaps(
14280
- binding2.RegisterJsTapKind.CompilationFinishModules,
14281
- function() {
14282
- return that.deref().#compilation.hooks.finishModules;
14283
- },
14284
- function(queried) {
14285
- return async function() {
14286
- return await queried.promise(that.deref().#compilation.modules);
14287
- };
14288
- }
14289
- ),
14290
- registerCompilationOptimizeModulesTaps: this.#createHookRegisterTaps(
14291
- binding2.RegisterJsTapKind.CompilationOptimizeModules,
14292
- function() {
14293
- return that.deref().#compilation.hooks.optimizeModules;
14294
- },
14295
- function(queried) {
14296
- return function() {
14297
- return queried.call(that.deref().#compilation.modules.values());
14298
- };
14299
- }
14300
- ),
14301
- registerCompilationAfterOptimizeModulesTaps: this.#createHookRegisterTaps(
14302
- binding2.RegisterJsTapKind.CompilationAfterOptimizeModules,
14303
- function() {
14304
- return that.deref().#compilation.hooks.afterOptimizeModules;
14305
- },
14306
- function(queried) {
14307
- return function() {
14308
- queried.call(that.deref().#compilation.modules.values());
14309
- };
14310
- }
14311
- ),
14312
- registerCompilationOptimizeTreeTaps: this.#createHookRegisterTaps(
14313
- binding2.RegisterJsTapKind.CompilationOptimizeTree,
14314
- function() {
14315
- return that.deref().#compilation.hooks.optimizeTree;
14316
- },
14317
- function(queried) {
14318
- return async function() {
14319
- return await queried.promise(
14320
- that.deref().#compilation.chunks,
14321
- that.deref().#compilation.modules
14322
- );
14323
- };
14324
- }
14325
- ),
14326
- registerCompilationOptimizeChunkModulesTaps: this.#createHookRegisterTaps(
14327
- binding2.RegisterJsTapKind.CompilationOptimizeChunkModules,
14328
- function() {
14329
- return that.deref().#compilation.hooks.optimizeChunkModules;
14330
- },
14331
- function(queried) {
14332
- return async function() {
14333
- return await queried.promise(
14334
- that.deref().#compilation.chunks,
14335
- that.deref().#compilation.modules
14336
- );
14337
- };
14338
- }
14339
- ),
14340
- registerCompilationChunkHashTaps: this.#createHookRegisterTaps(
14341
- binding2.RegisterJsTapKind.CompilationChunkHash,
14342
- function() {
14343
- return that.deref().#compilation.hooks.chunkHash;
14344
- },
14345
- function(queried) {
14346
- return function(chunk) {
14347
- if (!that.deref().options.output.hashFunction) {
14348
- throw new Error("'output.hashFunction' cannot be undefined");
14349
- }
14350
- const hash = createHash(that.deref().options.output.hashFunction);
14351
- queried.call(Chunk.__from_binding(chunk), hash);
14352
- const digestResult = hash.digest(
14353
- that.deref().options.output.hashDigest
14354
- );
14355
- return Buffer.from(digestResult);
14356
- };
14357
- }
14358
- ),
14359
- registerCompilationChunkAssetTaps: this.#createHookRegisterTaps(
14360
- binding2.RegisterJsTapKind.CompilationChunkAsset,
14361
- function() {
14362
- return that.deref().#compilation.hooks.chunkAsset;
14363
- },
14364
- function(queried) {
14365
- return function({ chunk, filename: filename2 }) {
14366
- return queried.call(Chunk.__from_binding(chunk), filename2);
14367
- };
14368
- }
14369
- ),
14370
- registerCompilationProcessAssetsTaps: this.#createHookRegisterTaps(
14371
- binding2.RegisterJsTapKind.CompilationProcessAssets,
14372
- function() {
14373
- return that.deref().#compilation.hooks.processAssets;
14374
- },
14375
- function(queried) {
14376
- return async function() {
14377
- return await queried.promise(that.deref().#compilation.assets);
14378
- };
14379
- }
14380
- ),
14381
- registerCompilationAfterProcessAssetsTaps: this.#createHookRegisterTaps(
14382
- binding2.RegisterJsTapKind.CompilationAfterProcessAssets,
14383
- function() {
14384
- return that.deref().#compilation.hooks.afterProcessAssets;
14385
- },
14386
- function(queried) {
14387
- return function() {
14388
- return queried.call(that.deref().#compilation.assets);
14389
- };
14390
- }
14391
- ),
14392
- registerCompilationSealTaps: this.#createHookRegisterTaps(
14393
- binding2.RegisterJsTapKind.CompilationSeal,
14394
- function() {
14395
- return that.deref().#compilation.hooks.seal;
14396
- },
14397
- function(queried) {
14398
- return function() {
14399
- return queried.call();
14400
- };
14401
- }
14402
- ),
14403
- registerCompilationAfterSealTaps: this.#createHookRegisterTaps(
14404
- binding2.RegisterJsTapKind.CompilationAfterSeal,
14405
- function() {
14406
- return that.deref().#compilation.hooks.afterSeal;
14407
- },
14408
- function(queried) {
14409
- return async function() {
14410
- return await queried.promise();
14411
- };
14412
- }
14413
- ),
14414
- registerNormalModuleFactoryBeforeResolveTaps: this.#createHookRegisterTaps(
14415
- binding2.RegisterJsTapKind.NormalModuleFactoryBeforeResolve,
14416
- function() {
14417
- return that.deref().#compilationParams.normalModuleFactory.hooks.beforeResolve;
14418
- },
14419
- function(queried) {
14420
- return async function(resolveData) {
14421
- const normalizedResolveData = {
14422
- contextInfo: {
14423
- issuer: resolveData.issuer
14424
- },
14425
- request: resolveData.request,
14426
- context: resolveData.context,
14427
- fileDependencies: [],
14428
- missingDependencies: [],
14429
- contextDependencies: []
14430
- };
14431
- const ret = await queried.promise(normalizedResolveData);
14432
- resolveData.request = normalizedResolveData.request;
14433
- resolveData.context = normalizedResolveData.context;
14434
- return [ret, resolveData];
14435
- };
14436
- }
14437
- ),
14438
- registerNormalModuleFactoryFactorizeTaps: this.#createHookRegisterTaps(
14439
- binding2.RegisterJsTapKind.NormalModuleFactoryFactorize,
14440
- function() {
14441
- return that.deref().#compilationParams.normalModuleFactory.hooks.factorize;
14442
- },
14443
- function(queried) {
14444
- return async function(resolveData) {
14445
- const normalizedResolveData = {
14446
- contextInfo: {
14447
- issuer: resolveData.issuer
14448
- },
14449
- request: resolveData.request,
14450
- context: resolveData.context,
14451
- fileDependencies: [],
14452
- missingDependencies: [],
14453
- contextDependencies: []
14454
- };
14455
- await queried.promise(normalizedResolveData);
14456
- resolveData.request = normalizedResolveData.request;
14457
- resolveData.context = normalizedResolveData.context;
14458
- return resolveData;
14459
- };
14460
- }
14461
- ),
14462
- registerNormalModuleFactoryResolveTaps: this.#createHookRegisterTaps(
14463
- binding2.RegisterJsTapKind.NormalModuleFactoryResolve,
14464
- function() {
14465
- return that.deref().#compilationParams.normalModuleFactory.hooks.resolve;
14466
- },
14467
- function(queried) {
14468
- return async function(resolveData) {
14469
- const normalizedResolveData = {
14470
- contextInfo: {
14471
- issuer: resolveData.issuer
14472
- },
14473
- request: resolveData.request,
14474
- context: resolveData.context,
14475
- fileDependencies: [],
14476
- missingDependencies: [],
14477
- contextDependencies: []
14478
- };
14479
- await queried.promise(normalizedResolveData);
14480
- resolveData.request = normalizedResolveData.request;
14481
- resolveData.context = normalizedResolveData.context;
14482
- return resolveData;
14483
- };
14484
- }
14485
- ),
14486
- registerNormalModuleFactoryResolveForSchemeTaps: this.#createHookMapRegisterTaps(
14487
- binding2.RegisterJsTapKind.NormalModuleFactoryResolveForScheme,
14488
- function() {
14489
- return that.deref().#compilationParams.normalModuleFactory.hooks.resolveForScheme;
14490
- },
14491
- function(queried) {
14492
- return async function(args) {
14493
- const ret = await queried.for(args.scheme).promise(args.resourceData);
14494
- return [ret, args.resourceData];
14495
- };
14496
- }
14497
- ),
14498
- registerNormalModuleFactoryAfterResolveTaps: this.#createHookRegisterTaps(
14499
- binding2.RegisterJsTapKind.NormalModuleFactoryAfterResolve,
14500
- function() {
14501
- return that.deref().#compilationParams.normalModuleFactory.hooks.afterResolve;
14502
- },
14503
- function(queried) {
14504
- return async function(arg) {
14505
- const data = {
14506
- contextInfo: {
14507
- issuer: arg.issuer
14508
- },
14509
- request: arg.request,
14510
- context: arg.context,
14511
- fileDependencies: arg.fileDependencies,
14512
- missingDependencies: arg.missingDependencies,
14513
- contextDependencies: arg.contextDependencies,
14514
- createData: arg.createData
14515
- };
14516
- const ret = await queried.promise(data);
14517
- return [ret, data.createData];
14518
- };
14519
- }
14520
- ),
14521
- registerNormalModuleFactoryCreateModuleTaps: this.#createHookRegisterTaps(
14522
- binding2.RegisterJsTapKind.NormalModuleFactoryCreateModule,
14523
- function() {
14524
- return that.deref().#compilationParams.normalModuleFactory.hooks.createModule;
14525
- },
14526
- function(queried) {
14527
- return async function(args) {
14528
- const data = {
14529
- ...args,
14530
- settings: {}
14531
- };
14532
- await queried.promise(data, {});
14533
- };
14534
- }
14535
- ),
14536
- registerContextModuleFactoryBeforeResolveTaps: this.#createHookRegisterTaps(
14537
- binding2.RegisterJsTapKind.ContextModuleFactoryBeforeResolve,
14538
- function() {
14539
- return that.deref().#compilationParams.contextModuleFactory.hooks.beforeResolve;
14540
- },
14541
- function(queried) {
14542
- return async function(bindingData) {
14543
- const data = bindingData ? ContextModuleFactoryBeforeResolveData.__from_binding(
14544
- bindingData
14545
- ) : false;
14546
- const result2 = await queried.promise(data);
14547
- return result2 ? ContextModuleFactoryBeforeResolveData.__to_binding(result2) : false;
14548
- };
14549
- }
14550
- ),
14551
- registerContextModuleFactoryAfterResolveTaps: this.#createHookRegisterTaps(
14552
- binding2.RegisterJsTapKind.ContextModuleFactoryAfterResolve,
14553
- function() {
14554
- return that.deref().#compilationParams.contextModuleFactory.hooks.afterResolve;
14555
- },
14556
- function(queried) {
14557
- return async function(bindingData) {
14558
- const data = bindingData ? ContextModuleFactoryAfterResolveData.__from_binding(
14559
- bindingData
14560
- ) : false;
14561
- const result2 = await queried.promise(data);
14562
- return result2 ? ContextModuleFactoryAfterResolveData.__to_binding(result2) : false;
14563
- };
14564
- }
14565
- ),
14566
- registerJavascriptModulesChunkHashTaps: this.#createHookRegisterTaps(
14567
- binding2.RegisterJsTapKind.JavascriptModulesChunkHash,
14568
- function() {
14569
- return JavascriptModulesPlugin.getCompilationHooks(
14570
- that.deref().#compilation
14571
- ).chunkHash;
14572
- },
14573
- function(queried) {
14574
- return function(chunk) {
14575
- if (!that.deref().options.output.hashFunction) {
14576
- throw new Error("'output.hashFunction' cannot be undefined");
14577
- }
14578
- const hash = createHash(that.deref().options.output.hashFunction);
14579
- queried.call(Chunk.__from_binding(chunk), hash);
14580
- const digestResult = hash.digest(
14581
- that.deref().options.output.hashDigest
14582
- );
14583
- return Buffer.from(digestResult);
14584
- };
14585
- }
14586
- ),
14587
- registerHtmlPluginBeforeAssetTagGenerationTaps: this.#createHookRegisterTaps(
14588
- binding2.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration,
14589
- function() {
14590
- return HtmlRspackPlugin.getCompilationHooks(
14591
- that.deref().#compilation
14592
- ).beforeAssetTagGeneration;
14593
- },
14594
- function(queried) {
14595
- return async function(data) {
14596
- return await queried.promise({
14597
- ...data,
14598
- plugin: {
14599
- options: HtmlRspackPlugin.getCompilationOptions(
14600
- that.deref().#compilation
14601
- ) || {}
14602
- }
14603
- });
14604
- };
14605
- }
14606
- ),
14607
- registerHtmlPluginAlterAssetTagsTaps: this.#createHookRegisterTaps(
14608
- binding2.RegisterJsTapKind.HtmlPluginAlterAssetTags,
14609
- function() {
14610
- return HtmlRspackPlugin.getCompilationHooks(
14611
- that.deref().#compilation
14612
- ).alterAssetTags;
14613
- },
14614
- function(queried) {
14615
- return async function(data) {
14616
- return await queried.promise(data);
14617
- };
14618
- }
14619
- ),
14620
- registerHtmlPluginAlterAssetTagGroupsTaps: this.#createHookRegisterTaps(
14621
- binding2.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups,
14622
- function() {
14623
- return HtmlRspackPlugin.getCompilationHooks(
14624
- that.deref().#compilation
14625
- ).alterAssetTagGroups;
14626
- },
14627
- function(queried) {
14628
- return async function(data) {
14629
- return await queried.promise({
14630
- ...data,
14631
- plugin: {
14632
- options: HtmlRspackPlugin.getCompilationOptions(
14633
- that.deref().#compilation
14634
- ) || {}
14635
- }
14636
- });
14637
- };
14638
- }
14639
- ),
14640
- registerHtmlPluginAfterTemplateExecutionTaps: this.#createHookRegisterTaps(
14641
- binding2.RegisterJsTapKind.HtmlPluginAfterTemplateExecution,
14642
- function() {
14643
- return HtmlRspackPlugin.getCompilationHooks(
14644
- that.deref().#compilation
14645
- ).afterTemplateExecution;
14646
- },
14647
- function(queried) {
14648
- return async function(data) {
14649
- return await queried.promise({
14650
- ...data,
14651
- plugin: {
14652
- options: HtmlRspackPlugin.getCompilationOptions(
14653
- that.deref().#compilation
14654
- ) || {}
14655
- }
14656
- });
14657
- };
14658
- }
14659
- ),
14660
- registerHtmlPluginBeforeEmitTaps: this.#createHookRegisterTaps(
14661
- binding2.RegisterJsTapKind.HtmlPluginBeforeEmit,
14662
- function() {
14663
- return HtmlRspackPlugin.getCompilationHooks(
14664
- that.deref().#compilation
14665
- ).beforeEmit;
14666
- },
14667
- function(queried) {
14668
- return async function(data) {
14669
- return await queried.promise({
14670
- ...data,
14671
- plugin: {
14672
- options: HtmlRspackPlugin.getCompilationOptions(
14673
- that.deref().#compilation
14674
- ) || {}
14675
- }
14676
- });
14677
- };
14678
- }
14679
- ),
14680
- registerHtmlPluginAfterEmitTaps: this.#createHookRegisterTaps(
14681
- binding2.RegisterJsTapKind.HtmlPluginAfterEmit,
14682
- function() {
14683
- return HtmlRspackPlugin.getCompilationHooks(
14684
- that.deref().#compilation
14685
- ).afterEmit;
14686
- },
14687
- function(queried) {
14688
- return async function(data) {
14689
- return await queried.promise({
14690
- ...data,
14691
- plugin: {
14692
- options: HtmlRspackPlugin.getCompilationOptions(
14693
- that.deref().#compilation
14694
- ) || {}
14695
- }
14696
- });
14697
- };
14698
- }
14699
- )
14700
- };
14779
+ this.#registers = this.#createHooksRegisters();
14701
14780
  this.#instance = new instanceBinding.Rspack(
14702
14781
  this.compilerPath,
14703
14782
  rawOptions,
@@ -14713,6 +14792,32 @@ var Compiler = class _Compiler {
14713
14792
  );
14714
14793
  callback(null, this.#instance);
14715
14794
  }
14795
+ #createHooksRegisters() {
14796
+ const ref = new WeakRef(this);
14797
+ const getCompiler = () => ref.deref();
14798
+ const createTap = this.#createHookRegisterTaps.bind(this);
14799
+ const createMapTap = this.#createHookMapRegisterTaps.bind(this);
14800
+ return {
14801
+ ...createCompilerHooksRegisters(getCompiler, createTap, createMapTap),
14802
+ ...createCompilationHooksRegisters(getCompiler, createTap, createMapTap),
14803
+ ...createNormalModuleFactoryHooksRegisters(
14804
+ getCompiler,
14805
+ createTap,
14806
+ createMapTap
14807
+ ),
14808
+ ...createContextModuleFactoryHooksRegisters(
14809
+ getCompiler,
14810
+ createTap,
14811
+ createMapTap
14812
+ ),
14813
+ ...createJavaScriptModulesHooksRegisters(
14814
+ getCompiler,
14815
+ createTap,
14816
+ createMapTap
14817
+ ),
14818
+ ...createHtmlPluginHooksRegisters(getCompiler, createTap, createMapTap)
14819
+ };
14820
+ }
14716
14821
  #updateNonSkippableRegisters() {
14717
14822
  const kinds = [];
14718
14823
  for (const { getHook, getHookMap, registerKind } of Object.values(
@@ -14748,6 +14853,10 @@ var Compiler = class _Compiler {
14748
14853
  };
14749
14854
  }
14750
14855
  }
14856
+ /**
14857
+ * Note: This is not a webpack public API, maybe removed in future.
14858
+ * @internal
14859
+ */
14751
14860
  #createHookRegisterTaps(registerKind, getHook, createTap) {
14752
14861
  const that = new WeakRef(this);
14753
14862
  const getTaps = (stages) => {
@@ -14778,6 +14887,10 @@ var Compiler = class _Compiler {
14778
14887
  getTaps.getHook = getHook;
14779
14888
  return getTaps;
14780
14889
  }
14890
+ /**
14891
+ * Note: This is not a webpack public API, maybe removed in future.
14892
+ * @internal
14893
+ */
14781
14894
  #createHookMapRegisterTaps(registerKind, getHookMap, createTap) {
14782
14895
  const that = new WeakRef(this);
14783
14896
  const getTaps = (stages) => {
@@ -14808,12 +14921,41 @@ var Compiler = class _Compiler {
14808
14921
  getTaps.getHookMap = getHookMap;
14809
14922
  return getTaps;
14810
14923
  }
14924
+ /**
14925
+ * Note: This is not a webpack public API, maybe removed in future.
14926
+ * @internal
14927
+ */
14811
14928
  __internal__registerBuiltinPlugin(plugin2) {
14812
14929
  this.#builtinPlugins.push(plugin2);
14813
14930
  }
14931
+ /**
14932
+ * Note: This is not a webpack public API, maybe removed in future.
14933
+ * @internal
14934
+ */
14814
14935
  __internal__getModuleExecutionResult(id) {
14815
14936
  return this.#moduleExecutionResultsMap.get(id);
14816
14937
  }
14938
+ /**
14939
+ * Note: This is not a webpack public API, maybe removed in future.
14940
+ * @internal
14941
+ */
14942
+ __internal__get_compilation() {
14943
+ return this.#compilation;
14944
+ }
14945
+ /**
14946
+ * Note: This is not a webpack public API, maybe removed in future.
14947
+ * @internal
14948
+ */
14949
+ __internal__get_compilation_params() {
14950
+ return this.#compilationParams;
14951
+ }
14952
+ /**
14953
+ * Note: This is not a webpack public API, maybe removed in future.
14954
+ * @internal
14955
+ */
14956
+ __internal__get_module_execution_results_map() {
14957
+ return this.#moduleExecutionResultsMap;
14958
+ }
14817
14959
  };
14818
14960
 
14819
14961
  // src/MultiCompiler.ts