@rspack/core 1.2.0 → 1.2.2

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
@@ -722,6 +722,7 @@ __export(src_exports, {
722
722
  RspackOptionsApply: () => RspackOptionsApply,
723
723
  RuntimeGlobals: () => RuntimeGlobals,
724
724
  RuntimeModule: () => RuntimeModule,
725
+ RuntimePlugin: () => RuntimePlugin,
725
726
  SourceMapDevToolPlugin: () => SourceMapDevToolPlugin,
726
727
  Stats: () => Stats,
727
728
  SwcJsMinimizerRspackPlugin: () => SwcJsMinimizerRspackPlugin,
@@ -787,6 +788,7 @@ __export(exports_exports, {
787
788
  RspackOptionsApply: () => RspackOptionsApply,
788
789
  RuntimeGlobals: () => RuntimeGlobals,
789
790
  RuntimeModule: () => RuntimeModule,
791
+ RuntimePlugin: () => RuntimePlugin,
790
792
  SourceMapDevToolPlugin: () => SourceMapDevToolPlugin,
791
793
  Stats: () => Stats,
792
794
  SwcJsMinimizerRspackPlugin: () => SwcJsMinimizerRspackPlugin,
@@ -821,40 +823,40 @@ var liteTapable = __toESM(require("@rspack/lite-tapable"));
821
823
  // src/Dependency.ts
822
824
  var Dependency = class _Dependency {
823
825
  #inner;
824
- static __from_binding(binding3) {
825
- return new _Dependency(binding3);
826
+ static __from_binding(binding9) {
827
+ return new _Dependency(binding9);
826
828
  }
827
829
  static __to_binding(data) {
828
830
  return data.#inner;
829
831
  }
830
- constructor(binding3) {
831
- this.#inner = binding3;
832
+ constructor(binding9) {
833
+ this.#inner = binding9;
832
834
  Object.defineProperties(this, {
833
835
  type: {
834
836
  enumerable: true,
835
837
  get() {
836
- return binding3.type;
838
+ return binding9.type;
837
839
  }
838
840
  },
839
841
  category: {
840
842
  enumerable: true,
841
843
  get() {
842
- return binding3.category;
844
+ return binding9.category;
843
845
  }
844
846
  },
845
847
  request: {
846
848
  enumerable: true,
847
849
  get() {
848
- return binding3.request;
850
+ return binding9.request;
849
851
  }
850
852
  },
851
853
  critical: {
852
854
  enumerable: true,
853
855
  get() {
854
- return binding3.critical;
856
+ return binding9.critical;
855
857
  },
856
858
  set(val) {
857
- binding3.critical = val;
859
+ binding9.critical = val;
858
860
  }
859
861
  }
860
862
  });
@@ -864,25 +866,25 @@ var Dependency = class _Dependency {
864
866
  // src/DependenciesBlock.ts
865
867
  var DependenciesBlock = class _DependenciesBlock {
866
868
  #binding;
867
- static __from_binding(binding3) {
868
- return new _DependenciesBlock(binding3);
869
+ static __from_binding(binding9) {
870
+ return new _DependenciesBlock(binding9);
869
871
  }
870
872
  static __to_binding(block) {
871
873
  return block.#binding;
872
874
  }
873
- constructor(binding3) {
874
- this.#binding = binding3;
875
+ constructor(binding9) {
876
+ this.#binding = binding9;
875
877
  Object.defineProperties(this, {
876
878
  dependencies: {
877
879
  enumerable: true,
878
880
  get() {
879
- return binding3.dependencies.map((d) => Dependency.__from_binding(d));
881
+ return binding9.dependencies.map((d) => Dependency.__from_binding(d));
880
882
  }
881
883
  },
882
884
  blocks: {
883
885
  enumerable: true,
884
886
  get() {
885
- return binding3.blocks.map((b) => _DependenciesBlock.__from_binding(b));
887
+ return binding9.blocks.map((b) => _DependenciesBlock.__from_binding(b));
886
888
  }
887
889
  }
888
890
  });
@@ -935,49 +937,49 @@ var JsSource = class extends import_webpack_sources.Source {
935
937
  // src/Module.ts
936
938
  var ContextModuleFactoryBeforeResolveData = class _ContextModuleFactoryBeforeResolveData {
937
939
  #inner;
938
- static __from_binding(binding3) {
939
- return new _ContextModuleFactoryBeforeResolveData(binding3);
940
+ static __from_binding(binding9) {
941
+ return new _ContextModuleFactoryBeforeResolveData(binding9);
940
942
  }
941
943
  static __to_binding(data) {
942
944
  return data.#inner;
943
945
  }
944
- constructor(binding3) {
945
- this.#inner = binding3;
946
+ constructor(binding9) {
947
+ this.#inner = binding9;
946
948
  Object.defineProperties(this, {
947
949
  context: {
948
950
  enumerable: true,
949
951
  get() {
950
- return binding3.context;
952
+ return binding9.context;
951
953
  },
952
954
  set(val) {
953
- binding3.context = val;
955
+ binding9.context = val;
954
956
  }
955
957
  },
956
958
  request: {
957
959
  enumerable: true,
958
960
  get() {
959
- return binding3.request;
961
+ return binding9.request;
960
962
  },
961
963
  set(val) {
962
- binding3.request = val;
964
+ binding9.request = val;
963
965
  }
964
966
  },
965
967
  regExp: {
966
968
  enumerable: true,
967
969
  get() {
968
- return binding3.regExp;
970
+ return binding9.regExp;
969
971
  },
970
972
  set(val) {
971
- binding3.regExp = val;
973
+ binding9.regExp = val;
972
974
  }
973
975
  },
974
976
  recursive: {
975
977
  enumerable: true,
976
978
  get() {
977
- return binding3.recursive;
979
+ return binding9.recursive;
978
980
  },
979
981
  set(val) {
980
- binding3.recursive = val;
982
+ binding9.recursive = val;
981
983
  }
982
984
  }
983
985
  });
@@ -985,64 +987,64 @@ var ContextModuleFactoryBeforeResolveData = class _ContextModuleFactoryBeforeRes
985
987
  };
986
988
  var ContextModuleFactoryAfterResolveData = class _ContextModuleFactoryAfterResolveData {
987
989
  #inner;
988
- static __from_binding(binding3) {
989
- return new _ContextModuleFactoryAfterResolveData(binding3);
990
+ static __from_binding(binding9) {
991
+ return new _ContextModuleFactoryAfterResolveData(binding9);
990
992
  }
991
993
  static __to_binding(data) {
992
994
  return data.#inner;
993
995
  }
994
- constructor(binding3) {
995
- this.#inner = binding3;
996
+ constructor(binding9) {
997
+ this.#inner = binding9;
996
998
  Object.defineProperties(this, {
997
999
  resource: {
998
1000
  enumerable: true,
999
1001
  get() {
1000
- return binding3.resource;
1002
+ return binding9.resource;
1001
1003
  },
1002
1004
  set(val) {
1003
- binding3.resource = val;
1005
+ binding9.resource = val;
1004
1006
  }
1005
1007
  },
1006
1008
  context: {
1007
1009
  enumerable: true,
1008
1010
  get() {
1009
- return binding3.context;
1011
+ return binding9.context;
1010
1012
  },
1011
1013
  set(val) {
1012
- binding3.context = val;
1014
+ binding9.context = val;
1013
1015
  }
1014
1016
  },
1015
1017
  request: {
1016
1018
  enumerable: true,
1017
1019
  get() {
1018
- return binding3.request;
1020
+ return binding9.request;
1019
1021
  },
1020
1022
  set(val) {
1021
- binding3.request = val;
1023
+ binding9.request = val;
1022
1024
  }
1023
1025
  },
1024
1026
  regExp: {
1025
1027
  enumerable: true,
1026
1028
  get() {
1027
- return binding3.regExp;
1029
+ return binding9.regExp;
1028
1030
  },
1029
1031
  set(val) {
1030
- binding3.regExp = val;
1032
+ binding9.regExp = val;
1031
1033
  }
1032
1034
  },
1033
1035
  recursive: {
1034
1036
  enumerable: true,
1035
1037
  get() {
1036
- return binding3.recursive;
1038
+ return binding9.recursive;
1037
1039
  },
1038
1040
  set(val) {
1039
- binding3.recursive = val;
1041
+ binding9.recursive = val;
1040
1042
  }
1041
1043
  },
1042
1044
  dependencies: {
1043
1045
  enumerable: true,
1044
1046
  get() {
1045
- return binding3.dependencies.map(
1047
+ return binding9.dependencies.map(
1046
1048
  (dep) => Dependency.__from_binding(dep)
1047
1049
  );
1048
1050
  }
@@ -1053,13 +1055,13 @@ var ContextModuleFactoryAfterResolveData = class _ContextModuleFactoryAfterResol
1053
1055
  var MODULE_MAPPINGS = /* @__PURE__ */ new WeakMap();
1054
1056
  var Module = class _Module {
1055
1057
  #inner;
1056
- static __from_binding(binding3) {
1057
- let module2 = MODULE_MAPPINGS.get(binding3);
1058
+ static __from_binding(binding9) {
1059
+ let module2 = MODULE_MAPPINGS.get(binding9);
1058
1060
  if (module2) {
1059
1061
  return module2;
1060
1062
  }
1061
- module2 = new _Module(binding3);
1062
- MODULE_MAPPINGS.set(binding3, module2);
1063
+ module2 = new _Module(binding9);
1064
+ MODULE_MAPPINGS.set(binding9, module2);
1063
1065
  return module2;
1064
1066
  }
1065
1067
  static __to_binding(module2) {
@@ -1106,7 +1108,9 @@ var Module = class _Module {
1106
1108
  return module2.userRequest;
1107
1109
  },
1108
1110
  set(val) {
1109
- module2.userRequest = val;
1111
+ if (val) {
1112
+ module2.userRequest = val;
1113
+ }
1110
1114
  }
1111
1115
  },
1112
1116
  rawRequest: {
@@ -1183,13 +1187,13 @@ var CodeGenerationResult = class {
1183
1187
  var CHUNK_GROUP_MAPPINGS = /* @__PURE__ */ new WeakMap();
1184
1188
  var ChunkGroup = class _ChunkGroup {
1185
1189
  #inner;
1186
- static __from_binding(binding3) {
1187
- let chunkGroup = CHUNK_GROUP_MAPPINGS.get(binding3);
1190
+ static __from_binding(binding9) {
1191
+ let chunkGroup = CHUNK_GROUP_MAPPINGS.get(binding9);
1188
1192
  if (chunkGroup) {
1189
1193
  return chunkGroup;
1190
1194
  }
1191
- chunkGroup = new _ChunkGroup(binding3);
1192
- CHUNK_GROUP_MAPPINGS.set(binding3, chunkGroup);
1195
+ chunkGroup = new _ChunkGroup(binding9);
1196
+ CHUNK_GROUP_MAPPINGS.set(binding9, chunkGroup);
1193
1197
  return chunkGroup;
1194
1198
  }
1195
1199
  constructor(inner) {
@@ -1199,7 +1203,7 @@ var ChunkGroup = class _ChunkGroup {
1199
1203
  enumerable: true,
1200
1204
  get: () => {
1201
1205
  return this.#inner.chunks.map(
1202
- (binding3) => Chunk.__from_binding(binding3)
1206
+ (binding9) => Chunk.__from_binding(binding9)
1203
1207
  );
1204
1208
  }
1205
1209
  },
@@ -1230,7 +1234,7 @@ var ChunkGroup = class _ChunkGroup {
1230
1234
  return this.#inner.getFiles();
1231
1235
  }
1232
1236
  getParents() {
1233
- return this.#inner.getParents().map((binding3) => _ChunkGroup.__from_binding(binding3));
1237
+ return this.#inner.getParents().map((binding9) => _ChunkGroup.__from_binding(binding9));
1234
1238
  }
1235
1239
  isInitial() {
1236
1240
  return this.#inner.isInitial();
@@ -1247,97 +1251,97 @@ var ChunkGroup = class _ChunkGroup {
1247
1251
  var CHUNK_MAPPINGS = /* @__PURE__ */ new WeakMap();
1248
1252
  var Chunk = class _Chunk {
1249
1253
  #inner;
1250
- static __from_binding(binding3) {
1251
- let chunk = CHUNK_MAPPINGS.get(binding3);
1254
+ static __from_binding(binding9) {
1255
+ let chunk = CHUNK_MAPPINGS.get(binding9);
1252
1256
  if (chunk) {
1253
1257
  return chunk;
1254
1258
  }
1255
- chunk = new _Chunk(binding3);
1256
- CHUNK_MAPPINGS.set(binding3, chunk);
1259
+ chunk = new _Chunk(binding9);
1260
+ CHUNK_MAPPINGS.set(binding9, chunk);
1257
1261
  return chunk;
1258
1262
  }
1259
1263
  static __to_binding(chunk) {
1260
1264
  return chunk.#inner;
1261
1265
  }
1262
- constructor(binding3) {
1263
- this.#inner = binding3;
1266
+ constructor(binding9) {
1267
+ this.#inner = binding9;
1264
1268
  Object.defineProperties(this, {
1265
1269
  name: {
1266
1270
  enumerable: true,
1267
1271
  get: () => {
1268
- return binding3.name;
1272
+ return binding9.name;
1269
1273
  }
1270
1274
  },
1271
1275
  id: {
1272
1276
  enumerable: true,
1273
1277
  get: () => {
1274
- return binding3.id;
1278
+ return binding9.id;
1275
1279
  }
1276
1280
  },
1277
1281
  ids: {
1278
1282
  enumerable: true,
1279
1283
  get: () => {
1280
- return binding3.ids;
1284
+ return binding9.ids;
1281
1285
  }
1282
1286
  },
1283
1287
  idNameHints: {
1284
1288
  enumerable: true,
1285
1289
  get: () => {
1286
- return binding3.idNameHints;
1290
+ return binding9.idNameHints;
1287
1291
  }
1288
1292
  },
1289
1293
  filenameTemplate: {
1290
1294
  enumerable: true,
1291
1295
  get: () => {
1292
- return binding3.filenameTemplate;
1296
+ return binding9.filenameTemplate;
1293
1297
  }
1294
1298
  },
1295
1299
  cssFilenameTemplate: {
1296
1300
  enumerable: true,
1297
1301
  get: () => {
1298
- return binding3.cssFilenameTemplate;
1302
+ return binding9.cssFilenameTemplate;
1299
1303
  }
1300
1304
  },
1301
1305
  files: {
1302
1306
  enumerable: true,
1303
1307
  get: () => {
1304
- return new Set(binding3.files);
1308
+ return new Set(binding9.files);
1305
1309
  }
1306
1310
  },
1307
1311
  runtime: {
1308
1312
  enumerable: true,
1309
1313
  get: () => {
1310
- return new Set(binding3.runtime);
1314
+ return new Set(binding9.runtime);
1311
1315
  }
1312
1316
  },
1313
1317
  hash: {
1314
1318
  enumerable: true,
1315
1319
  get: () => {
1316
- return binding3.hash;
1320
+ return binding9.hash;
1317
1321
  }
1318
1322
  },
1319
1323
  contentHash: {
1320
1324
  enumerable: true,
1321
1325
  get: () => {
1322
- return binding3.contentHash;
1326
+ return binding9.contentHash;
1323
1327
  }
1324
1328
  },
1325
1329
  renderedHash: {
1326
1330
  enumerable: true,
1327
1331
  get: () => {
1328
- return binding3.renderedHash;
1332
+ return binding9.renderedHash;
1329
1333
  }
1330
1334
  },
1331
1335
  chunkReason: {
1332
1336
  enumerable: true,
1333
1337
  get: () => {
1334
- return binding3.chunkReason;
1338
+ return binding9.chunkReason;
1335
1339
  }
1336
1340
  },
1337
1341
  auxiliaryFiles: {
1338
1342
  enumerable: true,
1339
1343
  get: () => {
1340
- return new Set(binding3.auxiliaryFiles);
1344
+ return new Set(binding9.auxiliaryFiles);
1341
1345
  }
1342
1346
  }
1343
1347
  });
@@ -1353,7 +1357,7 @@ var Chunk = class _Chunk {
1353
1357
  }
1354
1358
  get groupsIterable() {
1355
1359
  return new Set(
1356
- this.#inner.groups().map((binding3) => ChunkGroup.__from_binding(binding3))
1360
+ this.#inner.groups().map((binding9) => ChunkGroup.__from_binding(binding9))
1357
1361
  );
1358
1362
  }
1359
1363
  getChunkMaps(realHash) {
@@ -1385,17 +1389,17 @@ var Chunk = class _Chunk {
1385
1389
  }
1386
1390
  getAllAsyncChunks() {
1387
1391
  return new Set(
1388
- this.#inner.getAllAsyncChunks().map((binding3) => _Chunk.__from_binding(binding3))
1392
+ this.#inner.getAllAsyncChunks().map((binding9) => _Chunk.__from_binding(binding9))
1389
1393
  );
1390
1394
  }
1391
1395
  getAllInitialChunks() {
1392
1396
  return new Set(
1393
- this.#inner.getAllInitialChunks().map((binding3) => _Chunk.__from_binding(binding3))
1397
+ this.#inner.getAllInitialChunks().map((binding9) => _Chunk.__from_binding(binding9))
1394
1398
  );
1395
1399
  }
1396
1400
  getAllReferencedChunks() {
1397
1401
  return new Set(
1398
- this.#inner.getAllReferencedChunks().map((binding3) => _Chunk.__from_binding(binding3))
1402
+ this.#inner.getAllReferencedChunks().map((binding9) => _Chunk.__from_binding(binding9))
1399
1403
  );
1400
1404
  }
1401
1405
  };
@@ -1403,38 +1407,38 @@ var Chunk = class _Chunk {
1403
1407
  // src/ChunkGraph.ts
1404
1408
  var ChunkGraph = class _ChunkGraph {
1405
1409
  #inner;
1406
- static __from_binding(binding3) {
1407
- return new _ChunkGraph(binding3);
1410
+ static __from_binding(binding9) {
1411
+ return new _ChunkGraph(binding9);
1408
1412
  }
1409
- constructor(binding3) {
1410
- this.#inner = binding3;
1413
+ constructor(binding9) {
1414
+ this.#inner = binding9;
1411
1415
  }
1412
1416
  getChunkModules(chunk) {
1413
- return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1417
+ return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding9) => Module.__from_binding(binding9));
1414
1418
  }
1415
1419
  getChunkModulesIterable(chunk) {
1416
- return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1420
+ return this.#inner.getChunkModules(Chunk.__to_binding(chunk)).map((binding9) => Module.__from_binding(binding9));
1417
1421
  }
1418
1422
  getChunkEntryModulesIterable(chunk) {
1419
- return this.#inner.getChunkEntryModules(Chunk.__to_binding(chunk)).map((binding3) => Module.__from_binding(binding3));
1423
+ return this.#inner.getChunkEntryModules(Chunk.__to_binding(chunk)).map((binding9) => Module.__from_binding(binding9));
1420
1424
  }
1421
1425
  getNumberOfEntryModules(chunk) {
1422
1426
  return this.#inner.getNumberOfEntryModules(Chunk.__to_binding(chunk));
1423
1427
  }
1424
1428
  getChunkEntryDependentChunksIterable(chunk) {
1425
- return this.#inner.getChunkEntryDependentChunksIterable(Chunk.__to_binding(chunk)).map((binding3) => Chunk.__from_binding(binding3));
1429
+ return this.#inner.getChunkEntryDependentChunksIterable(Chunk.__to_binding(chunk)).map((binding9) => Chunk.__from_binding(binding9));
1426
1430
  }
1427
1431
  getChunkModulesIterableBySourceType(chunk, sourceType) {
1428
1432
  return this.#inner.getChunkModulesIterableBySourceType(
1429
1433
  Chunk.__to_binding(chunk),
1430
1434
  sourceType
1431
- ).map((binding3) => Module.__from_binding(binding3));
1435
+ ).map((binding9) => Module.__from_binding(binding9));
1432
1436
  }
1433
1437
  getModuleChunks(module2) {
1434
- return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
1438
+ return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding9) => Chunk.__from_binding(binding9));
1435
1439
  }
1436
1440
  getModuleChunksIterable(module2) {
1437
- return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding3) => Chunk.__from_binding(binding3));
1441
+ return this.#inner.getModuleChunks(Module.__to_binding(module2)).map((binding9) => Chunk.__from_binding(binding9));
1438
1442
  }
1439
1443
  getModuleId(module2) {
1440
1444
  return this.#inner.getModuleId(Module.__to_binding(module2));
@@ -1445,18 +1449,18 @@ var ChunkGraph = class _ChunkGraph {
1445
1449
  var ENTRYPOINT_MAPPINGS = /* @__PURE__ */ new WeakMap();
1446
1450
  var Entrypoint = class _Entrypoint extends ChunkGroup {
1447
1451
  #inner;
1448
- static __from_binding(binding3) {
1449
- let entrypoint = ENTRYPOINT_MAPPINGS.get(binding3);
1452
+ static __from_binding(binding9) {
1453
+ let entrypoint = ENTRYPOINT_MAPPINGS.get(binding9);
1450
1454
  if (entrypoint) {
1451
1455
  return entrypoint;
1452
1456
  }
1453
- entrypoint = new _Entrypoint(binding3);
1454
- ENTRYPOINT_MAPPINGS.set(binding3, entrypoint);
1457
+ entrypoint = new _Entrypoint(binding9);
1458
+ ENTRYPOINT_MAPPINGS.set(binding9, entrypoint);
1455
1459
  return entrypoint;
1456
1460
  }
1457
- constructor(binding3) {
1458
- super(binding3);
1459
- this.#inner = binding3;
1461
+ constructor(binding9) {
1462
+ super(binding9);
1463
+ this.#inner = binding9;
1460
1464
  }
1461
1465
  getRuntimeChunk() {
1462
1466
  const chunkBinding = this.#inner.getRuntimeChunk();
@@ -1480,11 +1484,11 @@ var cutOffLoaderExecution = (stack) => cutOffByFlag(stack, loaderFlag);
1480
1484
  // src/ExportsInfo.ts
1481
1485
  var ExportsInfo = class _ExportsInfo {
1482
1486
  #inner;
1483
- static __from_binding(binding3) {
1484
- return new _ExportsInfo(binding3);
1487
+ static __from_binding(binding9) {
1488
+ return new _ExportsInfo(binding9);
1485
1489
  }
1486
- constructor(binding3) {
1487
- this.#inner = binding3;
1490
+ constructor(binding9) {
1491
+ this.#inner = binding9;
1488
1492
  }
1489
1493
  isUsed(runtime) {
1490
1494
  return this.#inner.isUsed(runtime);
@@ -1504,31 +1508,31 @@ var ExportsInfo = class _ExportsInfo {
1504
1508
  var MODULE_GRAPH_CONNECTION_MAPPINGS = /* @__PURE__ */ new WeakMap();
1505
1509
  var ModuleGraphConnection = class _ModuleGraphConnection {
1506
1510
  #inner;
1507
- static __from_binding(binding3) {
1508
- let connection = MODULE_GRAPH_CONNECTION_MAPPINGS.get(binding3);
1511
+ static __from_binding(binding9) {
1512
+ let connection = MODULE_GRAPH_CONNECTION_MAPPINGS.get(binding9);
1509
1513
  if (connection) {
1510
1514
  return connection;
1511
1515
  }
1512
- connection = new _ModuleGraphConnection(binding3);
1513
- MODULE_GRAPH_CONNECTION_MAPPINGS.set(binding3, connection);
1516
+ connection = new _ModuleGraphConnection(binding9);
1517
+ MODULE_GRAPH_CONNECTION_MAPPINGS.set(binding9, connection);
1514
1518
  return connection;
1515
1519
  }
1516
1520
  static __to_binding(data) {
1517
1521
  return data.#inner;
1518
1522
  }
1519
- constructor(binding3) {
1520
- this.#inner = binding3;
1523
+ constructor(binding9) {
1524
+ this.#inner = binding9;
1521
1525
  Object.defineProperties(this, {
1522
1526
  module: {
1523
1527
  enumerable: true,
1524
1528
  get() {
1525
- return binding3.module ? Module.__from_binding(binding3.module) : null;
1529
+ return binding9.module ? Module.__from_binding(binding9.module) : null;
1526
1530
  }
1527
1531
  },
1528
1532
  dependency: {
1529
1533
  enumerable: true,
1530
1534
  get() {
1531
- return Dependency.__from_binding(binding3.dependency);
1535
+ return Dependency.__from_binding(binding9.dependency);
1532
1536
  }
1533
1537
  }
1534
1538
  });
@@ -1537,26 +1541,26 @@ var ModuleGraphConnection = class _ModuleGraphConnection {
1537
1541
 
1538
1542
  // src/ModuleGraph.ts
1539
1543
  var ModuleGraph = class _ModuleGraph {
1540
- static __from_binding(binding3) {
1541
- return new _ModuleGraph(binding3);
1544
+ static __from_binding(binding9) {
1545
+ return new _ModuleGraph(binding9);
1542
1546
  }
1543
1547
  #inner;
1544
- constructor(binding3) {
1545
- this.#inner = binding3;
1548
+ constructor(binding9) {
1549
+ this.#inner = binding9;
1546
1550
  }
1547
1551
  getModule(dependency) {
1548
- const binding3 = this.#inner.getModule(Dependency.__to_binding(dependency));
1549
- return binding3 ? Module.__from_binding(binding3) : null;
1552
+ const binding9 = this.#inner.getModule(Dependency.__to_binding(dependency));
1553
+ return binding9 ? Module.__from_binding(binding9) : null;
1550
1554
  }
1551
1555
  getResolvedModule(dependency) {
1552
- const binding3 = this.#inner.getResolvedModule(
1556
+ const binding9 = this.#inner.getResolvedModule(
1553
1557
  Dependency.__to_binding(dependency)
1554
1558
  );
1555
- return binding3 ? Module.__from_binding(binding3) : null;
1559
+ return binding9 ? Module.__from_binding(binding9) : null;
1556
1560
  }
1557
1561
  getIssuer(module2) {
1558
- const binding3 = this.#inner.getIssuer(Module.__to_binding(module2));
1559
- return binding3 ? Module.__from_binding(binding3) : null;
1562
+ const binding9 = this.#inner.getIssuer(Module.__to_binding(module2));
1563
+ return binding9 ? Module.__from_binding(binding9) : null;
1560
1564
  }
1561
1565
  getExportsInfo(module2) {
1562
1566
  return ExportsInfo.__from_binding(
@@ -1564,13 +1568,13 @@ var ModuleGraph = class _ModuleGraph {
1564
1568
  );
1565
1569
  }
1566
1570
  getConnection(dependency) {
1567
- const binding3 = this.#inner.getConnection(
1571
+ const binding9 = this.#inner.getConnection(
1568
1572
  Dependency.__to_binding(dependency)
1569
1573
  );
1570
- return binding3 ? ModuleGraphConnection.__from_binding(binding3) : null;
1574
+ return binding9 ? ModuleGraphConnection.__from_binding(binding9) : null;
1571
1575
  }
1572
1576
  getOutgoingConnections(module2) {
1573
- return this.#inner.getOutgoingConnections(Module.__to_binding(module2)).map((binding3) => ModuleGraphConnection.__from_binding(binding3));
1577
+ return this.#inner.getOutgoingConnections(Module.__to_binding(module2)).map((binding9) => ModuleGraphConnection.__from_binding(binding9));
1574
1578
  }
1575
1579
  };
1576
1580
 
@@ -3057,7 +3061,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3057
3061
  }
3058
3062
  get chunkGroups() {
3059
3063
  return memoizeValue(
3060
- () => __privateGet(this, _inner).chunkGroups.map((binding3) => ChunkGroup.__from_binding(binding3))
3064
+ () => __privateGet(this, _inner).chunkGroups.map((binding9) => ChunkGroup.__from_binding(binding9))
3061
3065
  );
3062
3066
  }
3063
3067
  /**
@@ -3073,8 +3077,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3073
3077
  },
3074
3078
  get: (property) => {
3075
3079
  if (typeof property === "string") {
3076
- const binding3 = __privateGet(this, _inner).getNamedChunkGroup(property);
3077
- return ChunkGroup.__from_binding(binding3);
3080
+ const binding9 = __privateGet(this, _inner).getNamedChunkGroup(property);
3081
+ return ChunkGroup.__from_binding(binding9);
3078
3082
  }
3079
3083
  }
3080
3084
  });
@@ -3105,8 +3109,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3105
3109
  },
3106
3110
  get: (property) => {
3107
3111
  if (typeof property === "string") {
3108
- const binding3 = __privateGet(this, _inner).getNamedChunk(property);
3109
- return Chunk.__from_binding(binding3);
3112
+ const binding9 = __privateGet(this, _inner).getNamedChunk(property);
3113
+ return Chunk.__from_binding(binding9);
3110
3114
  }
3111
3115
  }
3112
3116
  });
@@ -3643,7 +3647,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
3643
3647
  * @internal
3644
3648
  */
3645
3649
  __internal__getChunks() {
3646
- return __privateGet(this, _inner).getChunks().map((binding3) => Chunk.__from_binding(binding3));
3650
+ return __privateGet(this, _inner).getChunks().map((binding9) => Chunk.__from_binding(binding9));
3647
3651
  }
3648
3652
  /**
3649
3653
  * Note: This is not a webpack public API, maybe removed in future.
@@ -3761,8 +3765,8 @@ var AddIncludeDispatcher = class {
3761
3765
  }
3762
3766
  });
3763
3767
  };
3764
- constructor(binding3) {
3765
- this.#inner = binding3;
3768
+ constructor(binding9) {
3769
+ this.#inner = binding9;
3766
3770
  this.#running = false;
3767
3771
  }
3768
3772
  call(context2, dependency, options, callback) {
@@ -3774,15 +3778,15 @@ var AddIncludeDispatcher = class {
3774
3778
  }
3775
3779
  };
3776
3780
  var EntryData = class _EntryData {
3777
- static __from_binding(binding3) {
3778
- return new _EntryData(binding3);
3781
+ static __from_binding(binding9) {
3782
+ return new _EntryData(binding9);
3779
3783
  }
3780
- constructor(binding3) {
3781
- this.dependencies = binding3.dependencies.map(Dependency.__from_binding);
3782
- this.includeDependencies = binding3.includeDependencies.map(
3784
+ constructor(binding9) {
3785
+ this.dependencies = binding9.dependencies.map(Dependency.__from_binding);
3786
+ this.includeDependencies = binding9.includeDependencies.map(
3783
3787
  Dependency.__from_binding
3784
3788
  );
3785
- this.options = binding3.options;
3789
+ this.options = binding9.options;
3786
3790
  }
3787
3791
  };
3788
3792
  var Entries = class {
@@ -3794,8 +3798,8 @@ var Entries = class {
3794
3798
  this.#data.clear();
3795
3799
  }
3796
3800
  forEach(callback, thisArg) {
3797
- for (const [key, binding3] of this) {
3798
- const value = EntryData.__from_binding(binding3);
3801
+ for (const [key, binding9] of this) {
3802
+ const value = EntryData.__from_binding(binding9);
3799
3803
  callback.call(thisArg, value, key, this);
3800
3804
  }
3801
3805
  }
@@ -3827,8 +3831,8 @@ var Entries = class {
3827
3831
  return this.#data.delete(key);
3828
3832
  }
3829
3833
  get(key) {
3830
- const binding3 = this.#data.get(key);
3831
- return binding3 ? EntryData.__from_binding(binding3) : void 0;
3834
+ const binding9 = this.#data.get(key);
3835
+ return binding9 ? EntryData.__from_binding(binding9) : void 0;
3832
3836
  }
3833
3837
  keys() {
3834
3838
  return this.#data.keys()[Symbol.iterator]();
@@ -3836,8 +3840,7 @@ var Entries = class {
3836
3840
  };
3837
3841
 
3838
3842
  // src/Compiler.ts
3839
- var binding2 = __toESM(require("@rspack/binding"));
3840
- var liteTapable7 = __toESM(require("@rspack/lite-tapable"));
3843
+ var liteTapable8 = __toESM(require("@rspack/lite-tapable"));
3841
3844
 
3842
3845
  // src/ExecuteModulePlugin.ts
3843
3846
  var import_node_vm = __toESM(require("vm"));
@@ -4859,395 +4862,52 @@ var CacheFacade = class _CacheFacade {
4859
4862
  };
4860
4863
  var CacheFacade_default = CacheFacade;
4861
4864
 
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
- }
4865
+ // src/builtin-plugin/base.ts
4866
+ var HOOKS_CAN_NOT_INHERENT_FROM_PARENT = [
4867
+ "make",
4868
+ "compile",
4869
+ "emit",
4870
+ "afterEmit",
4871
+ "invalid",
4872
+ "done",
4873
+ "thisCompilation"
4874
+ ];
4875
+ function canInherentFromParent(affectedHooks) {
4876
+ if (typeof affectedHooks === "undefined") {
4877
+ return false;
4872
4878
  }
4873
- return res;
4879
+ return !HOOKS_CAN_NOT_INHERENT_FROM_PARENT.includes(affectedHooks);
4874
4880
  }
4875
- function __to_binding_runtime_globals(runtimeRequirements) {
4876
- const res = {
4877
- value: []
4881
+ var RspackBuiltinPlugin = class {
4882
+ apply(compiler) {
4883
+ const raw = this.raw(compiler);
4884
+ if (raw) {
4885
+ raw.canInherentFromParent = canInherentFromParent(this.affectedHooks);
4886
+ compiler.__internal__registerBuiltinPlugin(raw);
4887
+ }
4888
+ }
4889
+ };
4890
+ function createBuiltinPlugin(name2, options) {
4891
+ return {
4892
+ name: name2,
4893
+ options: options ?? false
4894
+ // undefined or null will cause napi error, so false for fallback
4878
4895
  };
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);
4896
+ }
4897
+ function create2(name2, resolve2, affectedHooks) {
4898
+ class Plugin extends RspackBuiltinPlugin {
4899
+ constructor(...args) {
4900
+ super();
4901
+ this.name = name2;
4902
+ this.affectedHooks = affectedHooks;
4903
+ this._args = args;
4904
+ }
4905
+ raw(compiler) {
4906
+ return createBuiltinPlugin(name2, resolve2.apply(compiler, this._args));
4885
4907
  }
4886
4908
  }
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;
4909
+ Object.defineProperty(Plugin, "name", { value: name2 });
4910
+ return Plugin;
5251
4911
  }
5252
4912
 
5253
4913
  // src/builtin-plugin/APIPlugin.ts
@@ -6463,32 +6123,49 @@ function getCurrentLoader(loaderContext, index = loaderContext.loaderIndex) {
6463
6123
  }
6464
6124
  return null;
6465
6125
  }
6466
- var tracingCache;
6467
- async function tryTrace(context2) {
6126
+ var cachedTracing;
6127
+ async function getCachedTracing() {
6468
6128
  if (!process.env.RSPACK_PROFILE) {
6469
- return {};
6129
+ cachedTracing = null;
6130
+ return cachedTracing;
6470
6131
  }
6471
- try {
6472
- const {
6473
- trace,
6474
- propagation,
6475
- context: tracingContext
6476
- } = await import("@rspack/tracing");
6132
+ if (cachedTracing) {
6133
+ return cachedTracing;
6134
+ }
6135
+ if (cachedTracing === void 0) {
6136
+ try {
6137
+ const tracing = await import("@rspack/tracing");
6138
+ cachedTracing = {
6139
+ trace: tracing.trace,
6140
+ propagation: tracing.propagation,
6141
+ context: tracing.context
6142
+ };
6143
+ return cachedTracing;
6144
+ } catch (e) {
6145
+ cachedTracing = null;
6146
+ return cachedTracing;
6147
+ }
6148
+ } else {
6149
+ cachedTracing = null;
6150
+ return cachedTracing;
6151
+ }
6152
+ }
6153
+ async function tryTrace(context2) {
6154
+ const cachedTracing2 = await getCachedTracing();
6155
+ if (cachedTracing2) {
6156
+ const { trace, propagation, context: tracingContext } = cachedTracing2;
6477
6157
  const tracer = trace.getTracer("rspack-loader-runner");
6478
6158
  const activeContext = propagation.extract(
6479
6159
  tracingContext.active(),
6480
6160
  context2.__internal__tracingCarrier
6481
6161
  );
6482
- tracingCache = { tracer, activeContext };
6483
- return tracingCache;
6484
- } catch (error) {
6485
- tracingCache = {};
6486
- return tracingCache;
6162
+ return { trace, tracer, activeContext };
6487
6163
  }
6164
+ return null;
6488
6165
  }
6489
6166
  async function runLoaders(compiler, context2) {
6490
6167
  var _a, _b;
6491
- const { tracer, activeContext } = await tryTrace(context2);
6168
+ const { tracer, activeContext } = await tryTrace(context2) ?? {};
6492
6169
  const loaderState = context2.loaderState;
6493
6170
  const { resource } = context2.resourceData;
6494
6171
  const splittedResource = resource && parsePathQueryFragment(resource);
@@ -7090,7 +6767,7 @@ var getRawOptions = (options, compiler) => {
7090
6767
  experiments: experiments3,
7091
6768
  node: getRawNode(options.node),
7092
6769
  profile: options.profile,
7093
- amd: options.amd !== false ? JSON.stringify(options.amd || {}) : void 0,
6770
+ amd: options.amd ? JSON.stringify(options.amd || {}) : void 0,
7094
6771
  bail: options.bail,
7095
6772
  __references: {}
7096
6773
  };
@@ -9488,7 +9165,7 @@ var getResolveDefaults = ({
9488
9165
  });
9489
9166
  const resolveOptions2 = {
9490
9167
  // 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
9168
+ // IGNORE(resolve.pnp): Rspack use `resolve.enable` to enable Yarn PnP feature
9492
9169
  pnp: !!process.versions.pnp,
9493
9170
  modules: ["node_modules"],
9494
9171
  conditionNames: conditions,
@@ -11079,8 +10756,8 @@ function isString(value) {
11079
10756
  return typeof value === "string";
11080
10757
  }
11081
10758
  var Resolver = class _Resolver {
11082
- constructor(binding3) {
11083
- this.binding = binding3;
10759
+ constructor(binding9) {
10760
+ this.binding = binding9;
11084
10761
  }
11085
10762
  resolveSync(context2, path11, request) {
11086
10763
  return this.binding.resolveSync(path11, request);
@@ -11102,12 +10779,12 @@ var Resolver = class _Resolver {
11102
10779
  if (Array.isArray(rawResolve.restrictions)) {
11103
10780
  rawResolve.restrictions = rawResolve.restrictions.filter(isString);
11104
10781
  }
11105
- const binding3 = this.binding.withOptions({
10782
+ const binding9 = this.binding.withOptions({
11106
10783
  dependencyCategory,
11107
10784
  resolveToContext,
11108
10785
  ...rawResolve
11109
10786
  });
11110
- return new _Resolver(binding3);
10787
+ return new _Resolver(binding9);
11111
10788
  }
11112
10789
  };
11113
10790
 
@@ -11300,11 +10977,43 @@ var HotModuleReplacementPlugin = class extends RspackBuiltinPlugin {
11300
10977
  }
11301
10978
  };
11302
10979
 
11303
- // src/builtin-plugin/HtmlRspackPlugin.ts
10980
+ // src/builtin-plugin/html-plugin/plugin.ts
11304
10981
  var import_node_fs2 = __toESM(require("fs"));
11305
10982
  var import_node_path9 = __toESM(require("path"));
11306
10983
  var import_binding33 = require("@rspack/binding");
10984
+
10985
+ // src/builtin-plugin/html-plugin/hooks.ts
11307
10986
  var liteTapable3 = __toESM(require("@rspack/lite-tapable"));
10987
+ var compilationHooksMap2 = /* @__PURE__ */ new WeakMap();
10988
+ var getPluginHooks = (compilation) => {
10989
+ if (!(compilation instanceof Compilation)) {
10990
+ throw new TypeError(
10991
+ "The 'compilation' argument must be an instance of Compilation"
10992
+ );
10993
+ }
10994
+ let hooks = compilationHooksMap2.get(compilation);
10995
+ if (hooks === void 0) {
10996
+ hooks = {
10997
+ beforeAssetTagGeneration: new liteTapable3.AsyncSeriesWaterfallHook([
10998
+ "data"
10999
+ ]),
11000
+ alterAssetTags: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
11001
+ alterAssetTagGroups: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
11002
+ afterTemplateExecution: new liteTapable3.AsyncSeriesWaterfallHook([
11003
+ "data"
11004
+ ]),
11005
+ beforeEmit: new liteTapable3.AsyncSeriesWaterfallHook(["data"]),
11006
+ afterEmit: new liteTapable3.AsyncSeriesWaterfallHook(["data"])
11007
+ };
11008
+ compilationHooksMap2.set(compilation, hooks);
11009
+ }
11010
+ return hooks;
11011
+ };
11012
+ var cleanPluginHooks = (compilation) => {
11013
+ compilationHooksMap2.delete(compilation);
11014
+ };
11015
+
11016
+ // src/builtin-plugin/html-plugin/options.ts
11308
11017
  var import_zod3 = require("../compiled/zod/index.js");
11309
11018
 
11310
11019
  // ../../node_modules/.pnpm/zod-validation-error@3.4.0_zod@3.23.8/node_modules/zod-validation-error/dist/index.mjs
@@ -11555,7 +11264,8 @@ function isValidate(opts, schema) {
11555
11264
  }
11556
11265
  }
11557
11266
 
11558
- // src/builtin-plugin/HtmlRspackPlugin.ts
11267
+ // src/builtin-plugin/html-plugin/options.ts
11268
+ var compilationOptionsMap = /* @__PURE__ */ new WeakMap();
11559
11269
  var templateRenderFunction = import_zod3.z.function().args(import_zod3.z.record(import_zod3.z.string(), import_zod3.z.any())).returns(
11560
11270
  import_zod3.z.string().or(import_zod3.z.promise(import_zod3.z.string()))
11561
11271
  );
@@ -11563,7 +11273,7 @@ var templateParamFunction = import_zod3.z.function().args(import_zod3.z.record(i
11563
11273
  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
11274
  );
11565
11275
  var templateFilenameFunction = import_zod3.z.function().args(import_zod3.z.string()).returns(import_zod3.z.string());
11566
- var htmlRspackPluginOptions = import_zod3.z.strictObject({
11276
+ var pluginOptionsSchema = import_zod3.z.strictObject({
11567
11277
  filename: import_zod3.z.string().or(templateFilenameFunction).optional(),
11568
11278
  template: import_zod3.z.string().refine(
11569
11279
  (val) => !val.includes("!"),
@@ -11592,10 +11302,29 @@ var htmlRspackPluginOptions = import_zod3.z.strictObject({
11592
11302
  meta: import_zod3.z.record(import_zod3.z.string().or(import_zod3.z.record(import_zod3.z.string()))).optional(),
11593
11303
  hash: import_zod3.z.boolean().optional()
11594
11304
  });
11305
+ function validateHtmlPluginOptions(options) {
11306
+ return validate(options, pluginOptionsSchema);
11307
+ }
11308
+ var getPluginOptions = (compilation) => {
11309
+ if (!(compilation instanceof Compilation)) {
11310
+ throw new TypeError(
11311
+ "The 'compilation' argument must be an instance of Compilation"
11312
+ );
11313
+ }
11314
+ return compilationOptionsMap.get(compilation);
11315
+ };
11316
+ var setPluginOptions = (compilation, options) => {
11317
+ compilationOptionsMap.set(compilation, options);
11318
+ };
11319
+ var cleanPluginOptions = (compilation) => {
11320
+ compilationOptionsMap.delete(compilation);
11321
+ };
11322
+
11323
+ // src/builtin-plugin/html-plugin/plugin.ts
11595
11324
  var HtmlRspackPluginImpl = create2(
11596
11325
  import_binding33.BuiltinPluginName.HtmlRspackPlugin,
11597
11326
  function(c = {}) {
11598
- validate(c, htmlRspackPluginOptions);
11327
+ validateHtmlPluginOptions(c);
11599
11328
  const meta = {};
11600
11329
  for (const key in c.meta) {
11601
11330
  const value = c.meta[key];
@@ -11619,11 +11348,11 @@ var HtmlRspackPluginImpl = create2(
11619
11348
  let compilation = null;
11620
11349
  this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance) => {
11621
11350
  compilation = compilationInstance;
11622
- compilationOptionsMap.set(compilation, c);
11351
+ setPluginOptions(compilation, c);
11623
11352
  });
11624
11353
  this.hooks.done.tap("HtmlRspackPlugin", (stats) => {
11625
- compilationHooksMap2.delete(stats.compilation);
11626
- compilationOptionsMap.delete(stats.compilation);
11354
+ cleanPluginHooks(stats.compilation);
11355
+ cleanPluginOptions(stats.compilation);
11627
11356
  });
11628
11357
  function generateRenderData(data) {
11629
11358
  var _a, _b, _c, _d;
@@ -11769,8 +11498,6 @@ function htmlTagObjectToString(tag) {
11769
11498
  const res = `<${[tag.tagName].concat(attributes).join(" ")}${tag.voidTag && !tag.innerHTML ? "/" : ""}>${tag.innerHTML || ""}${tag.voidTag && !tag.innerHTML ? "" : `</${tag.tagName}>`}`;
11770
11499
  return res;
11771
11500
  }
11772
- var compilationHooksMap2 = /* @__PURE__ */ new WeakMap();
11773
- var compilationOptionsMap = /* @__PURE__ */ new WeakMap();
11774
11501
  var HtmlRspackPlugin = HtmlRspackPluginImpl;
11775
11502
  var voidTags = [
11776
11503
  "area",
@@ -11797,49 +11524,19 @@ HtmlRspackPlugin.createHtmlTagObject = (tagName, attributes, innerHTML) => {
11797
11524
  innerHTML
11798
11525
  };
11799
11526
  };
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
- };
11832
- HtmlRspackPlugin.version = 5;
11833
-
11834
- // src/builtin-plugin/HttpExternalsRspackPlugin.ts
11835
- var import_binding34 = require("@rspack/binding");
11836
- var HttpExternalsRspackPlugin = create2(
11837
- import_binding34.BuiltinPluginName.HttpExternalsRspackPlugin,
11838
- (css, webAsync) => {
11839
- return {
11840
- css,
11841
- webAsync
11842
- };
11527
+ HtmlRspackPlugin.getCompilationOptions = getPluginOptions;
11528
+ HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = getPluginHooks;
11529
+ HtmlRspackPlugin.version = 5;
11530
+
11531
+ // src/builtin-plugin/HttpExternalsRspackPlugin.ts
11532
+ var import_binding34 = require("@rspack/binding");
11533
+ var HttpExternalsRspackPlugin = create2(
11534
+ import_binding34.BuiltinPluginName.HttpExternalsRspackPlugin,
11535
+ (css, webAsync) => {
11536
+ return {
11537
+ css,
11538
+ webAsync
11539
+ };
11843
11540
  }
11844
11541
  );
11845
11542
 
@@ -12354,27 +12051,90 @@ var RuntimeChunkPlugin = create2(
12354
12051
  );
12355
12052
 
12356
12053
  // src/builtin-plugin/RuntimePlugin.ts
12357
- var import_binding57 = require("@rspack/binding");
12358
- var RuntimePlugin = create2(
12359
- import_binding57.BuiltinPluginName.RuntimePlugin,
12054
+ var binding = __toESM(require("@rspack/binding"));
12055
+ var liteTapable5 = __toESM(require("@rspack/lite-tapable"));
12056
+ var RuntimePluginImpl = create2(
12057
+ binding.BuiltinPluginName.RuntimePlugin,
12360
12058
  () => {
12361
12059
  },
12362
12060
  "compilation"
12363
12061
  );
12062
+ var RuntimePlugin = RuntimePluginImpl;
12063
+ var compilationHooksMap4 = /* @__PURE__ */ new WeakMap();
12064
+ RuntimePlugin.getHooks = RuntimePlugin.getCompilationHooks = (compilation) => {
12065
+ if (!(compilation instanceof Compilation)) {
12066
+ throw new TypeError(
12067
+ "The 'compilation' argument must be an instance of Compilation"
12068
+ );
12069
+ }
12070
+ let hooks = compilationHooksMap4.get(compilation);
12071
+ if (hooks === void 0) {
12072
+ hooks = {
12073
+ createScript: new liteTapable5.SyncWaterfallHook(["code", "chunk"]),
12074
+ linkPreload: new liteTapable5.SyncWaterfallHook(["code", "chunk"]),
12075
+ linkPrefetch: new liteTapable5.SyncWaterfallHook(["code", "chunk"])
12076
+ };
12077
+ compilationHooksMap4.set(compilation, hooks);
12078
+ }
12079
+ return hooks;
12080
+ };
12081
+ var createRuntimePluginHooksRegisters = (getCompiler, createTap, createMapTap) => {
12082
+ return {
12083
+ registerRuntimePluginCreateScriptTaps: createTap(
12084
+ binding.RegisterJsTapKind.RuntimePluginCreateScript,
12085
+ function() {
12086
+ return RuntimePlugin.getCompilationHooks(
12087
+ getCompiler().__internal__get_compilation()
12088
+ ).createScript;
12089
+ },
12090
+ function(queried) {
12091
+ return function(data) {
12092
+ return queried.call(data.code, Chunk.__from_binding(data.chunk));
12093
+ };
12094
+ }
12095
+ ),
12096
+ registerRuntimePluginLinkPreloadTaps: createTap(
12097
+ binding.RegisterJsTapKind.RuntimePluginLinkPreload,
12098
+ function() {
12099
+ return RuntimePlugin.getCompilationHooks(
12100
+ getCompiler().__internal__get_compilation()
12101
+ ).linkPreload;
12102
+ },
12103
+ function(queried) {
12104
+ return function(data) {
12105
+ return queried.call(data.code, Chunk.__from_binding(data.chunk));
12106
+ };
12107
+ }
12108
+ ),
12109
+ registerRuntimePluginLinkPrefetchTaps: createTap(
12110
+ binding.RegisterJsTapKind.RuntimePluginLinkPrefetch,
12111
+ function() {
12112
+ return RuntimePlugin.getCompilationHooks(
12113
+ getCompiler().__internal__get_compilation()
12114
+ ).linkPrefetch;
12115
+ },
12116
+ function(queried) {
12117
+ return function(data) {
12118
+ return queried.call(data.code, Chunk.__from_binding(data.chunk));
12119
+ };
12120
+ }
12121
+ )
12122
+ };
12123
+ };
12364
12124
 
12365
12125
  // src/builtin-plugin/SideEffectsFlagPlugin.ts
12366
- var import_binding58 = require("@rspack/binding");
12126
+ var import_binding57 = require("@rspack/binding");
12367
12127
  var SideEffectsFlagPlugin = create2(
12368
- import_binding58.BuiltinPluginName.SideEffectsFlagPlugin,
12128
+ import_binding57.BuiltinPluginName.SideEffectsFlagPlugin,
12369
12129
  () => {
12370
12130
  },
12371
12131
  "compilation"
12372
12132
  );
12373
12133
 
12374
12134
  // src/builtin-plugin/SizeLimitsPlugin.ts
12375
- var import_binding59 = require("@rspack/binding");
12135
+ var import_binding58 = require("@rspack/binding");
12376
12136
  var SizeLimitsPlugin = create2(
12377
- import_binding59.BuiltinPluginName.SizeLimitsPlugin,
12137
+ import_binding58.BuiltinPluginName.SizeLimitsPlugin,
12378
12138
  (options) => {
12379
12139
  const hints = options.hints === false ? void 0 : options.hints;
12380
12140
  return { ...options, hints };
@@ -12382,16 +12142,16 @@ var SizeLimitsPlugin = create2(
12382
12142
  );
12383
12143
 
12384
12144
  // src/builtin-plugin/SourceMapDevToolPlugin.ts
12385
- var import_binding60 = require("@rspack/binding");
12145
+ var import_binding59 = require("@rspack/binding");
12386
12146
  var SourceMapDevToolPlugin = create2(
12387
- import_binding60.BuiltinPluginName.SourceMapDevToolPlugin,
12147
+ import_binding59.BuiltinPluginName.SourceMapDevToolPlugin,
12388
12148
  (options) => options,
12389
12149
  "compilation"
12390
12150
  );
12391
12151
 
12392
12152
  // src/builtin-plugin/SplitChunksPlugin.ts
12393
12153
  var import_node_assert5 = __toESM(require("assert"));
12394
- var import_binding61 = require("@rspack/binding");
12154
+ var import_binding60 = require("@rspack/binding");
12395
12155
 
12396
12156
  // src/util/SplitChunkSize.ts
12397
12157
  var JsSplitChunkSizes = class {
@@ -12414,7 +12174,7 @@ var SplitChunksPlugin = class extends RspackBuiltinPlugin {
12414
12174
  constructor(options) {
12415
12175
  super();
12416
12176
  this.options = options;
12417
- this.name = import_binding61.BuiltinPluginName.SplitChunksPlugin;
12177
+ this.name = import_binding60.BuiltinPluginName.SplitChunksPlugin;
12418
12178
  this.affectedHooks = "thisCompilation";
12419
12179
  }
12420
12180
  raw(compiler) {
@@ -12513,9 +12273,9 @@ function toRawSplitChunksOptions(sc, compiler) {
12513
12273
  }
12514
12274
 
12515
12275
  // src/builtin-plugin/LightningCssMinimizerRspackPlugin.ts
12516
- var import_binding62 = require("@rspack/binding");
12276
+ var import_binding61 = require("@rspack/binding");
12517
12277
  var LightningCssMinimizerRspackPlugin = create2(
12518
- import_binding62.BuiltinPluginName.LightningCssMinimizerRspackPlugin,
12278
+ import_binding61.BuiltinPluginName.LightningCssMinimizerRspackPlugin,
12519
12279
  (options) => {
12520
12280
  var _a, _b, _c;
12521
12281
  const { include, exclude, draft, nonStandard, pseudoClasses, drafts } = (options == null ? void 0 : options.minimizerOptions) ?? {};
@@ -12543,16 +12303,16 @@ var LightningCssMinimizerRspackPlugin = create2(
12543
12303
  );
12544
12304
 
12545
12305
  // src/builtin-plugin/RemoveDuplicateModulesPlugin.ts
12546
- var import_binding63 = require("@rspack/binding");
12306
+ var import_binding62 = require("@rspack/binding");
12547
12307
  var RemoveDuplicateModulesPlugin = create2(
12548
- import_binding63.BuiltinPluginName.RemoveDuplicateModulesPlugin,
12308
+ import_binding62.BuiltinPluginName.RemoveDuplicateModulesPlugin,
12549
12309
  () => {
12550
12310
  return {};
12551
12311
  }
12552
12312
  );
12553
12313
 
12554
12314
  // src/builtin-plugin/SwcJsMinimizerPlugin.ts
12555
- var import_binding64 = require("@rspack/binding");
12315
+ var import_binding63 = require("@rspack/binding");
12556
12316
  function isObject2(value) {
12557
12317
  const type = typeof value;
12558
12318
  return value != null && (type === "object" || type === "function");
@@ -12595,7 +12355,7 @@ function getRawExtractCommentsOptions(extractComments) {
12595
12355
  return void 0;
12596
12356
  }
12597
12357
  var SwcJsMinimizerRspackPlugin = create2(
12598
- import_binding64.BuiltinPluginName.SwcJsMinimizerRspackPlugin,
12358
+ import_binding63.BuiltinPluginName.SwcJsMinimizerRspackPlugin,
12599
12359
  (options) => {
12600
12360
  var _a, _b, _c, _d, _e;
12601
12361
  let compress = ((_a = options == null ? void 0 : options.minimizerOptions) == null ? void 0 : _a.compress) ?? true;
@@ -12633,20 +12393,20 @@ var SwcJsMinimizerRspackPlugin = create2(
12633
12393
  );
12634
12394
 
12635
12395
  // src/builtin-plugin/WarnCaseSensitiveModulesPlugin.ts
12636
- var import_binding65 = require("@rspack/binding");
12396
+ var import_binding64 = require("@rspack/binding");
12637
12397
  var WarnCaseSensitiveModulesPlugin = create2(
12638
- import_binding65.BuiltinPluginName.WarnCaseSensitiveModulesPlugin,
12398
+ import_binding64.BuiltinPluginName.WarnCaseSensitiveModulesPlugin,
12639
12399
  () => {
12640
12400
  },
12641
12401
  "compilation"
12642
12402
  );
12643
12403
 
12644
12404
  // src/builtin-plugin/WebWorkerTemplatePlugin.ts
12645
- var import_binding66 = require("@rspack/binding");
12405
+ var import_binding65 = require("@rspack/binding");
12646
12406
  var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
12647
12407
  constructor() {
12648
12408
  super(...arguments);
12649
- this.name = import_binding66.BuiltinPluginName.WebWorkerTemplatePlugin;
12409
+ this.name = import_binding65.BuiltinPluginName.WebWorkerTemplatePlugin;
12650
12410
  }
12651
12411
  raw(compiler) {
12652
12412
  compiler.options.output.chunkLoading = "import-scripts";
@@ -12655,7 +12415,7 @@ var WebWorkerTemplatePlugin = class extends RspackBuiltinPlugin {
12655
12415
  };
12656
12416
 
12657
12417
  // src/builtin-plugin/WorkerPlugin.ts
12658
- var import_binding67 = require("@rspack/binding");
12418
+ var import_binding66 = require("@rspack/binding");
12659
12419
  var WorkerPlugin = class extends RspackBuiltinPlugin {
12660
12420
  constructor(chunkLoading2, wasmLoading2, module2, workerPublicPath2) {
12661
12421
  super();
@@ -12663,7 +12423,7 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
12663
12423
  this.wasmLoading = wasmLoading2;
12664
12424
  this.module = module2;
12665
12425
  this.workerPublicPath = workerPublicPath2;
12666
- this.name = import_binding67.BuiltinPluginName.WorkerPlugin;
12426
+ this.name = import_binding66.BuiltinPluginName.WorkerPlugin;
12667
12427
  }
12668
12428
  raw(compiler) {
12669
12429
  if (this.chunkLoading) {
@@ -12677,25 +12437,25 @@ var WorkerPlugin = class extends RspackBuiltinPlugin {
12677
12437
  };
12678
12438
 
12679
12439
  // src/builtin-plugin/FetchCompileAsyncWasmPlugin.ts
12680
- var import_binding68 = require("@rspack/binding");
12440
+ var import_binding67 = require("@rspack/binding");
12681
12441
  var FetchCompileAsyncWasmPlugin = create2(
12682
- import_binding68.BuiltinPluginName.FetchCompileAsyncWasmPlugin,
12442
+ import_binding67.BuiltinPluginName.FetchCompileAsyncWasmPlugin,
12683
12443
  () => {
12684
12444
  },
12685
12445
  "thisCompilation"
12686
12446
  );
12687
12447
 
12688
12448
  // src/builtin-plugin/NoEmitOnErrorsPlugin.ts
12689
- var import_binding69 = require("@rspack/binding");
12449
+ var import_binding68 = require("@rspack/binding");
12690
12450
  var NoEmitOnErrorsPlugin = create2(
12691
- import_binding69.BuiltinPluginName.NoEmitOnErrorsPlugin,
12451
+ import_binding68.BuiltinPluginName.NoEmitOnErrorsPlugin,
12692
12452
  () => void 0
12693
12453
  );
12694
12454
 
12695
12455
  // src/builtin-plugin/ContextReplacementPlugin.ts
12696
- var import_binding70 = require("@rspack/binding");
12456
+ var import_binding69 = require("@rspack/binding");
12697
12457
  var ContextReplacementPlugin = create2(
12698
- import_binding70.BuiltinPluginName.ContextReplacementPlugin,
12458
+ import_binding69.BuiltinPluginName.ContextReplacementPlugin,
12699
12459
  (resourceRegExp, newContentResource, newContentRecursive, newContentRegExp) => {
12700
12460
  const rawOptions = {
12701
12461
  resourceRegExp
@@ -12725,9 +12485,9 @@ var ContextReplacementPlugin = create2(
12725
12485
  );
12726
12486
 
12727
12487
  // src/builtin-plugin/LibManifestPlugin.ts
12728
- var import_binding71 = require("@rspack/binding");
12488
+ var import_binding70 = require("@rspack/binding");
12729
12489
  var LibManifestPlugin = create2(
12730
- import_binding71.BuiltinPluginName.LibManifestPlugin,
12490
+ import_binding70.BuiltinPluginName.LibManifestPlugin,
12731
12491
  (options) => {
12732
12492
  const { context: context2, entryOnly, format: format3, name: name2, path: path11, type } = options;
12733
12493
  return {
@@ -12742,9 +12502,9 @@ var LibManifestPlugin = create2(
12742
12502
  );
12743
12503
 
12744
12504
  // src/builtin-plugin/DllEntryPlugin.ts
12745
- var import_binding72 = require("@rspack/binding");
12505
+ var import_binding71 = require("@rspack/binding");
12746
12506
  var DllEntryPlugin = create2(
12747
- import_binding72.BuiltinPluginName.DllEntryPlugin,
12507
+ import_binding71.BuiltinPluginName.DllEntryPlugin,
12748
12508
  (context2, entries, options) => {
12749
12509
  return {
12750
12510
  context: context2,
@@ -12755,19 +12515,19 @@ var DllEntryPlugin = create2(
12755
12515
  );
12756
12516
 
12757
12517
  // src/builtin-plugin/DllReferenceAgencyPlugin.ts
12758
- var import_binding73 = require("@rspack/binding");
12518
+ var import_binding72 = require("@rspack/binding");
12759
12519
  var DllReferenceAgencyPlugin = create2(
12760
- import_binding73.BuiltinPluginName.DllReferenceAgencyPlugin,
12520
+ import_binding72.BuiltinPluginName.DllReferenceAgencyPlugin,
12761
12521
  (options) => options
12762
12522
  );
12763
12523
 
12764
12524
  // src/ContextModuleFactory.ts
12765
- var liteTapable5 = __toESM(require("@rspack/lite-tapable"));
12525
+ var liteTapable6 = __toESM(require("@rspack/lite-tapable"));
12766
12526
  var ContextModuleFactory = class {
12767
12527
  constructor() {
12768
12528
  this.hooks = {
12769
- beforeResolve: new liteTapable5.AsyncSeriesWaterfallHook(["resolveData"]),
12770
- afterResolve: new liteTapable5.AsyncSeriesWaterfallHook(["resolveData"])
12529
+ beforeResolve: new liteTapable6.AsyncSeriesWaterfallHook(["resolveData"]),
12530
+ afterResolve: new liteTapable6.AsyncSeriesWaterfallHook(["resolveData"])
12771
12531
  };
12772
12532
  }
12773
12533
  };
@@ -13041,18 +12801,18 @@ var ThreadsafeIntermediateNodeFS = class extends ThreadsafeOutputNodeFS {
13041
12801
  };
13042
12802
 
13043
12803
  // src/NormalModuleFactory.ts
13044
- var liteTapable6 = __toESM(require("@rspack/lite-tapable"));
12804
+ var liteTapable7 = __toESM(require("@rspack/lite-tapable"));
13045
12805
  var NormalModuleFactory = class {
13046
12806
  constructor() {
13047
12807
  this.hooks = {
13048
- resolveForScheme: new liteTapable6.HookMap(
13049
- () => new liteTapable6.AsyncSeriesBailHook(["resourceData"])
12808
+ resolveForScheme: new liteTapable7.HookMap(
12809
+ () => new liteTapable7.AsyncSeriesBailHook(["resourceData"])
13050
12810
  ),
13051
- beforeResolve: new liteTapable6.AsyncSeriesBailHook(["resolveData"]),
13052
- factorize: new liteTapable6.AsyncSeriesBailHook(["resolveData"]),
13053
- resolve: new liteTapable6.AsyncSeriesBailHook(["resolveData"]),
13054
- afterResolve: new liteTapable6.AsyncSeriesBailHook(["resolveData"]),
13055
- createModule: new liteTapable6.AsyncSeriesBailHook([
12811
+ beforeResolve: new liteTapable7.AsyncSeriesBailHook(["resolveData"]),
12812
+ factorize: new liteTapable7.AsyncSeriesBailHook(["resolveData"]),
12813
+ resolve: new liteTapable7.AsyncSeriesBailHook(["resolveData"]),
12814
+ afterResolve: new liteTapable7.AsyncSeriesBailHook(["resolveData"]),
12815
+ createModule: new liteTapable7.AsyncSeriesBailHook([
13056
12816
  "createData",
13057
12817
  "resolveData"
13058
12818
  ])
@@ -13061,23 +12821,23 @@ var NormalModuleFactory = class {
13061
12821
  };
13062
12822
 
13063
12823
  // src/ResolverFactory.ts
13064
- var binding = __toESM(require("@rspack/binding"));
12824
+ var binding2 = __toESM(require("@rspack/binding"));
13065
12825
  var ResolverFactory = class {
13066
12826
  #binding;
13067
12827
  static __to_binding(resolver_factory) {
13068
12828
  return resolver_factory.#binding;
13069
12829
  }
13070
12830
  constructor(pnp) {
13071
- this.#binding = new binding.JsResolverFactory(pnp);
12831
+ this.#binding = new binding2.JsResolverFactory(pnp);
13072
12832
  }
13073
12833
  get(type, resolveOptions2) {
13074
12834
  const { dependencyCategory, resolveToContext, ...resolve2 } = resolveOptions2 || {};
13075
- const binding3 = this.#binding.get(type, {
12835
+ const binding9 = this.#binding.get(type, {
13076
12836
  ...getRawResolve(resolve2),
13077
12837
  dependencyCategory,
13078
12838
  resolveToContext
13079
12839
  });
13080
- return new Resolver(binding3);
12840
+ return new Resolver(binding9);
13081
12841
  }
13082
12842
  };
13083
12843
 
@@ -13416,19 +13176,19 @@ var BINDING_VERSION = require("@rspack/binding/package.json").version;
13416
13176
  var CORE_VERSION = require("../package.json").version;
13417
13177
  var getAddonPlatformArchAbi = () => {
13418
13178
  const { platform, arch } = process;
13419
- let binding3 = "";
13420
- binding3 += platform;
13179
+ let binding9 = "";
13180
+ binding9 += platform;
13421
13181
  const abi = NodePlatformArchToAbi[platform][arch];
13422
13182
  if (abi === void 0) return new Error(`unsupported cpu arch: ${arch}`);
13423
- binding3 += `-${arch}`;
13183
+ binding9 += `-${arch}`;
13424
13184
  if (typeof abi === "string") {
13425
- binding3 += abi.length ? `-${abi}` : "";
13185
+ binding9 += abi.length ? `-${abi}` : "";
13426
13186
  } else if (typeof abi === "object") {
13427
- binding3 += `-${abi[isMusl() ? "musl" : "gnu"]}`;
13187
+ binding9 += `-${abi[isMusl() ? "musl" : "gnu"]}`;
13428
13188
  } else {
13429
13189
  return new Error(`unsupported abi: ${abi}`);
13430
13190
  }
13431
- return binding3;
13191
+ return binding9;
13432
13192
  };
13433
13193
  var result;
13434
13194
  var checkVersion = () => {
@@ -13474,138 +13234,1229 @@ Rspack requires these versions to be the same or you may have installed the wron
13474
13234
  return result = null;
13475
13235
  };
13476
13236
 
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 = [];
13492
- this.#nonSkippableRegisters = [];
13493
- this.#moduleExecutionResultsMap = /* @__PURE__ */ new Map();
13494
- this.#ruleSet = new RuleSetCompiler();
13495
- this.hooks = {
13496
- initialize: new liteTapable7.SyncHook([]),
13497
- shouldEmit: new liteTapable7.SyncBailHook(["compilation"]),
13498
- done: new liteTapable7.AsyncSeriesHook(["stats"]),
13499
- afterDone: new liteTapable7.SyncHook(["stats"]),
13500
- beforeRun: new liteTapable7.AsyncSeriesHook(["compiler"]),
13501
- run: new liteTapable7.AsyncSeriesHook(["compiler"]),
13502
- emit: new liteTapable7.AsyncSeriesHook(["compilation"]),
13503
- assetEmitted: new liteTapable7.AsyncSeriesHook(["file", "info"]),
13504
- afterEmit: new liteTapable7.AsyncSeriesHook(["compilation"]),
13505
- thisCompilation: new liteTapable7.SyncHook(["compilation", "params"]),
13506
- compilation: new liteTapable7.SyncHook([
13507
- "compilation",
13508
- "params"
13509
- ]),
13510
- invalid: new liteTapable7.SyncHook(["filename", "changeTime"]),
13511
- compile: new liteTapable7.SyncHook(["params"]),
13512
- infrastructureLog: new liteTapable7.SyncBailHook([
13513
- "origin",
13514
- "type",
13515
- "args"
13516
- ]),
13517
- failed: new liteTapable7.SyncHook(["error"]),
13518
- shutdown: new liteTapable7.AsyncSeriesHook([]),
13519
- normalModuleFactory: new liteTapable7.SyncHook([
13520
- "normalModuleFactory"
13521
- ]),
13522
- contextModuleFactory: new liteTapable7.SyncHook([
13523
- "contextModuleFactory"
13524
- ]),
13525
- watchRun: new liteTapable7.AsyncSeriesHook(["compiler"]),
13526
- watchClose: new liteTapable7.SyncHook([]),
13527
- environment: new liteTapable7.SyncHook([]),
13528
- afterEnvironment: new liteTapable7.SyncHook([]),
13529
- afterPlugins: new liteTapable7.SyncHook(["compiler"]),
13530
- afterResolvers: new liteTapable7.SyncHook(["compiler"]),
13531
- make: new liteTapable7.AsyncParallelHook(["compilation"]),
13532
- beforeCompile: new liteTapable7.AsyncSeriesHook(["params"]),
13533
- afterCompile: new liteTapable7.AsyncSeriesHook(["compilation"]),
13534
- finishMake: new liteTapable7.AsyncSeriesHook(["compilation"]),
13535
- entryOption: new liteTapable7.SyncBailHook(["context", "entry"]),
13536
- additionalPass: new liteTapable7.AsyncSeriesHook([])
13537
- };
13538
- this.webpack = rspack;
13539
- this.rspack = rspack;
13540
- this.root = this;
13541
- this.outputPath = "";
13542
- this.inputFileSystem = null;
13543
- this.intermediateFileSystem = null;
13544
- this.outputFileSystem = null;
13545
- this.watchFileSystem = null;
13546
- this.records = {};
13547
- this.options = options;
13548
- this.context = context2;
13549
- this.cache = new Cache_default();
13550
- this.compilerPath = "";
13551
- this.running = false;
13552
- this.idle = false;
13553
- this.watchMode = false;
13554
- new JsLoaderRspackPlugin(this).apply(this);
13555
- new ExecuteModulePlugin().apply(this);
13556
- }
13557
- get recordsInputPath() {
13558
- return unsupported("Compiler.recordsInputPath");
13559
- }
13560
- get recordsOutputPath() {
13561
- return unsupported("Compiler.recordsOutputPath");
13562
- }
13563
- get managedPaths() {
13564
- return unsupported("Compiler.managedPaths");
13565
- }
13566
- get immutablePaths() {
13567
- return unsupported("Compiler.immutablePaths");
13237
+ // src/builtin-plugin/html-plugin/taps.ts
13238
+ var binding3 = __toESM(require("@rspack/binding"));
13239
+ var createHtmlPluginHooksRegisters = (getCompiler, createTap, createMapTap) => {
13240
+ return {
13241
+ registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(
13242
+ binding3.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration,
13243
+ function() {
13244
+ return HtmlRspackPlugin.getCompilationHooks(
13245
+ getCompiler().__internal__get_compilation()
13246
+ ).beforeAssetTagGeneration;
13247
+ },
13248
+ function(queried) {
13249
+ return async function(data) {
13250
+ return await queried.promise({
13251
+ ...data,
13252
+ plugin: {
13253
+ options: HtmlRspackPlugin.getCompilationOptions(
13254
+ getCompiler().__internal__get_compilation()
13255
+ ) || {}
13256
+ }
13257
+ });
13258
+ };
13259
+ }
13260
+ ),
13261
+ registerHtmlPluginAlterAssetTagsTaps: createTap(
13262
+ binding3.RegisterJsTapKind.HtmlPluginAlterAssetTags,
13263
+ function() {
13264
+ return HtmlRspackPlugin.getCompilationHooks(
13265
+ getCompiler().__internal__get_compilation()
13266
+ ).alterAssetTags;
13267
+ },
13268
+ function(queried) {
13269
+ return async function(data) {
13270
+ return await queried.promise(data);
13271
+ };
13272
+ }
13273
+ ),
13274
+ registerHtmlPluginAlterAssetTagGroupsTaps: createTap(
13275
+ binding3.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups,
13276
+ function() {
13277
+ return HtmlRspackPlugin.getCompilationHooks(
13278
+ getCompiler().__internal__get_compilation()
13279
+ ).alterAssetTagGroups;
13280
+ },
13281
+ function(queried) {
13282
+ return async function(data) {
13283
+ return await queried.promise({
13284
+ ...data,
13285
+ plugin: {
13286
+ options: HtmlRspackPlugin.getCompilationOptions(
13287
+ getCompiler().__internal__get_compilation()
13288
+ ) || {}
13289
+ }
13290
+ });
13291
+ };
13292
+ }
13293
+ ),
13294
+ registerHtmlPluginAfterTemplateExecutionTaps: createTap(
13295
+ binding3.RegisterJsTapKind.HtmlPluginAfterTemplateExecution,
13296
+ function() {
13297
+ return HtmlRspackPlugin.getCompilationHooks(
13298
+ getCompiler().__internal__get_compilation()
13299
+ ).afterTemplateExecution;
13300
+ },
13301
+ function(queried) {
13302
+ return async function(data) {
13303
+ return await queried.promise({
13304
+ ...data,
13305
+ plugin: {
13306
+ options: HtmlRspackPlugin.getCompilationOptions(
13307
+ getCompiler().__internal__get_compilation()
13308
+ ) || {}
13309
+ }
13310
+ });
13311
+ };
13312
+ }
13313
+ ),
13314
+ registerHtmlPluginBeforeEmitTaps: createTap(
13315
+ binding3.RegisterJsTapKind.HtmlPluginBeforeEmit,
13316
+ function() {
13317
+ return HtmlRspackPlugin.getCompilationHooks(
13318
+ getCompiler().__internal__get_compilation()
13319
+ ).beforeEmit;
13320
+ },
13321
+ function(queried) {
13322
+ return async function(data) {
13323
+ return await queried.promise({
13324
+ ...data,
13325
+ plugin: {
13326
+ options: HtmlRspackPlugin.getCompilationOptions(
13327
+ getCompiler().__internal__get_compilation()
13328
+ ) || {}
13329
+ }
13330
+ });
13331
+ };
13332
+ }
13333
+ ),
13334
+ registerHtmlPluginAfterEmitTaps: createTap(
13335
+ binding3.RegisterJsTapKind.HtmlPluginAfterEmit,
13336
+ function() {
13337
+ return HtmlRspackPlugin.getCompilationHooks(
13338
+ getCompiler().__internal__get_compilation()
13339
+ ).afterEmit;
13340
+ },
13341
+ function(queried) {
13342
+ return async function(data) {
13343
+ return await queried.promise({
13344
+ ...data,
13345
+ plugin: {
13346
+ options: HtmlRspackPlugin.getCompilationOptions(
13347
+ getCompiler().__internal__get_compilation()
13348
+ ) || {}
13349
+ }
13350
+ });
13351
+ };
13352
+ }
13353
+ )
13354
+ };
13355
+ };
13356
+
13357
+ // src/taps/compilation.ts
13358
+ var binding4 = __toESM(require("@rspack/binding"));
13359
+
13360
+ // src/RuntimeGlobals.ts
13361
+ var REVERSE_RUNTIME_GLOBALS = /* @__PURE__ */ new Map();
13362
+ function __from_binding_runtime_globals(runtimeRequirements) {
13363
+ const res = /* @__PURE__ */ new Set();
13364
+ for (const flag of runtimeRequirements.value) {
13365
+ if (flag in RuntimeGlobals) {
13366
+ res.add(RuntimeGlobals[flag]);
13367
+ } else {
13368
+ res.add(flag);
13369
+ }
13568
13370
  }
13569
- get _lastCompilation() {
13570
- return this.#compilation;
13371
+ return res;
13372
+ }
13373
+ function __to_binding_runtime_globals(runtimeRequirements) {
13374
+ const res = {
13375
+ value: []
13376
+ };
13377
+ for (const flag of Array.from(runtimeRequirements)) {
13378
+ const item = REVERSE_RUNTIME_GLOBALS.get(flag);
13379
+ if (typeof item === "string") {
13380
+ res.value.push(item);
13381
+ } else {
13382
+ res.value.push(flag);
13383
+ }
13571
13384
  }
13385
+ return res;
13386
+ }
13387
+ var RuntimeGlobals = {
13572
13388
  /**
13573
- * Note: This is not a webpack public API, maybe removed in future.
13574
- * @internal
13389
+ * the internal require function
13575
13390
  */
13576
- get __internal__builtinPlugins() {
13577
- return this.#builtinPlugins;
13578
- }
13391
+ require: "__webpack_require__",
13579
13392
  /**
13580
- * Note: This is not a webpack public API, maybe removed in future.
13581
- * @internal
13393
+ * access to properties of the internal require function/object
13582
13394
  */
13583
- get __internal__ruleSet() {
13584
- return this.#ruleSet;
13585
- }
13395
+ requireScope: "__webpack_require__.*",
13586
13396
  /**
13587
- * @param name - cache name
13588
- * @returns the cache facade instance
13397
+ * the internal exports object
13589
13398
  */
13590
- getCache(name2) {
13591
- return new CacheFacade_default(
13592
- this.cache,
13593
- `${this.compilerPath}${name2}`,
13594
- this.options.output.hashFunction
13595
- );
13596
- }
13399
+ exports: "__webpack_exports__",
13597
13400
  /**
13598
- * @param name - name of the logger, or function called once to get the logger name
13599
- * @returns a logger with that name
13401
+ * top-level this need to be the exports object
13600
13402
  */
13601
- getInfrastructureLogger(name2) {
13602
- if (!name2) {
13603
- throw new TypeError(
13604
- "Compiler.getInfrastructureLogger(name) called without a name"
13605
- );
13606
- }
13607
- let normalizedName = name2;
13608
- return new Logger(
13403
+ thisAsExports: "top-level-this-exports",
13404
+ /**
13405
+ * runtime need to return the exports of the last entry module
13406
+ */
13407
+ returnExportsFromRuntime: "return-exports-from-runtime",
13408
+ /**
13409
+ * the internal module object
13410
+ */
13411
+ module: "module",
13412
+ /**
13413
+ * the internal module object
13414
+ */
13415
+ moduleId: "module.id",
13416
+ /**
13417
+ * the internal module object
13418
+ */
13419
+ moduleLoaded: "module.loaded",
13420
+ /**
13421
+ * the bundle public path
13422
+ */
13423
+ publicPath: "__webpack_require__.p",
13424
+ /**
13425
+ * the module id of the entry point
13426
+ */
13427
+ entryModuleId: "__webpack_require__.s",
13428
+ /**
13429
+ * the module cache
13430
+ */
13431
+ moduleCache: "__webpack_require__.c",
13432
+ /**
13433
+ * the module functions
13434
+ */
13435
+ moduleFactories: "__webpack_require__.m",
13436
+ /**
13437
+ * the module functions, with only write access
13438
+ */
13439
+ moduleFactoriesAddOnly: "__webpack_require__.m (add only)",
13440
+ /**
13441
+ * the chunk ensure function
13442
+ */
13443
+ ensureChunk: "__webpack_require__.e",
13444
+ /**
13445
+ * an object with handlers to ensure a chunk
13446
+ */
13447
+ ensureChunkHandlers: "__webpack_require__.f",
13448
+ /**
13449
+ * a runtime requirement if ensureChunkHandlers should include loading of chunk needed for entries
13450
+ */
13451
+ ensureChunkIncludeEntries: "__webpack_require__.f (include entries)",
13452
+ /**
13453
+ * the chunk prefetch function
13454
+ */
13455
+ prefetchChunk: "__webpack_require__.E",
13456
+ /**
13457
+ * an object with handlers to prefetch a chunk
13458
+ */
13459
+ prefetchChunkHandlers: "__webpack_require__.F",
13460
+ /**
13461
+ * the chunk preload function
13462
+ */
13463
+ preloadChunk: "__webpack_require__.G",
13464
+ /**
13465
+ * an object with handlers to preload a chunk
13466
+ */
13467
+ preloadChunkHandlers: "__webpack_require__.H",
13468
+ /**
13469
+ * the exported property define getters function
13470
+ */
13471
+ definePropertyGetters: "__webpack_require__.d",
13472
+ /**
13473
+ * define compatibility on export
13474
+ */
13475
+ makeNamespaceObject: "__webpack_require__.r",
13476
+ /**
13477
+ * create a fake namespace object
13478
+ */
13479
+ createFakeNamespaceObject: "__webpack_require__.t",
13480
+ /**
13481
+ * compatibility get default export
13482
+ */
13483
+ compatGetDefaultExport: "__webpack_require__.n",
13484
+ /**
13485
+ * ES modules decorator
13486
+ */
13487
+ harmonyModuleDecorator: "__webpack_require__.hmd",
13488
+ /**
13489
+ * node.js module decorator
13490
+ */
13491
+ nodeModuleDecorator: "__webpack_require__.nmd",
13492
+ /**
13493
+ * the webpack hash
13494
+ */
13495
+ getFullHash: "__webpack_require__.h",
13496
+ /**
13497
+ * an object containing all installed WebAssembly.Instance export objects keyed by module id
13498
+ */
13499
+ wasmInstances: "__webpack_require__.w",
13500
+ /**
13501
+ * instantiate a wasm instance from module exports object, id, hash and importsObject
13502
+ */
13503
+ instantiateWasm: "__webpack_require__.v",
13504
+ /**
13505
+ * the uncaught error handler for the webpack runtime
13506
+ */
13507
+ uncaughtErrorHandler: "__webpack_require__.oe",
13508
+ /**
13509
+ * the script nonce
13510
+ */
13511
+ scriptNonce: "__webpack_require__.nc",
13512
+ /**
13513
+ * function to load a script tag.
13514
+ * Arguments: (url: string, done: (event) =\> void), key?: string | number, chunkId?: string | number) =\> void
13515
+ * done function is called when loading has finished or timeout occurred.
13516
+ * It will attach to existing script tags with data-webpack == uniqueName + ":" + key or src == url.
13517
+ */
13518
+ loadScript: "__webpack_require__.l",
13519
+ /**
13520
+ * function to promote a string to a TrustedScript using webpack's Trusted
13521
+ * Types policy
13522
+ * Arguments: (script: string) =\> TrustedScript
13523
+ */
13524
+ createScript: "__webpack_require__.ts",
13525
+ /**
13526
+ * function to promote a string to a TrustedScriptURL using webpack's Trusted
13527
+ * Types policy
13528
+ * Arguments: (url: string) =\> TrustedScriptURL
13529
+ */
13530
+ createScriptUrl: "__webpack_require__.tu",
13531
+ /**
13532
+ * function to return webpack's Trusted Types policy
13533
+ * Arguments: () =\> TrustedTypePolicy
13534
+ */
13535
+ getTrustedTypesPolicy: "__webpack_require__.tt",
13536
+ /**
13537
+ * a flag when a chunk has a fetch priority
13538
+ */
13539
+ hasFetchPriority: "has fetch priority",
13540
+ /**
13541
+ * the chunk name of the chunk with the runtime
13542
+ */
13543
+ chunkName: "__webpack_require__.cn",
13544
+ /**
13545
+ * the runtime id of the current runtime
13546
+ */
13547
+ runtimeId: "__webpack_require__.j",
13548
+ /**
13549
+ * the filename of the script part of the chunk
13550
+ */
13551
+ getChunkScriptFilename: "__webpack_require__.u",
13552
+ /**
13553
+ * the filename of the css part of the chunk
13554
+ */
13555
+ getChunkCssFilename: "__webpack_require__.k",
13556
+ /**
13557
+ * a flag when a module/chunk/tree has css modules
13558
+ */
13559
+ hasCssModules: "has css modules",
13560
+ /**
13561
+ * the filename of the script part of the hot update chunk
13562
+ */
13563
+ getChunkUpdateScriptFilename: "__webpack_require__.hu",
13564
+ /**
13565
+ * the filename of the css part of the hot update chunk
13566
+ */
13567
+ getChunkUpdateCssFilename: "__webpack_require__.hk",
13568
+ /**
13569
+ * startup signal from runtime
13570
+ * This will be called when the runtime chunk has been loaded.
13571
+ */
13572
+ startup: "__webpack_require__.x",
13573
+ /**
13574
+ * @deprecated
13575
+ * creating a default startup function with the entry modules
13576
+ */
13577
+ startupNoDefault: "__webpack_require__.x (no default handler)",
13578
+ /**
13579
+ * startup signal from runtime but only used to add logic after the startup
13580
+ */
13581
+ startupOnlyAfter: "__webpack_require__.x (only after)",
13582
+ /**
13583
+ * startup signal from runtime but only used to add sync logic before the startup
13584
+ */
13585
+ startupOnlyBefore: "__webpack_require__.x (only before)",
13586
+ /**
13587
+ * global callback functions for installing chunks
13588
+ */
13589
+ chunkCallback: "webpackChunk",
13590
+ /**
13591
+ * method to startup an entrypoint with needed chunks.
13592
+ * Signature: (moduleId: Id, chunkIds: Id[]) =\> any.
13593
+ * Returns the exports of the module or a Promise
13594
+ */
13595
+ startupEntrypoint: "__webpack_require__.X",
13596
+ /**
13597
+ * register deferred code, which will run when certain
13598
+ * chunks are loaded.
13599
+ * Signature: (chunkIds: Id[], fn: () =\> any, priority: int \>= 0 = 0) =\> any
13600
+ * Returned value will be returned directly when all chunks are already loaded
13601
+ * When (priority & 1) it will wait for all other handlers with lower priority to
13602
+ * be executed before itself is executed
13603
+ */
13604
+ onChunksLoaded: "__webpack_require__.O",
13605
+ /**
13606
+ * method to install a chunk that was loaded somehow
13607
+ * Signature: (\{ id, ids, modules, runtime \}) =\> void
13608
+ */
13609
+ externalInstallChunk: "__webpack_require__.C",
13610
+ /**
13611
+ * interceptor for module executions
13612
+ */
13613
+ interceptModuleExecution: "__webpack_require__.i",
13614
+ /**
13615
+ * the global object
13616
+ */
13617
+ global: "__webpack_require__.g",
13618
+ /**
13619
+ * an object with all share scopes
13620
+ */
13621
+ shareScopeMap: "__webpack_require__.S",
13622
+ /**
13623
+ * The sharing init sequence function (only runs once per share scope).
13624
+ * Has one argument, the name of the share scope.
13625
+ * Creates a share scope if not existing
13626
+ */
13627
+ initializeSharing: "__webpack_require__.I",
13628
+ /**
13629
+ * The current scope when getting a module from a remote
13630
+ */
13631
+ currentRemoteGetScope: "__webpack_require__.R",
13632
+ /**
13633
+ * the filename of the HMR manifest
13634
+ */
13635
+ getUpdateManifestFilename: "__webpack_require__.hmrF",
13636
+ /**
13637
+ * function downloading the update manifest
13638
+ */
13639
+ hmrDownloadManifest: "__webpack_require__.hmrM",
13640
+ /**
13641
+ * array with handler functions to download chunk updates
13642
+ */
13643
+ hmrDownloadUpdateHandlers: "__webpack_require__.hmrC",
13644
+ /**
13645
+ * object with all hmr module data for all modules
13646
+ */
13647
+ hmrModuleData: "__webpack_require__.hmrD",
13648
+ /**
13649
+ * array with handler functions when a module should be invalidated
13650
+ */
13651
+ hmrInvalidateModuleHandlers: "__webpack_require__.hmrI",
13652
+ /**
13653
+ * the prefix for storing state of runtime modules when hmr is enabled
13654
+ */
13655
+ hmrRuntimeStatePrefix: "__webpack_require__.hmrS",
13656
+ /**
13657
+ * the AMD define function
13658
+ */
13659
+ amdDefine: "__webpack_require__.amdD",
13660
+ /**
13661
+ * the AMD options
13662
+ */
13663
+ amdOptions: "__webpack_require__.amdO",
13664
+ /**
13665
+ * the System polyfill object
13666
+ */
13667
+ system: "__webpack_require__.System",
13668
+ /**
13669
+ * the shorthand for Object.prototype.hasOwnProperty
13670
+ * using of it decreases the compiled bundle size
13671
+ */
13672
+ hasOwnProperty: "__webpack_require__.o",
13673
+ /**
13674
+ * the System.register context object
13675
+ */
13676
+ systemContext: "__webpack_require__.y",
13677
+ /**
13678
+ * the baseURI of current document
13679
+ */
13680
+ baseURI: "__webpack_require__.b",
13681
+ /**
13682
+ * a RelativeURL class when relative URLs are used
13683
+ */
13684
+ relativeUrl: "__webpack_require__.U",
13685
+ /**
13686
+ * Creates an async module. The body function must be a async function.
13687
+ * "module.exports" will be decorated with an AsyncModulePromise.
13688
+ * The body function will be called.
13689
+ * To handle async dependencies correctly do this: "([a, b, c] = await handleDependencies([a, b, c]));".
13690
+ * If "hasAwaitAfterDependencies" is truthy, "handleDependencies()" must be called at the end of the body function.
13691
+ * Signature: function(
13692
+ * module: Module,
13693
+ * body: (handleDependencies: (deps: AsyncModulePromise[]) =\> Promise\<any[]\> & () =\> void,
13694
+ * hasAwaitAfterDependencies?: boolean
13695
+ * ) =\> void
13696
+ */
13697
+ asyncModule: "__webpack_require__.a"
13698
+ };
13699
+ for (const entry2 of Object.entries(RuntimeGlobals)) {
13700
+ REVERSE_RUNTIME_GLOBALS.set(entry2[1], entry2[0]);
13701
+ }
13702
+
13703
+ // src/taps/compilation.ts
13704
+ var createCompilationHooksRegisters = (getCompiler, createTap, createMapTap) => {
13705
+ return {
13706
+ registerCompilationAdditionalTreeRuntimeRequirementsTaps: createTap(
13707
+ binding4.RegisterJsTapKind.CompilationAdditionalTreeRuntimeRequirements,
13708
+ function() {
13709
+ return getCompiler().__internal__get_compilation().hooks.additionalTreeRuntimeRequirements;
13710
+ },
13711
+ function(queried) {
13712
+ return function({
13713
+ chunk,
13714
+ runtimeRequirements
13715
+ }) {
13716
+ const set = __from_binding_runtime_globals(runtimeRequirements);
13717
+ queried.call(Chunk.__from_binding(chunk), set);
13718
+ return {
13719
+ runtimeRequirements: __to_binding_runtime_globals(set)
13720
+ };
13721
+ };
13722
+ }
13723
+ ),
13724
+ registerCompilationRuntimeRequirementInTreeTaps: createMapTap(
13725
+ binding4.RegisterJsTapKind.CompilationRuntimeRequirementInTree,
13726
+ function() {
13727
+ return getCompiler().__internal__get_compilation().hooks.runtimeRequirementInTree;
13728
+ },
13729
+ function(queried) {
13730
+ return function({
13731
+ chunk: chunkBinding,
13732
+ runtimeRequirements
13733
+ }) {
13734
+ const set = __from_binding_runtime_globals(runtimeRequirements);
13735
+ const chunk = Chunk.__from_binding(chunkBinding);
13736
+ for (const r of set) {
13737
+ queried.for(r).call(chunk, set);
13738
+ }
13739
+ return {
13740
+ runtimeRequirements: __to_binding_runtime_globals(set)
13741
+ };
13742
+ };
13743
+ }
13744
+ ),
13745
+ registerCompilationRuntimeModuleTaps: createTap(
13746
+ binding4.RegisterJsTapKind.CompilationRuntimeModule,
13747
+ function() {
13748
+ return getCompiler().__internal__get_compilation().hooks.runtimeModule;
13749
+ },
13750
+ function(queried) {
13751
+ return function({ module: module2, chunk }) {
13752
+ var _a, _b;
13753
+ const originSource = (_a = module2.source) == null ? void 0 : _a.source;
13754
+ queried.call(module2, Chunk.__from_binding(chunk));
13755
+ const newSource = (_b = module2.source) == null ? void 0 : _b.source;
13756
+ if (newSource && newSource !== originSource) {
13757
+ return module2;
13758
+ }
13759
+ return;
13760
+ };
13761
+ }
13762
+ ),
13763
+ registerCompilationBuildModuleTaps: createTap(
13764
+ binding4.RegisterJsTapKind.CompilationBuildModule,
13765
+ function() {
13766
+ return getCompiler().__internal__get_compilation().hooks.buildModule;
13767
+ },
13768
+ function(queried) {
13769
+ return function(m) {
13770
+ return queried.call(Module.__from_binding(m));
13771
+ };
13772
+ }
13773
+ ),
13774
+ registerCompilationStillValidModuleTaps: createTap(
13775
+ binding4.RegisterJsTapKind.CompilationStillValidModule,
13776
+ function() {
13777
+ return getCompiler().__internal__get_compilation().hooks.stillValidModule;
13778
+ },
13779
+ function(queried) {
13780
+ return function(m) {
13781
+ return queried.call(Module.__from_binding(m));
13782
+ };
13783
+ }
13784
+ ),
13785
+ registerCompilationSucceedModuleTaps: createTap(
13786
+ binding4.RegisterJsTapKind.CompilationSucceedModule,
13787
+ function() {
13788
+ return getCompiler().__internal__get_compilation().hooks.succeedModule;
13789
+ },
13790
+ function(queried) {
13791
+ return function(m) {
13792
+ return queried.call(Module.__from_binding(m));
13793
+ };
13794
+ }
13795
+ ),
13796
+ registerCompilationExecuteModuleTaps: createTap(
13797
+ binding4.RegisterJsTapKind.CompilationExecuteModule,
13798
+ function() {
13799
+ return getCompiler().__internal__get_compilation().hooks.executeModule;
13800
+ },
13801
+ function(queried) {
13802
+ return function({
13803
+ entry: entry2,
13804
+ id,
13805
+ codegenResults,
13806
+ runtimeModules
13807
+ }) {
13808
+ try {
13809
+ const __webpack_require__ = (id2) => {
13810
+ const cached = moduleCache[id2];
13811
+ if (cached !== void 0) {
13812
+ if (cached.error) throw cached.error;
13813
+ return cached.exports;
13814
+ }
13815
+ const execOptions = {
13816
+ id: id2,
13817
+ module: {
13818
+ id: id2,
13819
+ exports: {},
13820
+ loaded: false,
13821
+ error: void 0
13822
+ },
13823
+ require: __webpack_require__
13824
+ };
13825
+ for (const handler of interceptModuleExecution) {
13826
+ handler(execOptions);
13827
+ }
13828
+ const result2 = codegenResults.map[id2]["build time"];
13829
+ const moduleObject = execOptions.module;
13830
+ if (id2) moduleCache[id2] = moduleObject;
13831
+ tryRunOrWebpackError(
13832
+ () => queried.call(
13833
+ {
13834
+ codeGenerationResult: new CodeGenerationResult(result2),
13835
+ moduleObject
13836
+ },
13837
+ { __webpack_require__ }
13838
+ ),
13839
+ "Compilation.hooks.executeModule"
13840
+ );
13841
+ moduleObject.loaded = true;
13842
+ return moduleObject.exports;
13843
+ };
13844
+ const moduleCache = __webpack_require__[RuntimeGlobals.moduleCache.replace(
13845
+ `${RuntimeGlobals.require}.`,
13846
+ ""
13847
+ )] = {};
13848
+ const interceptModuleExecution = __webpack_require__[RuntimeGlobals.interceptModuleExecution.replace(
13849
+ `${RuntimeGlobals.require}.`,
13850
+ ""
13851
+ )] = [];
13852
+ for (const runtimeModule of runtimeModules) {
13853
+ __webpack_require__(runtimeModule);
13854
+ }
13855
+ const executeResult = __webpack_require__(entry2);
13856
+ getCompiler().__internal__get_module_execution_results_map().set(id, executeResult);
13857
+ } catch (e) {
13858
+ getCompiler().__internal__get_module_execution_results_map().set(id, e);
13859
+ throw e;
13860
+ }
13861
+ };
13862
+ }
13863
+ ),
13864
+ registerCompilationFinishModulesTaps: createTap(
13865
+ binding4.RegisterJsTapKind.CompilationFinishModules,
13866
+ function() {
13867
+ return getCompiler().__internal__get_compilation().hooks.finishModules;
13868
+ },
13869
+ function(queried) {
13870
+ return async function() {
13871
+ return await queried.promise(
13872
+ getCompiler().__internal__get_compilation().modules
13873
+ );
13874
+ };
13875
+ }
13876
+ ),
13877
+ registerCompilationOptimizeModulesTaps: createTap(
13878
+ binding4.RegisterJsTapKind.CompilationOptimizeModules,
13879
+ function() {
13880
+ return getCompiler().__internal__get_compilation().hooks.optimizeModules;
13881
+ },
13882
+ function(queried) {
13883
+ return function() {
13884
+ return queried.call(
13885
+ getCompiler().__internal__get_compilation().modules.values()
13886
+ );
13887
+ };
13888
+ }
13889
+ ),
13890
+ registerCompilationAfterOptimizeModulesTaps: createTap(
13891
+ binding4.RegisterJsTapKind.CompilationAfterOptimizeModules,
13892
+ function() {
13893
+ return getCompiler().__internal__get_compilation().hooks.afterOptimizeModules;
13894
+ },
13895
+ function(queried) {
13896
+ return function() {
13897
+ queried.call(
13898
+ getCompiler().__internal__get_compilation().modules.values()
13899
+ );
13900
+ };
13901
+ }
13902
+ ),
13903
+ registerCompilationOptimizeTreeTaps: createTap(
13904
+ binding4.RegisterJsTapKind.CompilationOptimizeTree,
13905
+ function() {
13906
+ return getCompiler().__internal__get_compilation().hooks.optimizeTree;
13907
+ },
13908
+ function(queried) {
13909
+ return async function() {
13910
+ return await queried.promise(
13911
+ getCompiler().__internal__get_compilation().chunks,
13912
+ getCompiler().__internal__get_compilation().modules
13913
+ );
13914
+ };
13915
+ }
13916
+ ),
13917
+ registerCompilationOptimizeChunkModulesTaps: createTap(
13918
+ binding4.RegisterJsTapKind.CompilationOptimizeChunkModules,
13919
+ function() {
13920
+ return getCompiler().__internal__get_compilation().hooks.optimizeChunkModules;
13921
+ },
13922
+ function(queried) {
13923
+ return async function() {
13924
+ return await queried.promise(
13925
+ getCompiler().__internal__get_compilation().chunks,
13926
+ getCompiler().__internal__get_compilation().modules
13927
+ );
13928
+ };
13929
+ }
13930
+ ),
13931
+ registerCompilationChunkHashTaps: createTap(
13932
+ binding4.RegisterJsTapKind.CompilationChunkHash,
13933
+ function() {
13934
+ return getCompiler().__internal__get_compilation().hooks.chunkHash;
13935
+ },
13936
+ function(queried) {
13937
+ return function(chunk) {
13938
+ if (!getCompiler().options.output.hashFunction) {
13939
+ throw new Error("'output.hashFunction' cannot be undefined");
13940
+ }
13941
+ const hash = createHash(getCompiler().options.output.hashFunction);
13942
+ queried.call(Chunk.__from_binding(chunk), hash);
13943
+ const digestResult = hash.digest(
13944
+ getCompiler().options.output.hashDigest
13945
+ );
13946
+ return Buffer.from(digestResult);
13947
+ };
13948
+ }
13949
+ ),
13950
+ registerCompilationChunkAssetTaps: createTap(
13951
+ binding4.RegisterJsTapKind.CompilationChunkAsset,
13952
+ function() {
13953
+ return getCompiler().__internal__get_compilation().hooks.chunkAsset;
13954
+ },
13955
+ function(queried) {
13956
+ return function({ chunk, filename: filename2 }) {
13957
+ return queried.call(Chunk.__from_binding(chunk), filename2);
13958
+ };
13959
+ }
13960
+ ),
13961
+ registerCompilationProcessAssetsTaps: createTap(
13962
+ binding4.RegisterJsTapKind.CompilationProcessAssets,
13963
+ function() {
13964
+ return getCompiler().__internal__get_compilation().hooks.processAssets;
13965
+ },
13966
+ function(queried) {
13967
+ return async function() {
13968
+ return await queried.promise(
13969
+ getCompiler().__internal__get_compilation().assets
13970
+ );
13971
+ };
13972
+ }
13973
+ ),
13974
+ registerCompilationAfterProcessAssetsTaps: createTap(
13975
+ binding4.RegisterJsTapKind.CompilationAfterProcessAssets,
13976
+ function() {
13977
+ return getCompiler().__internal__get_compilation().hooks.afterProcessAssets;
13978
+ },
13979
+ function(queried) {
13980
+ return function() {
13981
+ return queried.call(
13982
+ getCompiler().__internal__get_compilation().assets
13983
+ );
13984
+ };
13985
+ }
13986
+ ),
13987
+ registerCompilationSealTaps: createTap(
13988
+ binding4.RegisterJsTapKind.CompilationSeal,
13989
+ function() {
13990
+ return getCompiler().__internal__get_compilation().hooks.seal;
13991
+ },
13992
+ function(queried) {
13993
+ return function() {
13994
+ return queried.call();
13995
+ };
13996
+ }
13997
+ ),
13998
+ registerCompilationAfterSealTaps: createTap(
13999
+ binding4.RegisterJsTapKind.CompilationAfterSeal,
14000
+ function() {
14001
+ return getCompiler().__internal__get_compilation().hooks.afterSeal;
14002
+ },
14003
+ function(queried) {
14004
+ return async function() {
14005
+ return await queried.promise();
14006
+ };
14007
+ }
14008
+ )
14009
+ };
14010
+ };
14011
+
14012
+ // src/taps/compiler.ts
14013
+ var binding5 = __toESM(require("@rspack/binding"));
14014
+ var createCompilerHooksRegisters = (getCompiler, createTap, createMapTap) => {
14015
+ return {
14016
+ registerCompilerThisCompilationTaps: createTap(
14017
+ binding5.RegisterJsTapKind.CompilerThisCompilation,
14018
+ function() {
14019
+ return getCompiler().hooks.thisCompilation;
14020
+ },
14021
+ function(queried) {
14022
+ return function(native) {
14023
+ getCompiler().__internal__create_compilation(native);
14024
+ return queried.call(
14025
+ getCompiler().__internal__get_compilation(),
14026
+ getCompiler().__internal__get_compilation_params()
14027
+ );
14028
+ };
14029
+ }
14030
+ ),
14031
+ registerCompilerCompilationTaps: createTap(
14032
+ binding5.RegisterJsTapKind.CompilerCompilation,
14033
+ function() {
14034
+ return getCompiler().hooks.compilation;
14035
+ },
14036
+ function(queried) {
14037
+ return function() {
14038
+ return queried.call(
14039
+ getCompiler().__internal__get_compilation(),
14040
+ getCompiler().__internal__get_compilation_params()
14041
+ );
14042
+ };
14043
+ }
14044
+ ),
14045
+ registerCompilerMakeTaps: createTap(
14046
+ binding5.RegisterJsTapKind.CompilerMake,
14047
+ function() {
14048
+ return getCompiler().hooks.make;
14049
+ },
14050
+ function(queried) {
14051
+ return async function() {
14052
+ return await queried.promise(
14053
+ getCompiler().__internal__get_compilation()
14054
+ );
14055
+ };
14056
+ }
14057
+ ),
14058
+ registerCompilerFinishMakeTaps: createTap(
14059
+ binding5.RegisterJsTapKind.CompilerFinishMake,
14060
+ function() {
14061
+ return getCompiler().hooks.finishMake;
14062
+ },
14063
+ function(queried) {
14064
+ return async function() {
14065
+ return await queried.promise(
14066
+ getCompiler().__internal__get_compilation()
14067
+ );
14068
+ };
14069
+ }
14070
+ ),
14071
+ registerCompilerShouldEmitTaps: createTap(
14072
+ binding5.RegisterJsTapKind.CompilerShouldEmit,
14073
+ function() {
14074
+ return getCompiler().hooks.shouldEmit;
14075
+ },
14076
+ function(queried) {
14077
+ return function() {
14078
+ return queried.call(getCompiler().__internal__get_compilation());
14079
+ };
14080
+ }
14081
+ ),
14082
+ registerCompilerEmitTaps: createTap(
14083
+ binding5.RegisterJsTapKind.CompilerEmit,
14084
+ function() {
14085
+ return getCompiler().hooks.emit;
14086
+ },
14087
+ function(queried) {
14088
+ return async function() {
14089
+ return await queried.promise(
14090
+ getCompiler().__internal__get_compilation()
14091
+ );
14092
+ };
14093
+ }
14094
+ ),
14095
+ registerCompilerAfterEmitTaps: createTap(
14096
+ binding5.RegisterJsTapKind.CompilerAfterEmit,
14097
+ function() {
14098
+ return getCompiler().hooks.afterEmit;
14099
+ },
14100
+ function(queried) {
14101
+ return async function() {
14102
+ return await queried.promise(
14103
+ getCompiler().__internal__get_compilation()
14104
+ );
14105
+ };
14106
+ }
14107
+ ),
14108
+ registerCompilerAssetEmittedTaps: createTap(
14109
+ binding5.RegisterJsTapKind.CompilerAssetEmitted,
14110
+ function() {
14111
+ return getCompiler().hooks.assetEmitted;
14112
+ },
14113
+ function(queried) {
14114
+ return async function({
14115
+ filename: filename2,
14116
+ targetPath,
14117
+ outputPath
14118
+ }) {
14119
+ return queried.promise(filename2, {
14120
+ compilation: getCompiler().__internal__get_compilation(),
14121
+ targetPath,
14122
+ outputPath,
14123
+ get source() {
14124
+ var _a;
14125
+ return (_a = getCompiler().__internal__get_compilation().getAsset(filename2)) == null ? void 0 : _a.source;
14126
+ },
14127
+ get content() {
14128
+ var _a;
14129
+ return (_a = this.source) == null ? void 0 : _a.buffer();
14130
+ }
14131
+ });
14132
+ };
14133
+ }
14134
+ )
14135
+ };
14136
+ };
14137
+
14138
+ // src/taps/contextModuleFactory.ts
14139
+ var binding6 = __toESM(require("@rspack/binding"));
14140
+ var createContextModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap) => {
14141
+ return {
14142
+ registerContextModuleFactoryBeforeResolveTaps: createTap(
14143
+ binding6.RegisterJsTapKind.ContextModuleFactoryBeforeResolve,
14144
+ function() {
14145
+ return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.beforeResolve;
14146
+ },
14147
+ function(queried) {
14148
+ return async function(bindingData) {
14149
+ const data = bindingData ? ContextModuleFactoryBeforeResolveData.__from_binding(bindingData) : false;
14150
+ const result2 = await queried.promise(data);
14151
+ return result2 ? ContextModuleFactoryBeforeResolveData.__to_binding(result2) : false;
14152
+ };
14153
+ }
14154
+ ),
14155
+ registerContextModuleFactoryAfterResolveTaps: createTap(
14156
+ binding6.RegisterJsTapKind.ContextModuleFactoryAfterResolve,
14157
+ function() {
14158
+ return getCompiler().__internal__get_compilation_params().contextModuleFactory.hooks.afterResolve;
14159
+ },
14160
+ function(queried) {
14161
+ return async function(bindingData) {
14162
+ const data = bindingData ? ContextModuleFactoryAfterResolveData.__from_binding(bindingData) : false;
14163
+ const result2 = await queried.promise(data);
14164
+ return result2 ? ContextModuleFactoryAfterResolveData.__to_binding(result2) : false;
14165
+ };
14166
+ }
14167
+ )
14168
+ };
14169
+ };
14170
+
14171
+ // src/taps/javascriptModules.ts
14172
+ var binding7 = __toESM(require("@rspack/binding"));
14173
+ var createJavaScriptModulesHooksRegisters = (getCompiler, createTap, createMapTap) => {
14174
+ return {
14175
+ registerJavascriptModulesChunkHashTaps: createTap(
14176
+ binding7.RegisterJsTapKind.JavascriptModulesChunkHash,
14177
+ function() {
14178
+ return JavascriptModulesPlugin.getCompilationHooks(
14179
+ getCompiler().__internal__get_compilation()
14180
+ ).chunkHash;
14181
+ },
14182
+ function(queried) {
14183
+ return function(chunk) {
14184
+ if (!getCompiler().options.output.hashFunction) {
14185
+ throw new Error("'output.hashFunction' cannot be undefined");
14186
+ }
14187
+ const hash = createHash(getCompiler().options.output.hashFunction);
14188
+ queried.call(Chunk.__from_binding(chunk), hash);
14189
+ const digestResult = hash.digest(
14190
+ getCompiler().options.output.hashDigest
14191
+ );
14192
+ return Buffer.from(digestResult);
14193
+ };
14194
+ }
14195
+ )
14196
+ };
14197
+ };
14198
+
14199
+ // src/taps/normalModuleFactory.ts
14200
+ var binding8 = __toESM(require("@rspack/binding"));
14201
+ var createNormalModuleFactoryHooksRegisters = (getCompiler, createTap, createMapTap) => {
14202
+ return {
14203
+ registerNormalModuleFactoryBeforeResolveTaps: createTap(
14204
+ binding8.RegisterJsTapKind.NormalModuleFactoryBeforeResolve,
14205
+ function() {
14206
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.beforeResolve;
14207
+ },
14208
+ function(queried) {
14209
+ return async function(resolveData) {
14210
+ const normalizedResolveData = {
14211
+ contextInfo: {
14212
+ issuer: resolveData.issuer
14213
+ },
14214
+ request: resolveData.request,
14215
+ context: resolveData.context,
14216
+ fileDependencies: [],
14217
+ missingDependencies: [],
14218
+ contextDependencies: []
14219
+ };
14220
+ const ret = await queried.promise(normalizedResolveData);
14221
+ resolveData.request = normalizedResolveData.request;
14222
+ resolveData.context = normalizedResolveData.context;
14223
+ return [ret, resolveData];
14224
+ };
14225
+ }
14226
+ ),
14227
+ registerNormalModuleFactoryFactorizeTaps: createTap(
14228
+ binding8.RegisterJsTapKind.NormalModuleFactoryFactorize,
14229
+ function() {
14230
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.factorize;
14231
+ },
14232
+ function(queried) {
14233
+ return async function(resolveData) {
14234
+ const normalizedResolveData = {
14235
+ contextInfo: {
14236
+ issuer: resolveData.issuer
14237
+ },
14238
+ request: resolveData.request,
14239
+ context: resolveData.context,
14240
+ fileDependencies: [],
14241
+ missingDependencies: [],
14242
+ contextDependencies: []
14243
+ };
14244
+ await queried.promise(normalizedResolveData);
14245
+ resolveData.request = normalizedResolveData.request;
14246
+ resolveData.context = normalizedResolveData.context;
14247
+ return resolveData;
14248
+ };
14249
+ }
14250
+ ),
14251
+ registerNormalModuleFactoryResolveTaps: createTap(
14252
+ binding8.RegisterJsTapKind.NormalModuleFactoryResolve,
14253
+ function() {
14254
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolve;
14255
+ },
14256
+ function(queried) {
14257
+ return async function(resolveData) {
14258
+ const normalizedResolveData = {
14259
+ contextInfo: {
14260
+ issuer: resolveData.issuer
14261
+ },
14262
+ request: resolveData.request,
14263
+ context: resolveData.context,
14264
+ fileDependencies: [],
14265
+ missingDependencies: [],
14266
+ contextDependencies: []
14267
+ };
14268
+ await queried.promise(normalizedResolveData);
14269
+ resolveData.request = normalizedResolveData.request;
14270
+ resolveData.context = normalizedResolveData.context;
14271
+ return resolveData;
14272
+ };
14273
+ }
14274
+ ),
14275
+ registerNormalModuleFactoryResolveForSchemeTaps: createMapTap(
14276
+ binding8.RegisterJsTapKind.NormalModuleFactoryResolveForScheme,
14277
+ function() {
14278
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.resolveForScheme;
14279
+ },
14280
+ function(queried) {
14281
+ return async function(args) {
14282
+ const ret = await queried.for(args.scheme).promise(args.resourceData);
14283
+ return [ret, args.resourceData];
14284
+ };
14285
+ }
14286
+ ),
14287
+ registerNormalModuleFactoryAfterResolveTaps: createTap(
14288
+ binding8.RegisterJsTapKind.NormalModuleFactoryAfterResolve,
14289
+ function() {
14290
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.afterResolve;
14291
+ },
14292
+ function(queried) {
14293
+ return async function(arg) {
14294
+ const data = {
14295
+ contextInfo: {
14296
+ issuer: arg.issuer
14297
+ },
14298
+ request: arg.request,
14299
+ context: arg.context,
14300
+ fileDependencies: arg.fileDependencies,
14301
+ missingDependencies: arg.missingDependencies,
14302
+ contextDependencies: arg.contextDependencies,
14303
+ createData: arg.createData
14304
+ };
14305
+ const ret = await queried.promise(data);
14306
+ return [ret, data.createData];
14307
+ };
14308
+ }
14309
+ ),
14310
+ registerNormalModuleFactoryCreateModuleTaps: createTap(
14311
+ binding8.RegisterJsTapKind.NormalModuleFactoryCreateModule,
14312
+ function() {
14313
+ return getCompiler().__internal__get_compilation_params().normalModuleFactory.hooks.createModule;
14314
+ },
14315
+ function(queried) {
14316
+ return async function(args) {
14317
+ const data = {
14318
+ ...args,
14319
+ settings: {}
14320
+ };
14321
+ await queried.promise(data, {});
14322
+ };
14323
+ }
14324
+ )
14325
+ };
14326
+ };
14327
+
14328
+ // src/Compiler.ts
14329
+ var COMPILATION_WEAK_MAP = /* @__PURE__ */ new WeakMap();
14330
+ var Compiler = class _Compiler {
14331
+ #instance;
14332
+ #initial;
14333
+ #compilation;
14334
+ #compilationParams;
14335
+ #builtinPlugins;
14336
+ #moduleExecutionResultsMap;
14337
+ #nonSkippableRegisters;
14338
+ #registers;
14339
+ #ruleSet;
14340
+ constructor(context2, options) {
14341
+ this.#initial = true;
14342
+ this.#builtinPlugins = [];
14343
+ this.#nonSkippableRegisters = [];
14344
+ this.#moduleExecutionResultsMap = /* @__PURE__ */ new Map();
14345
+ this.#ruleSet = new RuleSetCompiler();
14346
+ this.hooks = {
14347
+ initialize: new liteTapable8.SyncHook([]),
14348
+ shouldEmit: new liteTapable8.SyncBailHook(["compilation"]),
14349
+ done: new liteTapable8.AsyncSeriesHook(["stats"]),
14350
+ afterDone: new liteTapable8.SyncHook(["stats"]),
14351
+ beforeRun: new liteTapable8.AsyncSeriesHook(["compiler"]),
14352
+ run: new liteTapable8.AsyncSeriesHook(["compiler"]),
14353
+ emit: new liteTapable8.AsyncSeriesHook(["compilation"]),
14354
+ assetEmitted: new liteTapable8.AsyncSeriesHook(["file", "info"]),
14355
+ afterEmit: new liteTapable8.AsyncSeriesHook(["compilation"]),
14356
+ thisCompilation: new liteTapable8.SyncHook(["compilation", "params"]),
14357
+ compilation: new liteTapable8.SyncHook([
14358
+ "compilation",
14359
+ "params"
14360
+ ]),
14361
+ invalid: new liteTapable8.SyncHook(["filename", "changeTime"]),
14362
+ compile: new liteTapable8.SyncHook(["params"]),
14363
+ infrastructureLog: new liteTapable8.SyncBailHook([
14364
+ "origin",
14365
+ "type",
14366
+ "args"
14367
+ ]),
14368
+ failed: new liteTapable8.SyncHook(["error"]),
14369
+ shutdown: new liteTapable8.AsyncSeriesHook([]),
14370
+ normalModuleFactory: new liteTapable8.SyncHook([
14371
+ "normalModuleFactory"
14372
+ ]),
14373
+ contextModuleFactory: new liteTapable8.SyncHook([
14374
+ "contextModuleFactory"
14375
+ ]),
14376
+ watchRun: new liteTapable8.AsyncSeriesHook(["compiler"]),
14377
+ watchClose: new liteTapable8.SyncHook([]),
14378
+ environment: new liteTapable8.SyncHook([]),
14379
+ afterEnvironment: new liteTapable8.SyncHook([]),
14380
+ afterPlugins: new liteTapable8.SyncHook(["compiler"]),
14381
+ afterResolvers: new liteTapable8.SyncHook(["compiler"]),
14382
+ make: new liteTapable8.AsyncParallelHook(["compilation"]),
14383
+ beforeCompile: new liteTapable8.AsyncSeriesHook(["params"]),
14384
+ afterCompile: new liteTapable8.AsyncSeriesHook(["compilation"]),
14385
+ finishMake: new liteTapable8.AsyncSeriesHook(["compilation"]),
14386
+ entryOption: new liteTapable8.SyncBailHook(["context", "entry"]),
14387
+ additionalPass: new liteTapable8.AsyncSeriesHook([])
14388
+ };
14389
+ this.webpack = rspack;
14390
+ this.rspack = rspack;
14391
+ this.root = this;
14392
+ this.outputPath = "";
14393
+ this.inputFileSystem = null;
14394
+ this.intermediateFileSystem = null;
14395
+ this.outputFileSystem = null;
14396
+ this.watchFileSystem = null;
14397
+ this.records = {};
14398
+ this.options = options;
14399
+ this.context = context2;
14400
+ this.cache = new Cache_default();
14401
+ this.compilerPath = "";
14402
+ this.running = false;
14403
+ this.idle = false;
14404
+ this.watchMode = false;
14405
+ new JsLoaderRspackPlugin(this).apply(this);
14406
+ new ExecuteModulePlugin().apply(this);
14407
+ }
14408
+ get recordsInputPath() {
14409
+ return unsupported("Compiler.recordsInputPath");
14410
+ }
14411
+ get recordsOutputPath() {
14412
+ return unsupported("Compiler.recordsOutputPath");
14413
+ }
14414
+ get managedPaths() {
14415
+ return unsupported("Compiler.managedPaths");
14416
+ }
14417
+ get immutablePaths() {
14418
+ return unsupported("Compiler.immutablePaths");
14419
+ }
14420
+ get _lastCompilation() {
14421
+ return this.#compilation;
14422
+ }
14423
+ /**
14424
+ * Note: This is not a webpack public API, maybe removed in future.
14425
+ * @internal
14426
+ */
14427
+ get __internal__builtinPlugins() {
14428
+ return this.#builtinPlugins;
14429
+ }
14430
+ /**
14431
+ * Note: This is not a webpack public API, maybe removed in future.
14432
+ * @internal
14433
+ */
14434
+ get __internal__ruleSet() {
14435
+ return this.#ruleSet;
14436
+ }
14437
+ /**
14438
+ * @param name - cache name
14439
+ * @returns the cache facade instance
14440
+ */
14441
+ getCache(name2) {
14442
+ return new CacheFacade_default(
14443
+ this.cache,
14444
+ `${this.compilerPath}${name2}`,
14445
+ this.options.output.hashFunction
14446
+ );
14447
+ }
14448
+ /**
14449
+ * @param name - name of the logger, or function called once to get the logger name
14450
+ * @returns a logger with that name
14451
+ */
14452
+ getInfrastructureLogger(name2) {
14453
+ if (!name2) {
14454
+ throw new TypeError(
14455
+ "Compiler.getInfrastructureLogger(name) called without a name"
14456
+ );
14457
+ }
14458
+ let normalizedName = name2;
14459
+ return new Logger(
13609
14460
  (type, args) => {
13610
14461
  if (typeof normalizedName === "function") {
13611
14462
  normalizedName = normalizedName();
@@ -13762,942 +14613,254 @@ var Compiler = class _Compiler {
13762
14613
  if (err) return callback(err);
13763
14614
  this.idle = false;
13764
14615
  run();
13765
- });
13766
- } else {
13767
- run();
13768
- }
13769
- }
13770
- runAsChild(callback) {
13771
- const finalCallback = (err, entries, compilation) => {
13772
- try {
13773
- callback(err, entries, compilation);
13774
- } catch (e) {
13775
- const err2 = new Error(`compiler.runAsChild callback error: ${e}`);
13776
- this.parentCompilation.errors.push(err2);
13777
- console.log(e);
13778
- }
13779
- };
13780
- this.compile((err, compilation) => {
13781
- if (err) {
13782
- return finalCallback(err);
13783
- }
13784
- assertNotNill(compilation);
13785
- this.parentCompilation.children.push(compilation);
13786
- for (const { name: name2, source, info } of compilation.getAssets()) {
13787
- if (source) {
13788
- this.parentCompilation.emitAsset(name2, source, info);
13789
- }
13790
- }
13791
- const entries = [];
13792
- for (const ep of compilation.entrypoints.values()) {
13793
- entries.push(...ep.chunks);
13794
- }
13795
- return finalCallback(null, entries, compilation);
13796
- });
13797
- }
13798
- purgeInputFileSystem() {
13799
- var _a, _b;
13800
- (_b = (_a = this.inputFileSystem) == null ? void 0 : _a.purge) == null ? void 0 : _b.call(_a);
13801
- }
13802
- /**
13803
- * @param compilation - the compilation
13804
- * @param compilerName - the compiler's name
13805
- * @param compilerIndex - the compiler's index
13806
- * @param outputOptions - the output options
13807
- * @param plugins - the plugins to apply
13808
- * @returns a child compiler
13809
- */
13810
- createChildCompiler(compilation, compilerName, compilerIndex, outputOptions, plugins2) {
13811
- const options = {
13812
- ...this.options,
13813
- output: {
13814
- ...this.options.output,
13815
- ...outputOptions
13816
- }
13817
- };
13818
- applyRspackOptionsDefaults(options);
13819
- const childCompiler = new _Compiler(this.context, options);
13820
- childCompiler.name = compilerName;
13821
- childCompiler.outputPath = this.outputPath;
13822
- childCompiler.inputFileSystem = this.inputFileSystem;
13823
- childCompiler.outputFileSystem = null;
13824
- childCompiler.modifiedFiles = this.modifiedFiles;
13825
- childCompiler.removedFiles = this.removedFiles;
13826
- childCompiler.fileTimestamps = this.fileTimestamps;
13827
- childCompiler.contextTimestamps = this.contextTimestamps;
13828
- childCompiler.fsStartTime = this.fsStartTime;
13829
- childCompiler.cache = this.cache;
13830
- childCompiler.compilerPath = `${this.compilerPath}${compilerName}|${compilerIndex}|`;
13831
- const relativeCompilerName = makePathsRelative(
13832
- this.context,
13833
- compilerName,
13834
- this.root
13835
- );
13836
- if (!this.records[relativeCompilerName]) {
13837
- this.records[relativeCompilerName] = [];
13838
- }
13839
- if (this.records[relativeCompilerName][compilerIndex]) {
13840
- childCompiler.records = this.records[relativeCompilerName][compilerIndex];
13841
- } else {
13842
- this.records[relativeCompilerName].push(childCompiler.records = {});
13843
- }
13844
- childCompiler.parentCompilation = compilation;
13845
- childCompiler.root = this.root;
13846
- if (Array.isArray(plugins2)) {
13847
- for (const plugin2 of plugins2) {
13848
- if (plugin2) {
13849
- plugin2.apply(childCompiler);
13850
- }
13851
- }
13852
- }
13853
- childCompiler.#builtinPlugins = [
13854
- ...childCompiler.#builtinPlugins,
13855
- ...this.#builtinPlugins.filter(
13856
- (plugin2) => plugin2.canInherentFromParent === true
13857
- )
13858
- ];
13859
- for (const hookName in this.hooks) {
13860
- const name2 = hookName;
13861
- if (canInherentFromParent(name2)) {
13862
- if (childCompiler.hooks[name2]) {
13863
- childCompiler.hooks[name2].taps = this.hooks[name2].taps.slice();
13864
- }
13865
- }
13866
- }
13867
- compilation.hooks.childCompiler.call(
13868
- childCompiler,
13869
- compilerName,
13870
- compilerIndex
13871
- );
13872
- return childCompiler;
13873
- }
13874
- isChild() {
13875
- const isRoot = this.root === this;
13876
- return !isRoot;
13877
- }
13878
- compile(callback) {
13879
- const startTime = Date.now();
13880
- const params = this.#newCompilationParams();
13881
- this.hooks.beforeCompile.callAsync(params, (err) => {
13882
- if (err) {
13883
- return callback(err);
13884
- }
13885
- this.hooks.compile.call(params);
13886
- this.#resetThisCompilation();
13887
- this.#build((err2) => {
13888
- if (err2) {
13889
- return callback(err2);
13890
- }
13891
- this.#compilation.startTime = startTime;
13892
- this.#compilation.endTime = Date.now();
13893
- this.hooks.afterCompile.callAsync(this.#compilation, (err3) => {
13894
- if (err3) {
13895
- return callback(err3);
13896
- }
13897
- return callback(null, this.#compilation);
13898
- });
13899
- });
13900
- });
13901
- }
13902
- close(callback) {
13903
- if (this.watching) {
13904
- this.watching.close(() => {
13905
- this.close(callback);
13906
- });
13907
- return;
13908
- }
13909
- this.hooks.shutdown.callAsync((err) => {
13910
- if (err) return callback(err);
13911
- this.cache.shutdown(callback);
13912
- });
13913
- }
13914
- #build(callback) {
13915
- this.#getInstance((error, instance) => {
13916
- if (error) {
13917
- return callback == null ? void 0 : callback(error);
13918
- }
13919
- if (!this.#initial) {
13920
- instance.rebuild(
13921
- Array.from(this.modifiedFiles || []),
13922
- Array.from(this.removedFiles || []),
13923
- (error2) => {
13924
- if (error2) {
13925
- return callback == null ? void 0 : callback(error2);
13926
- }
13927
- callback == null ? void 0 : callback(null);
13928
- }
13929
- );
13930
- return;
13931
- }
13932
- this.#initial = false;
13933
- instance.build((error2) => {
13934
- if (error2) {
13935
- return callback == null ? void 0 : callback(error2);
13936
- }
13937
- callback == null ? void 0 : callback(null);
13938
- });
13939
- });
13940
- }
13941
- /**
13942
- * Note: This is not a webpack public API, maybe removed in future.
13943
- * @internal
13944
- */
13945
- __internal__rebuild(modifiedFiles, removedFiles, callback) {
13946
- this.#getInstance((error, instance) => {
13947
- if (error) {
13948
- return callback == null ? void 0 : callback(error);
13949
- }
13950
- instance.rebuild(
13951
- Array.from(modifiedFiles || []),
13952
- Array.from(removedFiles || []),
13953
- (error2) => {
13954
- if (error2) {
13955
- return callback == null ? void 0 : callback(error2);
13956
- }
13957
- callback == null ? void 0 : callback(null);
13958
- }
13959
- );
13960
- });
13961
- }
13962
- #createCompilation(native) {
13963
- let compilation = COMPILATION_WEAK_MAP.get(native);
13964
- if (!compilation) {
13965
- compilation = new Compilation(this, native);
13966
- compilation.name = this.name;
13967
- COMPILATION_WEAK_MAP.set(native, compilation);
14616
+ });
14617
+ } else {
14618
+ run();
13968
14619
  }
13969
- this.#compilation = compilation;
13970
- return compilation;
13971
14620
  }
13972
- #resetThisCompilation() {
13973
- this.#compilation = void 0;
13974
- this.hooks.thisCompilation.intercept({
13975
- call: () => {
14621
+ runAsChild(callback) {
14622
+ const finalCallback = (err, entries, compilation) => {
14623
+ try {
14624
+ callback(err, entries, compilation);
14625
+ } catch (e) {
14626
+ const err2 = new Error(`compiler.runAsChild callback error: ${e}`);
14627
+ this.parentCompilation.errors.push(err2);
14628
+ console.log(e);
14629
+ }
14630
+ };
14631
+ this.compile((err, compilation) => {
14632
+ if (err) {
14633
+ return finalCallback(err);
14634
+ }
14635
+ assertNotNill(compilation);
14636
+ this.parentCompilation.children.push(compilation);
14637
+ for (const { name: name2, source, info } of compilation.getAssets()) {
14638
+ if (source) {
14639
+ this.parentCompilation.emitAsset(name2, source, info);
14640
+ }
14641
+ }
14642
+ const entries = [];
14643
+ for (const ep of compilation.entrypoints.values()) {
14644
+ entries.push(...ep.chunks);
13976
14645
  }
14646
+ return finalCallback(null, entries, compilation);
13977
14647
  });
13978
14648
  }
13979
- #newCompilationParams() {
13980
- const normalModuleFactory = new NormalModuleFactory();
13981
- this.hooks.normalModuleFactory.call(normalModuleFactory);
13982
- const contextModuleFactory = new ContextModuleFactory();
13983
- this.hooks.contextModuleFactory.call(contextModuleFactory);
13984
- const params = {
13985
- normalModuleFactory,
13986
- contextModuleFactory
13987
- };
13988
- this.#compilationParams = params;
13989
- return params;
14649
+ purgeInputFileSystem() {
14650
+ var _a, _b;
14651
+ (_b = (_a = this.inputFileSystem) == null ? void 0 : _a.purge) == null ? void 0 : _b.call(_a);
13990
14652
  }
13991
14653
  /**
13992
- * Lazy initialize instance so it could access the changed options
14654
+ * @param compilation - the compilation
14655
+ * @param compilerName - the compiler's name
14656
+ * @param compilerIndex - the compiler's index
14657
+ * @param outputOptions - the output options
14658
+ * @param plugins - the plugins to apply
14659
+ * @returns a child compiler
13993
14660
  */
13994
- #getInstance(callback) {
13995
- const error = checkVersion();
13996
- if (error) {
13997
- return callback(error);
14661
+ createChildCompiler(compilation, compilerName, compilerIndex, outputOptions, plugins2) {
14662
+ const options = {
14663
+ ...this.options,
14664
+ output: {
14665
+ ...this.options.output,
14666
+ ...outputOptions
14667
+ }
14668
+ };
14669
+ applyRspackOptionsDefaults(options);
14670
+ const childCompiler = new _Compiler(this.context, options);
14671
+ childCompiler.name = compilerName;
14672
+ childCompiler.outputPath = this.outputPath;
14673
+ childCompiler.inputFileSystem = this.inputFileSystem;
14674
+ childCompiler.outputFileSystem = null;
14675
+ childCompiler.modifiedFiles = this.modifiedFiles;
14676
+ childCompiler.removedFiles = this.removedFiles;
14677
+ childCompiler.fileTimestamps = this.fileTimestamps;
14678
+ childCompiler.contextTimestamps = this.contextTimestamps;
14679
+ childCompiler.fsStartTime = this.fsStartTime;
14680
+ childCompiler.cache = this.cache;
14681
+ childCompiler.compilerPath = `${this.compilerPath}${compilerName}|${compilerIndex}|`;
14682
+ const relativeCompilerName = makePathsRelative(
14683
+ this.context,
14684
+ compilerName,
14685
+ this.root
14686
+ );
14687
+ if (!this.records[relativeCompilerName]) {
14688
+ this.records[relativeCompilerName] = [];
13998
14689
  }
13999
- if (this.#instance) {
14000
- return callback(null, this.#instance);
14690
+ if (this.records[relativeCompilerName][compilerIndex]) {
14691
+ childCompiler.records = this.records[relativeCompilerName][compilerIndex];
14692
+ } else {
14693
+ this.records[relativeCompilerName].push(childCompiler.records = {});
14001
14694
  }
14002
- const options = this.options;
14003
- const rawOptions = getRawOptions(options, this);
14004
- rawOptions.__references = Object.fromEntries(
14005
- this.#ruleSet.builtinReferences.entries()
14006
- );
14007
- 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
- };
14695
+ childCompiler.parentCompilation = compilation;
14696
+ childCompiler.root = this.root;
14697
+ if (Array.isArray(plugins2)) {
14698
+ for (const plugin2 of plugins2) {
14699
+ if (plugin2) {
14700
+ plugin2.apply(childCompiler);
14534
14701
  }
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
- };
14702
+ }
14703
+ }
14704
+ childCompiler.#builtinPlugins = [
14705
+ ...childCompiler.#builtinPlugins,
14706
+ ...this.#builtinPlugins.filter(
14707
+ (plugin2) => plugin2.canInherentFromParent === true
14708
+ )
14709
+ ];
14710
+ for (const hookName in this.hooks) {
14711
+ const name2 = hookName;
14712
+ if (canInherentFromParent(name2)) {
14713
+ if (childCompiler.hooks[name2]) {
14714
+ childCompiler.hooks[name2].taps = this.hooks[name2].taps.slice();
14549
14715
  }
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
- };
14716
+ }
14717
+ }
14718
+ compilation.hooks.childCompiler.call(
14719
+ childCompiler,
14720
+ compilerName,
14721
+ compilerIndex
14722
+ );
14723
+ return childCompiler;
14724
+ }
14725
+ isChild() {
14726
+ const isRoot = this.root === this;
14727
+ return !isRoot;
14728
+ }
14729
+ compile(callback) {
14730
+ const startTime = Date.now();
14731
+ const params = this.#newCompilationParams();
14732
+ this.hooks.beforeCompile.callAsync(params, (err) => {
14733
+ if (err) {
14734
+ return callback(err);
14735
+ }
14736
+ this.hooks.compile.call(params);
14737
+ this.#resetThisCompilation();
14738
+ this.#build((err2) => {
14739
+ if (err2) {
14740
+ return callback(err2);
14564
14741
  }
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");
14742
+ this.#compilation.startTime = startTime;
14743
+ this.#compilation.endTime = Date.now();
14744
+ this.hooks.afterCompile.callAsync(this.#compilation, (err3) => {
14745
+ if (err3) {
14746
+ return callback(err3);
14747
+ }
14748
+ return callback(null, this.#compilation);
14749
+ });
14750
+ });
14751
+ });
14752
+ }
14753
+ close(callback) {
14754
+ if (this.watching) {
14755
+ this.watching.close(() => {
14756
+ this.close(callback);
14757
+ });
14758
+ return;
14759
+ }
14760
+ this.hooks.shutdown.callAsync((err) => {
14761
+ if (err) return callback(err);
14762
+ this.cache.shutdown(callback);
14763
+ });
14764
+ }
14765
+ #build(callback) {
14766
+ this.#getInstance((error, instance) => {
14767
+ if (error) {
14768
+ return callback == null ? void 0 : callback(error);
14769
+ }
14770
+ if (!this.#initial) {
14771
+ instance.rebuild(
14772
+ Array.from(this.modifiedFiles || []),
14773
+ Array.from(this.removedFiles || []),
14774
+ (error2) => {
14775
+ if (error2) {
14776
+ return callback == null ? void 0 : callback(error2);
14577
14777
  }
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
- };
14778
+ callback == null ? void 0 : callback(null);
14779
+ }
14780
+ );
14781
+ return;
14782
+ }
14783
+ this.#initial = false;
14784
+ instance.build((error2) => {
14785
+ if (error2) {
14786
+ return callback == null ? void 0 : callback(error2);
14678
14787
  }
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
- };
14788
+ callback == null ? void 0 : callback(null);
14789
+ });
14790
+ });
14791
+ }
14792
+ /**
14793
+ * Note: This is not a webpack public API, maybe removed in future.
14794
+ * @internal
14795
+ */
14796
+ __internal__rebuild(modifiedFiles, removedFiles, callback) {
14797
+ this.#getInstance((error, instance) => {
14798
+ if (error) {
14799
+ return callback == null ? void 0 : callback(error);
14800
+ }
14801
+ instance.rebuild(
14802
+ Array.from(modifiedFiles || []),
14803
+ Array.from(removedFiles || []),
14804
+ (error2) => {
14805
+ if (error2) {
14806
+ return callback == null ? void 0 : callback(error2);
14807
+ }
14808
+ callback == null ? void 0 : callback(null);
14698
14809
  }
14699
- )
14810
+ );
14811
+ });
14812
+ }
14813
+ /**
14814
+ * Note: This is not a webpack public API, maybe removed in future.
14815
+ * @internal
14816
+ */
14817
+ __internal__create_compilation(native) {
14818
+ let compilation = COMPILATION_WEAK_MAP.get(native);
14819
+ if (!compilation) {
14820
+ compilation = new Compilation(this, native);
14821
+ compilation.name = this.name;
14822
+ COMPILATION_WEAK_MAP.set(native, compilation);
14823
+ }
14824
+ this.#compilation = compilation;
14825
+ return compilation;
14826
+ }
14827
+ #resetThisCompilation() {
14828
+ this.#compilation = void 0;
14829
+ this.hooks.thisCompilation.intercept({
14830
+ call: () => {
14831
+ }
14832
+ });
14833
+ }
14834
+ #newCompilationParams() {
14835
+ const normalModuleFactory = new NormalModuleFactory();
14836
+ this.hooks.normalModuleFactory.call(normalModuleFactory);
14837
+ const contextModuleFactory = new ContextModuleFactory();
14838
+ this.hooks.contextModuleFactory.call(contextModuleFactory);
14839
+ const params = {
14840
+ normalModuleFactory,
14841
+ contextModuleFactory
14700
14842
  };
14843
+ this.#compilationParams = params;
14844
+ return params;
14845
+ }
14846
+ /**
14847
+ * Lazy initialize instance so it could access the changed options
14848
+ */
14849
+ #getInstance(callback) {
14850
+ const error = checkVersion();
14851
+ if (error) {
14852
+ return callback(error);
14853
+ }
14854
+ if (this.#instance) {
14855
+ return callback(null, this.#instance);
14856
+ }
14857
+ const options = this.options;
14858
+ const rawOptions = getRawOptions(options, this);
14859
+ rawOptions.__references = Object.fromEntries(
14860
+ this.#ruleSet.builtinReferences.entries()
14861
+ );
14862
+ const instanceBinding = require("@rspack/binding");
14863
+ this.#registers = this.#createHooksRegisters();
14701
14864
  this.#instance = new instanceBinding.Rspack(
14702
14865
  this.compilerPath,
14703
14866
  rawOptions,
@@ -14713,6 +14876,33 @@ var Compiler = class _Compiler {
14713
14876
  );
14714
14877
  callback(null, this.#instance);
14715
14878
  }
14879
+ #createHooksRegisters() {
14880
+ const ref = new WeakRef(this);
14881
+ const getCompiler = () => ref.deref();
14882
+ const createTap = this.#createHookRegisterTaps.bind(this);
14883
+ const createMapTap = this.#createHookMapRegisterTaps.bind(this);
14884
+ return {
14885
+ ...createCompilerHooksRegisters(getCompiler, createTap, createMapTap),
14886
+ ...createCompilationHooksRegisters(getCompiler, createTap, createMapTap),
14887
+ ...createNormalModuleFactoryHooksRegisters(
14888
+ getCompiler,
14889
+ createTap,
14890
+ createMapTap
14891
+ ),
14892
+ ...createContextModuleFactoryHooksRegisters(
14893
+ getCompiler,
14894
+ createTap,
14895
+ createMapTap
14896
+ ),
14897
+ ...createJavaScriptModulesHooksRegisters(
14898
+ getCompiler,
14899
+ createTap,
14900
+ createMapTap
14901
+ ),
14902
+ ...createHtmlPluginHooksRegisters(getCompiler, createTap, createMapTap),
14903
+ ...createRuntimePluginHooksRegisters(getCompiler, createTap, createMapTap)
14904
+ };
14905
+ }
14716
14906
  #updateNonSkippableRegisters() {
14717
14907
  const kinds = [];
14718
14908
  for (const { getHook, getHookMap, registerKind } of Object.values(
@@ -14748,6 +14938,10 @@ var Compiler = class _Compiler {
14748
14938
  };
14749
14939
  }
14750
14940
  }
14941
+ /**
14942
+ * Note: This is not a webpack public API, maybe removed in future.
14943
+ * @internal
14944
+ */
14751
14945
  #createHookRegisterTaps(registerKind, getHook, createTap) {
14752
14946
  const that = new WeakRef(this);
14753
14947
  const getTaps = (stages) => {
@@ -14755,9 +14949,9 @@ var Compiler = class _Compiler {
14755
14949
  const hook = getHook();
14756
14950
  if (!hook.isUsed()) return [];
14757
14951
  const breakpoints = [
14758
- liteTapable7.minStage,
14952
+ liteTapable8.minStage,
14759
14953
  ...stages,
14760
- liteTapable7.maxStage
14954
+ liteTapable8.maxStage
14761
14955
  ];
14762
14956
  const jsTaps = [];
14763
14957
  for (let i = 0; i < breakpoints.length - 1; i++) {
@@ -14768,7 +14962,7 @@ var Compiler = class _Compiler {
14768
14962
  if (!queried.isUsed()) continue;
14769
14963
  jsTaps.push({
14770
14964
  function: createTap(queried),
14771
- stage: liteTapable7.safeStage(from + 1)
14965
+ stage: liteTapable8.safeStage(from + 1)
14772
14966
  });
14773
14967
  }
14774
14968
  compiler.#decorateJsTaps(jsTaps);
@@ -14778,6 +14972,10 @@ var Compiler = class _Compiler {
14778
14972
  getTaps.getHook = getHook;
14779
14973
  return getTaps;
14780
14974
  }
14975
+ /**
14976
+ * Note: This is not a webpack public API, maybe removed in future.
14977
+ * @internal
14978
+ */
14781
14979
  #createHookMapRegisterTaps(registerKind, getHookMap, createTap) {
14782
14980
  const that = new WeakRef(this);
14783
14981
  const getTaps = (stages) => {
@@ -14785,9 +14983,9 @@ var Compiler = class _Compiler {
14785
14983
  const map = getHookMap();
14786
14984
  if (!map.isUsed()) return [];
14787
14985
  const breakpoints = [
14788
- liteTapable7.minStage,
14986
+ liteTapable8.minStage,
14789
14987
  ...stages,
14790
- liteTapable7.maxStage
14988
+ liteTapable8.maxStage
14791
14989
  ];
14792
14990
  const jsTaps = [];
14793
14991
  for (let i = 0; i < breakpoints.length - 1; i++) {
@@ -14798,7 +14996,7 @@ var Compiler = class _Compiler {
14798
14996
  if (!queried.isUsed()) continue;
14799
14997
  jsTaps.push({
14800
14998
  function: createTap(queried),
14801
- stage: liteTapable7.safeStage(from + 1)
14999
+ stage: liteTapable8.safeStage(from + 1)
14802
15000
  });
14803
15001
  }
14804
15002
  compiler.#decorateJsTaps(jsTaps);
@@ -14808,16 +15006,45 @@ var Compiler = class _Compiler {
14808
15006
  getTaps.getHookMap = getHookMap;
14809
15007
  return getTaps;
14810
15008
  }
15009
+ /**
15010
+ * Note: This is not a webpack public API, maybe removed in future.
15011
+ * @internal
15012
+ */
14811
15013
  __internal__registerBuiltinPlugin(plugin2) {
14812
15014
  this.#builtinPlugins.push(plugin2);
14813
15015
  }
15016
+ /**
15017
+ * Note: This is not a webpack public API, maybe removed in future.
15018
+ * @internal
15019
+ */
14814
15020
  __internal__getModuleExecutionResult(id) {
14815
15021
  return this.#moduleExecutionResultsMap.get(id);
14816
15022
  }
15023
+ /**
15024
+ * Note: This is not a webpack public API, maybe removed in future.
15025
+ * @internal
15026
+ */
15027
+ __internal__get_compilation() {
15028
+ return this.#compilation;
15029
+ }
15030
+ /**
15031
+ * Note: This is not a webpack public API, maybe removed in future.
15032
+ * @internal
15033
+ */
15034
+ __internal__get_compilation_params() {
15035
+ return this.#compilationParams;
15036
+ }
15037
+ /**
15038
+ * Note: This is not a webpack public API, maybe removed in future.
15039
+ * @internal
15040
+ */
15041
+ __internal__get_module_execution_results_map() {
15042
+ return this.#moduleExecutionResultsMap;
15043
+ }
14817
15044
  };
14818
15045
 
14819
15046
  // src/MultiCompiler.ts
14820
- var liteTapable8 = __toESM(require("@rspack/lite-tapable"));
15047
+ var liteTapable9 = __toESM(require("@rspack/lite-tapable"));
14821
15048
 
14822
15049
  // src/MultiStats.ts
14823
15050
  var MultiStats = class {
@@ -15070,16 +15297,16 @@ var MultiCompiler = class {
15070
15297
  normalizedCompilers = compilers;
15071
15298
  }
15072
15299
  this.hooks = {
15073
- done: new liteTapable8.SyncHook(["stats"]),
15074
- invalid: new liteTapable8.MultiHook(
15300
+ done: new liteTapable9.SyncHook(["stats"]),
15301
+ invalid: new liteTapable9.MultiHook(
15075
15302
  normalizedCompilers.map((c) => c.hooks.invalid)
15076
15303
  ),
15077
- run: new liteTapable8.MultiHook(normalizedCompilers.map((c) => c.hooks.run)),
15078
- watchClose: new liteTapable8.SyncHook([]),
15079
- watchRun: new liteTapable8.MultiHook(
15304
+ run: new liteTapable9.MultiHook(normalizedCompilers.map((c) => c.hooks.run)),
15305
+ watchClose: new liteTapable9.SyncHook([]),
15306
+ watchRun: new liteTapable9.MultiHook(
15080
15307
  normalizedCompilers.map((c) => c.hooks.watchRun)
15081
15308
  ),
15082
- infrastructureLog: new liteTapable8.MultiHook(
15309
+ infrastructureLog: new liteTapable9.MultiHook(
15083
15310
  normalizedCompilers.map((c) => c.hooks.infrastructureLog)
15084
15311
  )
15085
15312
  };
@@ -18700,9 +18927,9 @@ var matchObject = (obj, str) => {
18700
18927
  var import_zod5 = __toESM(require("../compiled/zod/index.js"));
18701
18928
 
18702
18929
  // src/builtin-plugin/FlagAllModulesAsUsedPlugin.ts
18703
- var import_binding74 = require("@rspack/binding");
18930
+ var import_binding73 = require("@rspack/binding");
18704
18931
  var FlagAllModulesAsUsedPlugin = create2(
18705
- import_binding74.BuiltinPluginName.FlagAllModulesAsUsedPlugin,
18932
+ import_binding73.BuiltinPluginName.FlagAllModulesAsUsedPlugin,
18706
18933
  (explanation) => {
18707
18934
  return {
18708
18935
  explanation
@@ -19591,9 +19818,9 @@ var NodeTemplatePlugin = class {
19591
19818
  };
19592
19819
 
19593
19820
  // src/container/ModuleFederationRuntimePlugin.ts
19594
- var import_binding75 = require("@rspack/binding");
19821
+ var import_binding74 = require("@rspack/binding");
19595
19822
  var ModuleFederationRuntimePlugin = create2(
19596
- import_binding75.BuiltinPluginName.ModuleFederationRuntimePlugin,
19823
+ import_binding74.BuiltinPluginName.ModuleFederationRuntimePlugin,
19597
19824
  () => {
19598
19825
  }
19599
19826
  );
@@ -19789,10 +20016,10 @@ function getDefaultEntryRuntime(paths, options, compiler) {
19789
20016
  }
19790
20017
 
19791
20018
  // src/sharing/ConsumeSharedPlugin.ts
19792
- var import_binding77 = require("@rspack/binding");
20019
+ var import_binding76 = require("@rspack/binding");
19793
20020
 
19794
20021
  // src/sharing/ShareRuntimePlugin.ts
19795
- var import_binding76 = require("@rspack/binding");
20022
+ var import_binding75 = require("@rspack/binding");
19796
20023
  var compilerSet = /* @__PURE__ */ new WeakSet();
19797
20024
  function isSingleton(compiler) {
19798
20025
  return compilerSet.has(compiler);
@@ -19804,7 +20031,7 @@ var ShareRuntimePlugin = class extends RspackBuiltinPlugin {
19804
20031
  constructor(enhanced = false) {
19805
20032
  super();
19806
20033
  this.enhanced = enhanced;
19807
- this.name = import_binding76.BuiltinPluginName.ShareRuntimePlugin;
20034
+ this.name = import_binding75.BuiltinPluginName.ShareRuntimePlugin;
19808
20035
  }
19809
20036
  raw(compiler) {
19810
20037
  if (isSingleton(compiler)) return;
@@ -19823,7 +20050,7 @@ function isRequiredVersion(str) {
19823
20050
  var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
19824
20051
  constructor(options) {
19825
20052
  super();
19826
- this.name = import_binding77.BuiltinPluginName.ConsumeSharedPlugin;
20053
+ this.name = import_binding76.BuiltinPluginName.ConsumeSharedPlugin;
19827
20054
  this._options = {
19828
20055
  consumes: parseOptions(
19829
20056
  options.consumes,
@@ -19886,11 +20113,11 @@ var ConsumeSharedPlugin = class extends RspackBuiltinPlugin {
19886
20113
  };
19887
20114
 
19888
20115
  // src/sharing/ProvideSharedPlugin.ts
19889
- var import_binding78 = require("@rspack/binding");
20116
+ var import_binding77 = require("@rspack/binding");
19890
20117
  var ProvideSharedPlugin = class extends RspackBuiltinPlugin {
19891
20118
  constructor(options) {
19892
20119
  super();
19893
- this.name = import_binding78.BuiltinPluginName.ProvideSharedPlugin;
20120
+ this.name = import_binding77.BuiltinPluginName.ProvideSharedPlugin;
19894
20121
  this._provides = parseOptions(
19895
20122
  options.provides,
19896
20123
  (item) => {
@@ -19995,11 +20222,11 @@ var SharePlugin = class {
19995
20222
  };
19996
20223
 
19997
20224
  // src/container/ContainerPlugin.ts
19998
- var import_binding79 = require("@rspack/binding");
20225
+ var import_binding78 = require("@rspack/binding");
19999
20226
  var ContainerPlugin = class extends RspackBuiltinPlugin {
20000
20227
  constructor(options) {
20001
20228
  super();
20002
- this.name = import_binding79.BuiltinPluginName.ContainerPlugin;
20229
+ this.name = import_binding78.BuiltinPluginName.ContainerPlugin;
20003
20230
  this._options = {
20004
20231
  name: options.name,
20005
20232
  shareScope: options.shareScope || "default",
@@ -20043,11 +20270,11 @@ var ContainerPlugin = class extends RspackBuiltinPlugin {
20043
20270
  };
20044
20271
 
20045
20272
  // src/container/ContainerReferencePlugin.ts
20046
- var import_binding80 = require("@rspack/binding");
20273
+ var import_binding79 = require("@rspack/binding");
20047
20274
  var ContainerReferencePlugin = class extends RspackBuiltinPlugin {
20048
20275
  constructor(options) {
20049
20276
  super();
20050
- this.name = import_binding80.BuiltinPluginName.ContainerReferencePlugin;
20277
+ this.name = import_binding79.BuiltinPluginName.ContainerReferencePlugin;
20051
20278
  this._options = {
20052
20279
  remoteType: options.remoteType,
20053
20280
  remotes: parseOptions(
@@ -20132,7 +20359,7 @@ var ModuleFederationPluginV1 = class {
20132
20359
  };
20133
20360
 
20134
20361
  // src/exports.ts
20135
- var import_binding81 = require("@rspack/binding");
20362
+ var import_binding80 = require("@rspack/binding");
20136
20363
  var rspackVersion = import_package.version;
20137
20364
  var version = import_package.webpackVersion;
20138
20365
  var WebpackError2 = Error;
@@ -20179,7 +20406,7 @@ var sharing = {
20179
20406
  var experiments2 = {
20180
20407
  globalTrace: {
20181
20408
  async register(filter, layer2, output2) {
20182
- (0, import_binding81.registerGlobalTrace)(filter, layer2, output2);
20409
+ (0, import_binding80.registerGlobalTrace)(filter, layer2, output2);
20183
20410
  if (layer2 === "otel") {
20184
20411
  try {
20185
20412
  const { initOpenTelemetry } = await import("@rspack/tracing");
@@ -20193,7 +20420,7 @@ var experiments2 = {
20193
20420
  }
20194
20421
  },
20195
20422
  async cleanup() {
20196
- (0, import_binding81.cleanupGlobalTrace)();
20423
+ (0, import_binding80.cleanupGlobalTrace)();
20197
20424
  try {
20198
20425
  const { shutdownOpenTelemetry } = await import("@rspack/tracing");
20199
20426
  await shutdownOpenTelemetry();
@@ -20346,6 +20573,7 @@ module.exports = rspack;
20346
20573
  RspackOptionsApply,
20347
20574
  RuntimeGlobals,
20348
20575
  RuntimeModule,
20576
+ RuntimePlugin,
20349
20577
  SourceMapDevToolPlugin,
20350
20578
  Stats,
20351
20579
  SwcJsMinimizerRspackPlugin,