@rspack-debug/core 2.0.0-beta.2 → 2.0.0-beta.3

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.
@@ -2,7 +2,7 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 780:
5
+ /***/ 61:
6
6
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7
7
 
8
8
  /*
@@ -12,13 +12,13 @@
12
12
 
13
13
 
14
14
 
15
- const Source = __nccwpck_require__(422);
16
- const streamAndGetSourceAndMap = __nccwpck_require__(334);
17
- const streamChunksOfRawSource = __nccwpck_require__(771);
18
- const streamChunksOfSourceMap = __nccwpck_require__(105);
15
+ const Source = __nccwpck_require__(331);
16
+ const streamAndGetSourceAndMap = __nccwpck_require__(439);
17
+ const streamChunksOfRawSource = __nccwpck_require__(300);
18
+ const streamChunksOfSourceMap = __nccwpck_require__(814);
19
19
  const {
20
20
  isDualStringBufferCachingEnabled,
21
- } = __nccwpck_require__(357);
21
+ } = __nccwpck_require__(806);
22
22
 
23
23
  /** @typedef {import("./Source").HashLike} HashLike */
24
24
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -101,20 +101,40 @@ class CachedSource extends Source {
101
101
  */
102
102
  constructor(source, cachedData) {
103
103
  super();
104
+ /**
105
+ * @private
106
+ * @type {Source | (() => Source)}
107
+ */
104
108
  this._source = source;
109
+ /**
110
+ * @private
111
+ * @type {boolean | undefined}
112
+ */
105
113
  this._cachedSourceType = cachedData ? cachedData.source : undefined;
106
114
  /**
107
115
  * @private
108
116
  * @type {undefined | string}
109
117
  */
110
118
  this._cachedSource = undefined;
119
+ /**
120
+ * @private
121
+ * @type {Buffer | undefined}
122
+ */
111
123
  this._cachedBuffer = cachedData ? cachedData.buffer : undefined;
124
+ /**
125
+ * @private
126
+ * @type {number | undefined}
127
+ */
112
128
  this._cachedSize = cachedData ? cachedData.size : undefined;
113
129
  /**
114
130
  * @private
115
131
  * @type {BufferedMaps}
116
132
  */
117
133
  this._cachedMaps = cachedData ? cachedData.maps : new Map();
134
+ /**
135
+ * @private
136
+ * @type {(string | Buffer)[] | undefined}
137
+ */
118
138
  this._cachedHashUpdate = cachedData ? cachedData.hash : undefined;
119
139
  }
120
140
 
@@ -408,7 +428,7 @@ module.exports = CachedSource;
408
428
 
409
429
  /***/ }),
410
430
 
411
- /***/ 844:
431
+ /***/ 961:
412
432
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
413
433
 
414
434
  /*
@@ -418,7 +438,7 @@ module.exports = CachedSource;
418
438
 
419
439
 
420
440
 
421
- const Source = __nccwpck_require__(422);
441
+ const Source = __nccwpck_require__(331);
422
442
 
423
443
  /** @typedef {import("./Source").HashLike} HashLike */
424
444
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -452,6 +472,10 @@ class CompatSource extends Source {
452
472
  */
453
473
  constructor(sourceLike) {
454
474
  super();
475
+ /**
476
+ * @private
477
+ * @type {SourceLike}
478
+ */
455
479
  this._sourceLike = sourceLike;
456
480
  }
457
481
 
@@ -520,7 +544,7 @@ module.exports = CompatSource;
520
544
 
521
545
  /***/ }),
522
546
 
523
- /***/ 974:
547
+ /***/ 523:
524
548
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
525
549
 
526
550
  /*
@@ -530,10 +554,10 @@ module.exports = CompatSource;
530
554
 
531
555
 
532
556
 
533
- const RawSource = __nccwpck_require__(136);
534
- const Source = __nccwpck_require__(422);
535
- const { getMap, getSourceAndMap } = __nccwpck_require__(875);
536
- const streamChunks = __nccwpck_require__(779);
557
+ const RawSource = __nccwpck_require__(855);
558
+ const Source = __nccwpck_require__(331);
559
+ const { getMap, getSourceAndMap } = __nccwpck_require__(568);
560
+ const streamChunks = __nccwpck_require__(786);
537
561
 
538
562
  /** @typedef {import("./CompatSource").SourceLike} SourceLike */
539
563
  /** @typedef {import("./Source").HashLike} HashLike */
@@ -573,6 +597,10 @@ class ConcatSource extends Source {
573
597
  }
574
598
  }
575
599
 
600
+ /**
601
+ * @private
602
+ * @type {boolean}
603
+ */
576
604
  this._isOptimized = args.length === 0;
577
605
  }
578
606
 
@@ -921,7 +949,7 @@ module.exports = ConcatSource;
921
949
 
922
950
  /***/ }),
923
951
 
924
- /***/ 837:
952
+ /***/ 792:
925
953
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
926
954
 
927
955
  /*
@@ -931,14 +959,14 @@ module.exports = ConcatSource;
931
959
 
932
960
 
933
961
 
934
- const Source = __nccwpck_require__(422);
935
- const { getMap, getSourceAndMap } = __nccwpck_require__(875);
936
- const getGeneratedSourceInfo = __nccwpck_require__(517);
937
- const splitIntoLines = __nccwpck_require__(492);
938
- const splitIntoPotentialTokens = __nccwpck_require__(403);
962
+ const Source = __nccwpck_require__(331);
963
+ const { getMap, getSourceAndMap } = __nccwpck_require__(568);
964
+ const getGeneratedSourceInfo = __nccwpck_require__(784);
965
+ const splitIntoLines = __nccwpck_require__(509);
966
+ const splitIntoPotentialTokens = __nccwpck_require__(674);
939
967
  const {
940
968
  isDualStringBufferCachingEnabled,
941
- } = __nccwpck_require__(357);
969
+ } = __nccwpck_require__(806);
942
970
 
943
971
  /** @typedef {import("./Source").HashLike} HashLike */
944
972
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -971,6 +999,10 @@ class OriginalSource extends Source {
971
999
  * @type {undefined | Buffer}
972
1000
  */
973
1001
  this._valueAsBuffer = isBuffer ? value : undefined;
1002
+ /**
1003
+ * @private
1004
+ * @type {string}
1005
+ */
974
1006
  this._name = name;
975
1007
  }
976
1008
 
@@ -1126,7 +1158,7 @@ module.exports = OriginalSource;
1126
1158
 
1127
1159
  /***/ }),
1128
1160
 
1129
- /***/ 850:
1161
+ /***/ 199:
1130
1162
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1131
1163
 
1132
1164
  /*
@@ -1136,10 +1168,10 @@ module.exports = OriginalSource;
1136
1168
 
1137
1169
 
1138
1170
 
1139
- const RawSource = __nccwpck_require__(136);
1140
- const Source = __nccwpck_require__(422);
1141
- const { getMap, getSourceAndMap } = __nccwpck_require__(875);
1142
- const streamChunks = __nccwpck_require__(779);
1171
+ const RawSource = __nccwpck_require__(855);
1172
+ const Source = __nccwpck_require__(331);
1173
+ const { getMap, getSourceAndMap } = __nccwpck_require__(568);
1174
+ const streamChunks = __nccwpck_require__(786);
1143
1175
 
1144
1176
  /** @typedef {import("./Source").HashLike} HashLike */
1145
1177
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -1161,6 +1193,11 @@ class PrefixSource extends Source {
1161
1193
  */
1162
1194
  constructor(prefix, source) {
1163
1195
  super();
1196
+ /**
1197
+ * @private
1198
+ * @type {string}
1199
+ */
1200
+ this._prefix = prefix;
1164
1201
  /**
1165
1202
  * @private
1166
1203
  * @type {Source}
@@ -1169,7 +1206,6 @@ class PrefixSource extends Source {
1169
1206
  typeof source === "string" || Buffer.isBuffer(source)
1170
1207
  ? new RawSource(source, true)
1171
1208
  : source;
1172
- this._prefix = prefix;
1173
1209
  }
1174
1210
 
1175
1211
  getPrefix() {
@@ -1291,7 +1327,7 @@ module.exports = PrefixSource;
1291
1327
 
1292
1328
  /***/ }),
1293
1329
 
1294
- /***/ 136:
1330
+ /***/ 855:
1295
1331
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1296
1332
 
1297
1333
  /*
@@ -1301,12 +1337,12 @@ module.exports = PrefixSource;
1301
1337
 
1302
1338
 
1303
1339
 
1304
- const Source = __nccwpck_require__(422);
1305
- const streamChunksOfRawSource = __nccwpck_require__(771);
1340
+ const Source = __nccwpck_require__(331);
1341
+ const streamChunksOfRawSource = __nccwpck_require__(300);
1306
1342
  const {
1307
1343
  internString,
1308
1344
  isDualStringBufferCachingEnabled,
1309
- } = __nccwpck_require__(357);
1345
+ } = __nccwpck_require__(806);
1310
1346
 
1311
1347
  /** @typedef {import("./Source").HashLike} HashLike */
1312
1348
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -1329,6 +1365,10 @@ class RawSource extends Source {
1329
1365
  if (!isBuffer && typeof value !== "string") {
1330
1366
  throw new TypeError("argument 'value' must be either string or Buffer");
1331
1367
  }
1368
+ /**
1369
+ * @private
1370
+ * @type {boolean}
1371
+ */
1332
1372
  this._valueIsBuffer = !convertToString && isBuffer;
1333
1373
  const internedString =
1334
1374
  typeof value === "string" ? internString(value) : undefined;
@@ -1434,7 +1474,7 @@ module.exports = RawSource;
1434
1474
 
1435
1475
  /***/ }),
1436
1476
 
1437
- /***/ 902:
1477
+ /***/ 197:
1438
1478
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1439
1479
 
1440
1480
  /*
@@ -1444,10 +1484,10 @@ module.exports = RawSource;
1444
1484
 
1445
1485
 
1446
1486
 
1447
- const Source = __nccwpck_require__(422);
1448
- const { getMap, getSourceAndMap } = __nccwpck_require__(875);
1449
- const splitIntoLines = __nccwpck_require__(492);
1450
- const streamChunks = __nccwpck_require__(779);
1487
+ const Source = __nccwpck_require__(331);
1488
+ const { getMap, getSourceAndMap } = __nccwpck_require__(568);
1489
+ const splitIntoLines = __nccwpck_require__(509);
1490
+ const streamChunks = __nccwpck_require__(786);
1451
1491
 
1452
1492
  /** @typedef {import("./Source").HashLike} HashLike */
1453
1493
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -1495,10 +1535,22 @@ class ReplaceSource extends Source {
1495
1535
  */
1496
1536
  constructor(source, name) {
1497
1537
  super();
1538
+ /**
1539
+ * @private
1540
+ * @type {Source}
1541
+ */
1498
1542
  this._source = source;
1543
+ /**
1544
+ * @private
1545
+ * @type {string | undefined}
1546
+ */
1499
1547
  this._name = name;
1500
1548
  /** @type {Replacement[]} */
1501
1549
  this._replacements = [];
1550
+ /**
1551
+ * @private
1552
+ * @type {boolean}
1553
+ */
1502
1554
  this._isSorted = true;
1503
1555
  }
1504
1556
 
@@ -1986,7 +2038,7 @@ module.exports.Replacement = Replacement;
1986
2038
 
1987
2039
  /***/ }),
1988
2040
 
1989
- /***/ 865:
2041
+ /***/ 628:
1990
2042
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1991
2043
 
1992
2044
  /*
@@ -1996,7 +2048,7 @@ module.exports.Replacement = Replacement;
1996
2048
 
1997
2049
 
1998
2050
 
1999
- const Source = __nccwpck_require__(422);
2051
+ const Source = __nccwpck_require__(331);
2000
2052
 
2001
2053
  /** @typedef {import("./Source").HashLike} HashLike */
2002
2054
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -2009,6 +2061,10 @@ class SizeOnlySource extends Source {
2009
2061
  */
2010
2062
  constructor(size) {
2011
2063
  super();
2064
+ /**
2065
+ * @private
2066
+ * @type {number}
2067
+ */
2012
2068
  this._size = size;
2013
2069
  }
2014
2070
 
@@ -2060,7 +2116,7 @@ module.exports = SizeOnlySource;
2060
2116
 
2061
2117
  /***/ }),
2062
2118
 
2063
- /***/ 422:
2119
+ /***/ 331:
2064
2120
  /***/ ((module) => {
2065
2121
 
2066
2122
  /*
@@ -2156,7 +2212,7 @@ module.exports = Source;
2156
2212
 
2157
2213
  /***/ }),
2158
2214
 
2159
- /***/ 147:
2215
+ /***/ 476:
2160
2216
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2161
2217
 
2162
2218
  /*
@@ -2166,13 +2222,13 @@ module.exports = Source;
2166
2222
 
2167
2223
 
2168
2224
 
2169
- const Source = __nccwpck_require__(422);
2170
- const { getMap, getSourceAndMap } = __nccwpck_require__(875);
2171
- const streamChunksOfCombinedSourceMap = __nccwpck_require__(132);
2172
- const streamChunksOfSourceMap = __nccwpck_require__(105);
2225
+ const Source = __nccwpck_require__(331);
2226
+ const { getMap, getSourceAndMap } = __nccwpck_require__(568);
2227
+ const streamChunksOfCombinedSourceMap = __nccwpck_require__(647);
2228
+ const streamChunksOfSourceMap = __nccwpck_require__(814);
2173
2229
  const {
2174
2230
  isDualStringBufferCachingEnabled,
2175
- } = __nccwpck_require__(357);
2231
+ } = __nccwpck_require__(806);
2176
2232
 
2177
2233
  /** @typedef {import("./Source").HashLike} HashLike */
2178
2234
  /** @typedef {import("./Source").MapOptions} MapOptions */
@@ -2191,7 +2247,7 @@ class SourceMapSource extends Source {
2191
2247
  * @param {string} name name
2192
2248
  * @param {string | Buffer | RawSourceMap=} sourceMap source map
2193
2249
  * @param {SourceValue=} originalSource original source
2194
- * @param {(string | Buffer | RawSourceMap)=} innerSourceMap inner source map
2250
+ * @param {(null | string | Buffer | RawSourceMap)=} innerSourceMap inner source map
2195
2251
  * @param {boolean=} removeOriginalSource do remove original source
2196
2252
  */
2197
2253
  constructor(
@@ -2253,10 +2309,11 @@ class SourceMapSource extends Source {
2253
2309
  * @private
2254
2310
  * @type {undefined | RawSourceMap}
2255
2311
  */
2312
+
2256
2313
  this._innerSourceMapAsObject =
2257
2314
  innerSourceMapIsBuffer || innerSourceMapIsString
2258
2315
  ? undefined
2259
- : innerSourceMap;
2316
+ : innerSourceMap || undefined;
2260
2317
  /**
2261
2318
  * @private
2262
2319
  * @type {undefined | string}
@@ -2529,7 +2586,7 @@ module.exports = SourceMapSource;
2529
2586
 
2530
2587
  /***/ }),
2531
2588
 
2532
- /***/ 294:
2589
+ /***/ 983:
2533
2590
  /***/ ((module) => {
2534
2591
 
2535
2592
  /*
@@ -2761,7 +2818,7 @@ module.exports = createMappingsSerializer;
2761
2818
 
2762
2819
  /***/ }),
2763
2820
 
2764
- /***/ 875:
2821
+ /***/ 568:
2765
2822
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2766
2823
 
2767
2824
  /*
@@ -2771,7 +2828,7 @@ module.exports = createMappingsSerializer;
2771
2828
 
2772
2829
 
2773
2830
 
2774
- const createMappingsSerializer = __nccwpck_require__(294);
2831
+ const createMappingsSerializer = __nccwpck_require__(983);
2775
2832
 
2776
2833
  /** @typedef {import("../Source").RawSourceMap} RawSourceMap */
2777
2834
  /** @typedef {import("../Source").SourceAndMap} SourceAndMap */
@@ -2781,12 +2838,11 @@ const createMappingsSerializer = __nccwpck_require__(294);
2781
2838
  /** @typedef {{ streamChunks: StreamChunksFunction }} SourceLikeWithStreamChunks */
2782
2839
 
2783
2840
  /**
2784
- * @param {SourceLikeWithStreamChunks} inputSource input source
2841
+ * @param {SourceLikeWithStreamChunks} source source
2785
2842
  * @param {Options=} options options
2786
- * @returns {SourceAndMap} map
2843
+ * @returns {RawSourceMap | null} map
2787
2844
  */
2788
- module.exports.getSourceAndMap = (inputSource, options) => {
2789
- let code = "";
2845
+ module.exports.getMap = (source, options) => {
2790
2846
  let mappings = "";
2791
2847
  /** @type {(string | null)[]} */
2792
2848
  const potentialSources = [];
@@ -2795,8 +2851,8 @@ module.exports.getSourceAndMap = (inputSource, options) => {
2795
2851
  /** @type {(string | null)[]} */
2796
2852
  const potentialNames = [];
2797
2853
  const addMapping = createMappingsSerializer(options);
2798
- const { source } = inputSource.streamChunks(
2799
- { ...options, finalSource: true },
2854
+ source.streamChunks(
2855
+ { ...options, source: false, finalSource: true },
2800
2856
  (
2801
2857
  chunk,
2802
2858
  generatedLine,
@@ -2806,7 +2862,6 @@ module.exports.getSourceAndMap = (inputSource, options) => {
2806
2862
  originalColumn,
2807
2863
  nameIndex,
2808
2864
  ) => {
2809
- if (chunk !== undefined) code += chunk;
2810
2865
  mappings += addMapping(
2811
2866
  generatedLine,
2812
2867
  generatedColumn,
@@ -2835,32 +2890,29 @@ module.exports.getSourceAndMap = (inputSource, options) => {
2835
2890
  potentialNames[nameIndex] = name;
2836
2891
  },
2837
2892
  );
2838
- return {
2839
- source: source !== undefined ? source : code,
2840
- map:
2841
- mappings.length > 0
2842
- ? {
2843
- version: 3,
2844
- file: "x",
2845
- mappings,
2846
- // We handle broken sources as `null`, in spec this field should be string, but no information what we should do in such cases if we change type it will be breaking change
2847
- sources: /** @type {string[]} */ (potentialSources),
2848
- sourcesContent:
2849
- potentialSourcesContent.length > 0
2850
- ? /** @type {string[]} */ (potentialSourcesContent)
2851
- : undefined,
2852
- names: /** @type {string[]} */ (potentialNames),
2853
- }
2854
- : null,
2855
- };
2893
+ return mappings.length > 0
2894
+ ? {
2895
+ version: 3,
2896
+ file: "x",
2897
+ mappings,
2898
+ // We handle broken sources as `null`, in spec this field should be string, but no information what we should do in such cases if we change type it will be breaking change
2899
+ sources: /** @type {string[]} */ (potentialSources),
2900
+ sourcesContent:
2901
+ potentialSourcesContent.length > 0
2902
+ ? /** @type {string[]} */ (potentialSourcesContent)
2903
+ : undefined,
2904
+ names: /** @type {string[]} */ (potentialNames),
2905
+ }
2906
+ : null;
2856
2907
  };
2857
2908
 
2858
2909
  /**
2859
- * @param {SourceLikeWithStreamChunks} source source
2910
+ * @param {SourceLikeWithStreamChunks} inputSource input source
2860
2911
  * @param {Options=} options options
2861
- * @returns {RawSourceMap | null} map
2912
+ * @returns {SourceAndMap} map
2862
2913
  */
2863
- module.exports.getMap = (source, options) => {
2914
+ module.exports.getSourceAndMap = (inputSource, options) => {
2915
+ let code = "";
2864
2916
  let mappings = "";
2865
2917
  /** @type {(string | null)[]} */
2866
2918
  const potentialSources = [];
@@ -2869,8 +2921,8 @@ module.exports.getMap = (source, options) => {
2869
2921
  /** @type {(string | null)[]} */
2870
2922
  const potentialNames = [];
2871
2923
  const addMapping = createMappingsSerializer(options);
2872
- source.streamChunks(
2873
- { ...options, source: false, finalSource: true },
2924
+ const { source } = inputSource.streamChunks(
2925
+ { ...options, finalSource: true },
2874
2926
  (
2875
2927
  chunk,
2876
2928
  generatedLine,
@@ -2880,6 +2932,7 @@ module.exports.getMap = (source, options) => {
2880
2932
  originalColumn,
2881
2933
  nameIndex,
2882
2934
  ) => {
2935
+ if (chunk !== undefined) code += chunk;
2883
2936
  mappings += addMapping(
2884
2937
  generatedLine,
2885
2938
  generatedColumn,
@@ -2908,26 +2961,30 @@ module.exports.getMap = (source, options) => {
2908
2961
  potentialNames[nameIndex] = name;
2909
2962
  },
2910
2963
  );
2911
- return mappings.length > 0
2912
- ? {
2913
- version: 3,
2914
- file: "x",
2915
- mappings,
2916
- // We handle broken sources as `null`, in spec this field should be string, but no information what we should do in such cases if we change type it will be breaking change
2917
- sources: /** @type {string[]} */ (potentialSources),
2918
- sourcesContent:
2919
- potentialSourcesContent.length > 0
2920
- ? /** @type {string[]} */ (potentialSourcesContent)
2921
- : undefined,
2922
- names: /** @type {string[]} */ (potentialNames),
2923
- }
2924
- : null;
2964
+ return {
2965
+ source: source !== undefined ? source : code,
2966
+ map:
2967
+ mappings.length > 0
2968
+ ? {
2969
+ version: 3,
2970
+ file: "x",
2971
+ mappings,
2972
+ // We handle broken sources as `null`, in spec this field should be string, but no information what we should do in such cases if we change type it will be breaking change
2973
+ sources: /** @type {string[]} */ (potentialSources),
2974
+ sourcesContent:
2975
+ potentialSourcesContent.length > 0
2976
+ ? /** @type {string[]} */ (potentialSourcesContent)
2977
+ : undefined,
2978
+ names: /** @type {string[]} */ (potentialNames),
2979
+ }
2980
+ : null,
2981
+ };
2925
2982
  };
2926
2983
 
2927
2984
 
2928
2985
  /***/ }),
2929
2986
 
2930
- /***/ 517:
2987
+ /***/ 784:
2931
2988
  /***/ ((module) => {
2932
2989
 
2933
2990
  /*
@@ -2978,7 +3035,7 @@ module.exports = getGeneratedSourceInfo;
2978
3035
 
2979
3036
  /***/ }),
2980
3037
 
2981
- /***/ 432:
3038
+ /***/ 711:
2982
3039
  /***/ ((module) => {
2983
3040
 
2984
3041
  /*
@@ -3009,7 +3066,7 @@ module.exports = getSource;
3009
3066
 
3010
3067
  /***/ }),
3011
3068
 
3012
- /***/ 950:
3069
+ /***/ 28:
3013
3070
  /***/ ((module) => {
3014
3071
 
3015
3072
  /*
@@ -3136,7 +3193,7 @@ module.exports = readMappings;
3136
3193
 
3137
3194
  /***/ }),
3138
3195
 
3139
- /***/ 492:
3196
+ /***/ 509:
3140
3197
  /***/ ((module) => {
3141
3198
 
3142
3199
  /*
@@ -3176,7 +3233,7 @@ module.exports = splitIntoLines;
3176
3233
 
3177
3234
  /***/ }),
3178
3235
 
3179
- /***/ 403:
3236
+ /***/ 674:
3180
3237
  /***/ ((module) => {
3181
3238
 
3182
3239
  /*
@@ -3236,7 +3293,7 @@ module.exports = splitIntoPotentialTokens;
3236
3293
 
3237
3294
  /***/ }),
3238
3295
 
3239
- /***/ 334:
3296
+ /***/ 439:
3240
3297
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
3241
3298
 
3242
3299
  /*
@@ -3246,8 +3303,8 @@ module.exports = splitIntoPotentialTokens;
3246
3303
 
3247
3304
 
3248
3305
 
3249
- const createMappingsSerializer = __nccwpck_require__(294);
3250
- const streamChunks = __nccwpck_require__(779);
3306
+ const createMappingsSerializer = __nccwpck_require__(983);
3307
+ const streamChunks = __nccwpck_require__(786);
3251
3308
 
3252
3309
  /** @typedef {import("../Source").RawSourceMap} RawSourceMap */
3253
3310
  /** @typedef {import("./streamChunks").GeneratedSourceInfo} GeneratedSourceInfo */
@@ -3366,7 +3423,7 @@ module.exports = streamAndGetSourceAndMap;
3366
3423
 
3367
3424
  /***/ }),
3368
3425
 
3369
- /***/ 779:
3426
+ /***/ 786:
3370
3427
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
3371
3428
 
3372
3429
  /*
@@ -3376,8 +3433,8 @@ module.exports = streamAndGetSourceAndMap;
3376
3433
 
3377
3434
 
3378
3435
 
3379
- const streamChunksOfRawSource = __nccwpck_require__(771);
3380
- const streamChunksOfSourceMap = __nccwpck_require__(105);
3436
+ const streamChunksOfRawSource = __nccwpck_require__(300);
3437
+ const streamChunksOfSourceMap = __nccwpck_require__(814);
3381
3438
 
3382
3439
  /** @typedef {import("../Source")} Source */
3383
3440
  /** @typedef {import("./getGeneratedSourceInfo").GeneratedSourceInfo} GeneratedSourceInfo */
@@ -3435,7 +3492,7 @@ module.exports = (source, options, onChunk, onSource, onName) => {
3435
3492
 
3436
3493
  /***/ }),
3437
3494
 
3438
- /***/ 132:
3495
+ /***/ 647:
3439
3496
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
3440
3497
 
3441
3498
  /*
@@ -3445,8 +3502,8 @@ module.exports = (source, options, onChunk, onSource, onName) => {
3445
3502
 
3446
3503
 
3447
3504
 
3448
- const splitIntoLines = __nccwpck_require__(492);
3449
- const streamChunksOfSourceMap = __nccwpck_require__(105);
3505
+ const splitIntoLines = __nccwpck_require__(509);
3506
+ const streamChunksOfSourceMap = __nccwpck_require__(814);
3450
3507
 
3451
3508
  /** @typedef {import("../Source").RawSourceMap} RawSourceMap */
3452
3509
  /** @typedef {import("./getGeneratedSourceInfo").GeneratedSourceInfo} GeneratedSourceInfo */
@@ -3808,7 +3865,7 @@ module.exports = streamChunksOfCombinedSourceMap;
3808
3865
 
3809
3866
  /***/ }),
3810
3867
 
3811
- /***/ 771:
3868
+ /***/ 300:
3812
3869
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
3813
3870
 
3814
3871
  /*
@@ -3818,8 +3875,8 @@ module.exports = streamChunksOfCombinedSourceMap;
3818
3875
 
3819
3876
 
3820
3877
 
3821
- const getGeneratedSourceInfo = __nccwpck_require__(517);
3822
- const splitIntoLines = __nccwpck_require__(492);
3878
+ const getGeneratedSourceInfo = __nccwpck_require__(784);
3879
+ const splitIntoLines = __nccwpck_require__(509);
3823
3880
 
3824
3881
  /** @typedef {import("./getGeneratedSourceInfo").GeneratedSourceInfo} GeneratedSourceInfo */
3825
3882
  /** @typedef {import("./streamChunks").OnChunk} OnChunk */
@@ -3869,7 +3926,7 @@ module.exports = (source, onChunk, onSource, onName, finalSource) =>
3869
3926
 
3870
3927
  /***/ }),
3871
3928
 
3872
- /***/ 105:
3929
+ /***/ 814:
3873
3930
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
3874
3931
 
3875
3932
  /*
@@ -3879,10 +3936,10 @@ module.exports = (source, onChunk, onSource, onName, finalSource) =>
3879
3936
 
3880
3937
 
3881
3938
 
3882
- const getGeneratedSourceInfo = __nccwpck_require__(517);
3883
- const getSource = __nccwpck_require__(432);
3884
- const readMappings = __nccwpck_require__(950);
3885
- const splitIntoLines = __nccwpck_require__(492);
3939
+ const getGeneratedSourceInfo = __nccwpck_require__(784);
3940
+ const getSource = __nccwpck_require__(711);
3941
+ const readMappings = __nccwpck_require__(28);
3942
+ const splitIntoLines = __nccwpck_require__(509);
3886
3943
 
3887
3944
  /** @typedef {import("../Source").RawSourceMap} RawSourceMap */
3888
3945
  /** @typedef {import("./getGeneratedSourceInfo").GeneratedSourceInfo} GeneratedSourceInfo */
@@ -4375,7 +4432,7 @@ module.exports = (
4375
4432
 
4376
4433
  /***/ }),
4377
4434
 
4378
- /***/ 357:
4435
+ /***/ 806:
4379
4436
  /***/ ((module) => {
4380
4437
 
4381
4438
  /*
@@ -4490,16 +4547,16 @@ function internString(str) {
4490
4547
  module.exports = {
4491
4548
  disableDualStringBufferCaching,
4492
4549
  enableDualStringBufferCaching,
4493
- internString,
4494
- isDualStringBufferCachingEnabled,
4495
4550
  enterStringInterningRange,
4496
4551
  exitStringInterningRange,
4552
+ internString,
4553
+ isDualStringBufferCachingEnabled,
4497
4554
  };
4498
4555
 
4499
4556
 
4500
4557
  /***/ }),
4501
4558
 
4502
- /***/ 339:
4559
+ /***/ 340:
4503
4560
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
4504
4561
 
4505
4562
  /*
@@ -4586,38 +4643,38 @@ module.exports = mergeExports(
4586
4643
  {},
4587
4644
  {
4588
4645
  get Source() {
4589
- return __nccwpck_require__(422);
4646
+ return __nccwpck_require__(331);
4590
4647
  },
4591
4648
  get RawSource() {
4592
- return __nccwpck_require__(136);
4649
+ return __nccwpck_require__(855);
4593
4650
  },
4594
4651
  get OriginalSource() {
4595
- return __nccwpck_require__(837);
4652
+ return __nccwpck_require__(792);
4596
4653
  },
4597
4654
  get SourceMapSource() {
4598
- return __nccwpck_require__(147);
4655
+ return __nccwpck_require__(476);
4599
4656
  },
4600
4657
  get CachedSource() {
4601
- return __nccwpck_require__(780);
4658
+ return __nccwpck_require__(61);
4602
4659
  },
4603
4660
  get ConcatSource() {
4604
- return __nccwpck_require__(974);
4661
+ return __nccwpck_require__(523);
4605
4662
  },
4606
4663
  get ReplaceSource() {
4607
- return __nccwpck_require__(902);
4664
+ return __nccwpck_require__(197);
4608
4665
  },
4609
4666
  get PrefixSource() {
4610
- return __nccwpck_require__(850);
4667
+ return __nccwpck_require__(199);
4611
4668
  },
4612
4669
  get SizeOnlySource() {
4613
- return __nccwpck_require__(865);
4670
+ return __nccwpck_require__(628);
4614
4671
  },
4615
4672
  get CompatSource() {
4616
- return __nccwpck_require__(844);
4673
+ return __nccwpck_require__(961);
4617
4674
  },
4618
4675
  util: {
4619
4676
  get stringBufferUtils() {
4620
- return __nccwpck_require__(357);
4677
+ return __nccwpck_require__(806);
4621
4678
  },
4622
4679
  },
4623
4680
  },
@@ -4668,7 +4725,7 @@ module.exports = mergeExports(
4668
4725
  /******/ // startup
4669
4726
  /******/ // Load entry module and return exports
4670
4727
  /******/ // This entry module is referenced by other modules so it can't be inlined
4671
- /******/ var __webpack_exports__ = __nccwpck_require__(339);
4728
+ /******/ var __webpack_exports__ = __nccwpck_require__(340);
4672
4729
  /******/ module.exports = __webpack_exports__;
4673
4730
  /******/
4674
4731
  /******/ })()
@@ -1 +1 @@
1
- {"name":"webpack-sources","author":"Tobias Koppers @sokra","version":"3.3.3","license":"MIT","types":"types.d.ts","type":"commonjs"}
1
+ {"name":"webpack-sources","author":"Tobias Koppers @sokra","version":"3.3.4","license":"MIT","types":"types.d.ts","type":"commonjs"}
@@ -371,7 +371,7 @@ declare class SourceMapSource extends Source {
371
371
  name: string,
372
372
  sourceMap?: string | RawSourceMap | Buffer,
373
373
  originalSource?: string | Buffer,
374
- innerSourceMap?: string | RawSourceMap | Buffer,
374
+ innerSourceMap?: null | string | RawSourceMap | Buffer,
375
375
  removeOriginalSource?: boolean,
376
376
  );
377
377
  getArgsAsBuffers(): [
@@ -407,14 +407,15 @@ declare interface StreamChunksOptions {
407
407
  finalSource?: boolean;
408
408
  columns?: boolean;
409
409
  }
410
+
410
411
  export namespace util {
411
412
  export namespace stringBufferUtils {
412
413
  export let disableDualStringBufferCaching: () => void;
413
414
  export let enableDualStringBufferCaching: () => void;
414
- export let internString: (str: string) => string;
415
- export let isDualStringBufferCachingEnabled: () => boolean;
416
415
  export let enterStringInterningRange: () => void;
417
416
  export let exitStringInterningRange: () => void;
417
+ export let internString: (str: string) => string;
418
+ export let isDualStringBufferCachingEnabled: () => boolean;
418
419
  }
419
420
  }
420
421
  export type OnChunk = (
@@ -456,3 +457,5 @@ declare interface StreamChunksOptions {
456
457
  StreamChunksOptions,
457
458
  };
458
459
 
460
+
461
+
@@ -10,7 +10,7 @@
10
10
  import type { AssetInfo, ChunkGroup, Dependency, ExternalObject, JsCompilation } from '@rspack/binding';
11
11
  import binding from '@rspack/binding';
12
12
  export type { AssetInfo } from '@rspack/binding';
13
- import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d';
13
+ import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
14
14
  import type { Source } from '../compiled/webpack-sources';
15
15
  import type { EntryOptions, EntryPlugin } from './builtin-plugin/index.js';
16
16
  import type { Chunk } from './Chunk.js';
@@ -8,7 +8,7 @@
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
10
  import type binding from '@rspack/binding';
11
- import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d';
11
+ import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
12
12
  import type Watchpack from '../compiled/watchpack';
13
13
  import type { Source } from '../compiled/webpack-sources';
14
14
  import type { Chunk } from './Chunk.js';
@@ -1,4 +1,4 @@
1
- import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d';
1
+ import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
2
2
  import type { ContextModuleFactoryAfterResolveResult, ContextModuleFactoryBeforeResolveResult } from './Module.js';
3
3
  export declare class ContextModuleFactory {
4
4
  hooks: {
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d';
10
+ import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
11
11
  import type { CompilationParams, Compiler, CompilerHooks, RspackOptions } from './index.js';
12
12
  import type { WatchOptions } from './config/index.js';
13
13
  import MultiStats from './MultiStats.js';
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.d';
10
+ import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
11
11
  import type { MultiCompiler } from './MultiCompiler.js';
12
12
  import type { Watching } from './Watching.js';
13
13
  declare class MultiWatching {
@@ -1,4 +1,4 @@
1
- import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d';
1
+ import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
2
2
  import type { Compilation } from './Compilation.js';
3
3
  import type { LoaderContext } from './config/index.js';
4
4
  import type { Module } from './Module.js';
@@ -1,5 +1,5 @@
1
1
  import type binding from '@rspack/binding';
2
- import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d';
2
+ import * as liteTapable from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
3
3
  import type { ResolveData, ResourceDataWithData } from './Module.js';
4
4
  import type { ResolveOptionsWithDependencyType, ResolverFactory } from './ResolverFactory.js';
5
5
  export type NormalModuleCreateData = binding.JsNormalModuleFactoryCreateModuleArgs & {
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.d';
10
+ import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
11
11
  import type { Compiler } from './index.js';
12
12
  import { Stats } from './index.js';
13
13
  import type { WatchOptions } from './config/index.js';
@@ -1,5 +1,5 @@
1
1
  import { type BuiltinPlugin, BuiltinPluginName } from '@rspack/binding';
2
- import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d';
2
+ import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
3
3
  import type { Chunk } from '../Chunk.js';
4
4
  import { type Compilation } from '../Compilation.js';
5
5
  import type Hash from '../util/hash/index.js';
@@ -1,9 +1,10 @@
1
- import { type RawProgressPluginOptions } from '@rspack/binding';
2
- export type ProgressPluginArgument = Partial<Omit<RawProgressPluginOptions, 'handler'>> | ((percentage: number, msg: string, ...args: string[]) => void) | undefined;
1
+ import { type RawProgressPluginHandlerInfo, type RawProgressPluginOptions } from '@rspack/binding';
2
+ export type ProgressPluginOptions = Partial<Omit<RawProgressPluginOptions, 'handler'>> | ((percentage: number, msg: string, info: RawProgressPluginHandlerInfo) => void) | undefined;
3
+ export type ProgressPluginHandlerInfo = RawProgressPluginHandlerInfo;
3
4
  export declare const ProgressPlugin: {
4
- new (progress?: ProgressPluginArgument): {
5
+ new (progress?: ProgressPluginOptions): {
5
6
  name: string;
6
- _args: [progress?: ProgressPluginArgument];
7
+ _args: [progress?: ProgressPluginOptions];
7
8
  affectedHooks: keyof import("../index.js").CompilerHooks | undefined;
8
9
  raw(compiler: import("../index.js").Compiler): import("@rspack/binding").BuiltinPlugin;
9
10
  apply(compiler: import("../index.js").Compiler): void;
@@ -1,5 +1,5 @@
1
1
  import { type JsRsdoctorAsset, type JsRsdoctorAssetPatch, type JsRsdoctorChunk, type JsRsdoctorChunkAssets, type JsRsdoctorChunkGraph, type JsRsdoctorChunkModules, type JsRsdoctorDependency, type JsRsdoctorEntrypoint, type JsRsdoctorEntrypointAssets, type JsRsdoctorExportInfo, type JsRsdoctorModule, type JsRsdoctorModuleGraph, type JsRsdoctorModuleGraphModule, type JsRsdoctorModuleIdsPatch, type JsRsdoctorModuleOriginalSource, type JsRsdoctorModuleSourcesPatch, type JsRsdoctorSideEffect, type JsRsdoctorSourcePosition, type JsRsdoctorSourceRange, type JsRsdoctorStatement, type JsRsdoctorVariable } from '@rspack/binding';
2
- import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d';
2
+ import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
3
3
  import { type Compilation } from '../Compilation.js';
4
4
  import type { Compiler } from '../Compiler.js';
5
5
  import type { CreatePartialRegisters } from '../taps/types.js';
@@ -1,5 +1,5 @@
1
1
  import binding from '@rspack/binding';
2
- import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d';
2
+ import * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
3
3
  import type { Chunk } from '../Chunk.js';
4
4
  import { type Compilation } from '../Compilation.js';
5
5
  import type { CreatePartialRegisters } from '../taps/types.js';
@@ -1,5 +1,5 @@
1
1
  import type { JsAfterEmitData, JsAfterTemplateExecutionData, JsAlterAssetTagGroupsData, JsAlterAssetTagsData, JsBeforeAssetTagGenerationData, JsBeforeEmitData } from '@rspack/binding';
2
- import * as liteTapable from '../../../compiled/@rspack/lite-tapable/dist/index.d';
2
+ import * as liteTapable from '../../../compiled/@rspack/lite-tapable/dist/index.d.ts';
3
3
  import { type Compilation } from '../../Compilation.js';
4
4
  import type { HtmlRspackPluginOptions } from './options.js';
5
5
  type ExtraPluginHookData = {
@@ -601,6 +601,8 @@ export type ResolveOptions = {
601
601
  byDependency?: Record<string, ResolveOptions>;
602
602
  /** enable Yarn PnP */
603
603
  pnp?: boolean;
604
+ /** Path to PnP manifest file */
605
+ pnpManifest?: string | false;
604
606
  };
605
607
  /** Used to configure the Rspack module resolution */
606
608
  export type Resolve = ResolveOptions;
@@ -2085,6 +2087,10 @@ export type Incremental = {
2085
2087
  * Enable incremental build chunk graph.
2086
2088
  */
2087
2089
  buildChunkGraph?: boolean;
2090
+ /**
2091
+ * Enable incremental optimize chunk modules.
2092
+ */
2093
+ optimizeChunkModules?: boolean;
2088
2094
  /**
2089
2095
  * Enable incremental module ids.
2090
2096
  */
package/dist/exports.d.ts CHANGED
@@ -46,7 +46,7 @@ export declare const util: {
46
46
  createHash: (algorithm: "xxhash64" | "md4" | "native-md4" | (string & {}) | (new () => import("./util/hash/index.js").default)) => import("./util/hash/index.js").default;
47
47
  cleverMerge: <First, Second>(first: First, second: Second) => First | Second | (First & Second);
48
48
  };
49
- export type { BannerPluginArgument, DefinePluginOptions, EntryOptions, ProgressPluginArgument, ProvidePluginOptions, } from './builtin-plugin/index.js';
49
+ export type { BannerPluginArgument, DefinePluginOptions, EntryOptions, ProgressPluginHandlerInfo, ProgressPluginOptions, ProvidePluginOptions, } from './builtin-plugin/index.js';
50
50
  export { BannerPlugin, CaseSensitivePlugin, DefinePlugin, DynamicEntryPlugin, EntryPlugin, ExternalsPlugin, HotModuleReplacementPlugin, IgnorePlugin, type IgnorePluginOptions, NoEmitOnErrorsPlugin, ProgressPlugin, ProvidePlugin, RuntimePlugin, } from './builtin-plugin/index.js';
51
51
  export { DllPlugin, type DllPluginOptions } from './lib/DllPlugin.js';
52
52
  export { DllReferencePlugin, type DllReferencePluginOptions, type DllReferencePluginOptionsContent, type DllReferencePluginOptionsManifest, type DllReferencePluginOptionsSourceType, } from './lib/DllReferencePlugin.js';
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import node_path, { isAbsolute, join, relative, resolve as external_node_path_re
8
8
  import node_querystring from "node:querystring";
9
9
  import node_fs, { readFileSync } from "node:fs";
10
10
  __webpack_require__.add({
11
- "../../node_modules/.pnpm/enhanced-resolve@5.18.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
11
+ "../../node_modules/.pnpm/enhanced-resolve@5.19.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js" (module, __unused_rspack_exports, __webpack_require__) {
12
12
  let { nextTick } = __webpack_require__("process"), dirname = (path)=>{
13
13
  let idx = path.length - 1;
14
14
  for(; idx >= 0;){
@@ -812,7 +812,7 @@ let lib_WebpackError = WebpackError, LogType = Object.freeze({
812
812
  cache: 'cache'
813
813
  });
814
814
  function getLogTypeBitFlag(type) {
815
- return 1 << Object.values(LogType).findIndex((i)=>i === type);
815
+ return 1 << Object.values(LogType).indexOf(type);
816
816
  }
817
817
  function getLogTypesBitFlag(types) {
818
818
  return types.reduce((acc, cur)=>acc | getLogTypeBitFlag(cur), 0);
@@ -1789,10 +1789,10 @@ function createDiagnosticArray(adm) {
1789
1789
  reduce: (callbackfn, initialValue)=>adm.values().reduce(callbackfn, initialValue),
1790
1790
  reduceRight: (callbackfn, initialValue)=>adm.values().reduceRight(callbackfn, initialValue)
1791
1791
  }, proxy = new Proxy(array, {
1792
- get: (target, name)=>'length' === name ? adm.length : 'string' != typeof name || Number.isNaN(Number.parseInt(name)) ? Object.prototype.hasOwnProperty.call(arrayExtensions, name) ? arrayExtensions[name] : target[name] : adm.get(Number.parseInt(name)),
1792
+ get: (target, name)=>'length' === name ? adm.length : 'string' != typeof name || Number.isNaN(Number.parseInt(name, 10)) ? Object.prototype.hasOwnProperty.call(arrayExtensions, name) ? arrayExtensions[name] : target[name] : adm.get(Number.parseInt(name, 10)),
1793
1793
  set (target, name, value) {
1794
1794
  if ('length' === name) throw Error("The 'length' property is read-only and cannot be assigned a new value.");
1795
- return 'symbol' == typeof name || Number.isNaN(Number.parseInt(name)) ? target[name] = value : adm.set(Number.parseInt(name), value), !0;
1795
+ return 'symbol' == typeof name || Number.isNaN(Number.parseInt(name, 10)) ? target[name] = value : adm.set(Number.parseInt(name, 10), value), !0;
1796
1796
  }
1797
1797
  });
1798
1798
  return adm[$proxy] = proxy, proxy;
@@ -4901,7 +4901,7 @@ let lazyCompilationMiddlewareInternal = (compiler, activeModules, lazyCompilatio
4901
4901
  });
4902
4902
  }(req);
4903
4903
  } catch (err) {
4904
- logger.error('Failed to parse request body: ' + err), res.writeHead(400), res.end('Bad Request');
4904
+ logger.error(`Failed to parse request body: ${err}`), res.writeHead(400), res.end('Bad Request');
4905
4905
  return;
4906
4906
  }
4907
4907
  let moduleActivated = [];
@@ -4952,8 +4952,8 @@ let NodeTargetPlugin = base_create(binding_namespaceObject.BuiltinPluginName.Nod
4952
4952
  })), OccurrenceChunkIdsPlugin = base_create(binding_namespaceObject.BuiltinPluginName.OccurrenceChunkIdsPlugin, (options)=>({
4953
4953
  ...options
4954
4954
  }), 'compilation'), ProgressPlugin = base_create(binding_namespaceObject.BuiltinPluginName.ProgressPlugin, (progress = {})=>'function' == typeof progress ? {
4955
- handler: (percentage, msg, items)=>{
4956
- progress(percentage, msg, ...items);
4955
+ handler: (percentage, msg, info)=>{
4956
+ progress(percentage, msg, info);
4957
4957
  }
4958
4958
  } : progress), ProvidePlugin = base_create(binding_namespaceObject.BuiltinPluginName.ProvidePlugin, (provide)=>Object.fromEntries(Object.entries(provide).map(([key, value])=>('string' == typeof value && (value = [
4959
4959
  value
@@ -5352,7 +5352,7 @@ class ContextModuleFactory {
5352
5352
  };
5353
5353
  }
5354
5354
  }
5355
- let FUNCTION_CONTENT_REGEX = /^function\s?\(\)\s?\{\r?\n?|\r?\n?\}$/g, INDENT_MULTILINE_REGEX = /^\t/gm, LINE_SEPARATOR_REGEX = /\r?\n/g, IDENTIFIER_NAME_REPLACE_REGEX = /^([^a-zA-Z$_])/, IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX = /[^a-zA-Z0-9$]+/g, COMMENT_END_REGEX = /\*\//g, PATH_NAME_NORMALIZE_REPLACE_REGEX = /[^a-zA-Z0-9_!§$()=\-^°]+/g, MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g;
5355
+ let FUNCTION_CONTENT_REGEX = /^function(?:\s+[\w$]+)?\s?\(\)\s?\{\r?\n?|\r?\n?\}$/g, INDENT_MULTILINE_REGEX = /^\t/gm, LINE_SEPARATOR_REGEX = /\r?\n/g, IDENTIFIER_NAME_REPLACE_REGEX = /^([^a-zA-Z$_])/, IDENTIFIER_ALPHA_NUMERIC_NAME_REPLACE_REGEX = /[^a-zA-Z0-9$]+/g, COMMENT_END_REGEX = /\*\//g, PATH_NAME_NORMALIZE_REPLACE_REGEX = /[^a-zA-Z0-9_!§$()=\-^°]+/g, MATCH_PADDED_HYPHENS_REPLACE_REGEX = /^-|-$/g;
5356
5356
  class Template {
5357
5357
  static getFunctionContent(fn) {
5358
5358
  return fn.toString().replace(FUNCTION_CONTENT_REGEX, '').replace(INDENT_MULTILINE_REGEX, '').replace(LINE_SEPARATOR_REGEX, '\n');
@@ -6507,7 +6507,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6507
6507
  }, applyExperimentsDefaults = (experiments)=>{
6508
6508
  D(experiments, 'futureDefaults', !1), D(experiments, 'asyncWebAssembly', !0), D(experiments, 'deferImport', !1), D(experiments, 'buildHttp', void 0), experiments.buildHttp && 'object' == typeof experiments.buildHttp && D(experiments.buildHttp, 'upgrade', !1), D(experiments, 'useInputFileSystem', !1);
6509
6509
  }, applyIncrementalDefaults = (options)=>{
6510
- D(options, 'incremental', {}), 'object' == typeof options.incremental && (D(options.incremental, 'silent', !0), D(options.incremental, 'buildModuleGraph', !0), D(options.incremental, 'finishModules', !0), D(options.incremental, 'optimizeDependencies', !0), D(options.incremental, 'buildChunkGraph', !0), D(options.incremental, 'moduleIds', !0), D(options.incremental, 'chunkIds', !0), D(options.incremental, 'modulesHashes', !0), D(options.incremental, 'modulesCodegen', !0), D(options.incremental, 'modulesRuntimeRequirements', !0), D(options.incremental, 'chunksRuntimeRequirements', !0), D(options.incremental, 'chunksHashes', !0), D(options.incremental, 'chunkAsset', !0), D(options.incremental, 'emitAssets', !0));
6510
+ D(options, 'incremental', {}), 'object' == typeof options.incremental && (D(options.incremental, 'silent', !0), D(options.incremental, 'buildModuleGraph', !0), D(options.incremental, 'finishModules', !0), D(options.incremental, 'optimizeDependencies', !0), D(options.incremental, 'buildChunkGraph', !0), D(options.incremental, 'optimizeChunkModules', !0), D(options.incremental, 'moduleIds', !0), D(options.incremental, 'chunkIds', !0), D(options.incremental, 'modulesHashes', !0), D(options.incremental, 'modulesCodegen', !0), D(options.incremental, 'modulesRuntimeRequirements', !0), D(options.incremental, 'chunksRuntimeRequirements', !0), D(options.incremental, 'chunksHashes', !0), D(options.incremental, 'chunkAsset', !0), D(options.incremental, 'emitAssets', !0));
6511
6511
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyCssGeneratorOptionsDefaults = (generatorOptions, { targetProperties })=>{
6512
6512
  D(generatorOptions, 'exportsOnly', !targetProperties || !1 === targetProperties.document), D(generatorOptions, 'esModule', !0);
6513
6513
  }, applyModuleDefaults = (module, { asyncWebAssembly, targetProperties, mode, uniqueName, deferImport })=>{
@@ -6784,7 +6784,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6784
6784
  return output.wasmLoading && enabledWasmLoadingTypes.add(output.wasmLoading), output.workerWasmLoading && enabledWasmLoadingTypes.add(output.workerWasmLoading), forEachEntry((desc)=>{
6785
6785
  desc.wasmLoading && enabledWasmLoadingTypes.add(desc.wasmLoading);
6786
6786
  }), Array.from(enabledWasmLoadingTypes);
6787
- }), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-beta.2"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !output.library));
6787
+ }), D(output, 'bundlerInfo', {}), 'object' == typeof output.bundlerInfo && (D(output.bundlerInfo, 'version', "2.0.0-beta.3"), D(output.bundlerInfo, 'bundler', 'rspack'), D(output.bundlerInfo, 'force', !output.library));
6788
6788
  }, applyExternalsPresetsDefaults = (externalsPresets, { targetProperties, buildHttp, outputModule })=>{
6789
6789
  let isUniversal = (key)=>!!(outputModule && targetProperties && null === targetProperties[key]);
6790
6790
  D(externalsPresets, 'web', !buildHttp && targetProperties && (targetProperties.web || isUniversal('node'))), D(externalsPresets, 'node', targetProperties && (targetProperties.node || isUniversal('node'))), D(externalsPresets, 'electron', targetProperties && targetProperties.electron || isUniversal('electron')), D(externalsPresets, 'electronMain', targetProperties && !!targetProperties.electron && (targetProperties.electronMain || isUniversal('electronMain'))), D(externalsPresets, 'electronPreload', targetProperties && !!targetProperties.electron && (targetProperties.electronPreload || isUniversal('electronPreload'))), D(externalsPresets, 'electronRenderer', targetProperties && !!targetProperties.electron && (targetProperties.electronRenderer || isUniversal('electronRenderer'))), D(externalsPresets, 'nwjs', targetProperties && (targetProperties.nwjs || isUniversal('nwjs')));
@@ -7204,6 +7204,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7204
7204
  finishModules: !1,
7205
7205
  optimizeDependencies: !1,
7206
7206
  buildChunkGraph: !0,
7207
+ optimizeChunkModules: !1,
7207
7208
  moduleIds: !1,
7208
7209
  chunkIds: !1,
7209
7210
  modulesHashes: !1,
@@ -8037,7 +8038,7 @@ class MultiStats {
8037
8038
  obj.children = this.stats.map((stat, idx)=>{
8038
8039
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8039
8040
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8040
- }), childOptions.version && (obj.rspackVersion = "2.0.0-beta.2", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8041
+ }), childOptions.version && (obj.rspackVersion = "2.0.0-beta.3", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(''));
8041
8042
  let mapError = (j, obj)=>({
8042
8043
  ...obj,
8043
8044
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8534,7 +8535,7 @@ let arraySum = (array)=>{
8534
8535
  let str = `${a}`, length = lengths[i];
8535
8536
  return str.length === length ? str : length > 5 ? `...${str.slice(-length + 3)}` : length > 0 ? str.slice(-length) : '';
8536
8537
  });
8537
- }, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.18.4/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
8538
+ }, CachedInputFileSystem = __webpack_require__("../../node_modules/.pnpm/enhanced-resolve@5.19.0/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js");
8538
8539
  var CachedInputFileSystem_default = __webpack_require__.n(CachedInputFileSystem);
8539
8540
  class NodeEnvironmentPlugin {
8540
8541
  options;
@@ -9296,7 +9297,7 @@ let iterateConfig = (config, options, fn)=>{
9296
9297
  object.hash = context.getStatsCompilation(compilation).hash;
9297
9298
  },
9298
9299
  version: (object)=>{
9299
- object.version = "5.75.0", object.rspackVersion = "2.0.0-beta.2";
9300
+ object.version = "5.75.0", object.rspackVersion = "2.0.0-beta.3";
9300
9301
  },
9301
9302
  env: (object, _compilation, _context, { _env })=>{
9302
9303
  object.env = _env;
@@ -10958,7 +10959,7 @@ class TraceHookPlugin {
10958
10959
  });
10959
10960
  }
10960
10961
  }
10961
- let CORE_VERSION = "2.0.0-beta.2", VFILES_BY_COMPILER = new WeakMap();
10962
+ let CORE_VERSION = "2.0.0-beta.3", VFILES_BY_COMPILER = new WeakMap();
10962
10963
  class VirtualModulesPlugin {
10963
10964
  #staticModules;
10964
10965
  #compiler;
@@ -13145,7 +13146,7 @@ function getDefaultEntryRuntime(paths, options, compiler, treeShakingShareFallba
13145
13146
  `const __module_federation_library_type__ = ${JSON.stringify(libraryType)}`,
13146
13147
  compiler.webpack.Template.getFunctionContent(ModuleFederationPlugin_require('./moduleFederationDefaultRuntime.js').default)
13147
13148
  ].join(';');
13148
- return `@module-federation/runtime/rspack.js!=!data:text/javascript,${content}`;
13149
+ return `@module-federation/runtime/rspack.js!=!data:text/javascript,${encodeURIComponent(content)}`;
13149
13150
  }
13150
13151
  class ContainerPlugin extends RspackBuiltinPlugin {
13151
13152
  name = binding_namespaceObject.BuiltinPluginName.ContainerPlugin;
@@ -13242,7 +13243,7 @@ async function transform(source, options) {
13242
13243
  let _options = JSON.stringify(options || {});
13243
13244
  return binding_default().transform(source, _options);
13244
13245
  }
13245
- let exports_rspackVersion = "2.0.0-beta.2", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13246
+ let exports_rspackVersion = "2.0.0-beta.3", exports_version = "5.75.0", exports_WebpackError = Error, exports_config = {
13246
13247
  getNormalizedRspackOptions: getNormalizedRspackOptions,
13247
13248
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
13248
13249
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist/index.d';
10
+ import { AsyncParallelHook, AsyncSeriesBailHook, SyncHook } from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
11
11
  import type { WebpackError } from './WebpackError.js';
12
12
  export interface Etag {
13
13
  toString(): string;
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Callback } from '../../compiled/@rspack/lite-tapable/dist/index.d';
10
+ import type { Callback } from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
11
11
  import WebpackError from './WebpackError.js';
12
12
  export declare class HookWebpackError extends WebpackError {
13
13
  hook: string;
package/dist/rspack.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * Copyright (c) JS Foundation and other contributors
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
- import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.d';
10
+ import type { Callback } from '../compiled/@rspack/lite-tapable/dist/index.d.ts';
11
11
  import { Compiler } from './Compiler.js';
12
12
  import { type RspackOptions } from './config/index.js';
13
13
  import { MultiCompiler, type MultiRspackOptions } from './MultiCompiler.js';
@@ -8,7 +8,7 @@
8
8
  * https://github.com/webpack/webpack/blob/main/LICENSE
9
9
  */
10
10
  import type { JsStats, JsStatsCompilation, JsStatsError } from '@rspack/binding';
11
- import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.d';
11
+ import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
12
12
  import type { Compilation } from '../Compilation.js';
13
13
  import { type GroupConfig } from '../util/smartGrouping.js';
14
14
  export type KnownStatsFactoryContext = {
@@ -1,4 +1,4 @@
1
- import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.d';
1
+ import { HookMap, SyncBailHook, SyncWaterfallHook } from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
2
2
  import type { StatsAsset, StatsChunk, StatsChunkGroup, StatsCompilation, StatsModule, StatsModuleReason } from './statsFactoryUtils.js';
3
3
  type PrintedElement = {
4
4
  element: string;
@@ -1,5 +1,5 @@
1
1
  import type binding from '@rspack/binding';
2
- import type * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d';
2
+ import type * as liteTapable from '../../compiled/@rspack/lite-tapable/dist/index.d.ts';
3
3
  import type { Compiler } from '../Compiler.js';
4
4
  type CreateHookMapRegisterTaps = <H extends liteTapable.Hook<any, any, any>>(registerKind: binding.RegisterJsTapKind, getHookMap: () => liteTapable.HookMap<H>, createTap: (queried: liteTapable.QueriedHookMap<H>) => any) => (stages: number[]) => binding.JsTap[];
5
5
  type CreateHookRegisterTaps = <T, R, A>(registerKind: binding.RegisterJsTapKind, getHook: () => liteTapable.Hook<T, R, A>, createTap: (queried: liteTapable.QueriedHook<T, R, A>) => any) => (stages: number[]) => binding.JsTap[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack-debug/core",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.3",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -41,13 +41,13 @@
41
41
  "@napi-rs/wasm-runtime": "1.0.7",
42
42
  "@rsbuild/plugin-node-polyfill": "^1.4.4",
43
43
  "@rspack/lite-tapable": "1.1.0",
44
- "@rslib/core": "0.19.5",
44
+ "@rslib/core": "0.19.6",
45
45
  "@swc/types": "0.1.25",
46
46
  "@types/node": "^20.19.33",
47
47
  "@types/watchpack": "^2.4.5",
48
48
  "browserslist-load-config": "^1.0.1",
49
49
  "browserslist-to-es-version": "^1.4.1",
50
- "enhanced-resolve": "5.18.4",
50
+ "enhanced-resolve": "5.19.0",
51
51
  "glob-to-regexp": "^0.4.1",
52
52
  "memfs": "4.53.0",
53
53
  "prebundle": "^1.6.2",
@@ -55,10 +55,10 @@
55
55
  "tsx": "^4.21.0",
56
56
  "typescript": "^5.9.3",
57
57
  "watchpack": "^2.4.4",
58
- "webpack-sources": "3.3.3"
58
+ "webpack-sources": "3.3.4"
59
59
  },
60
60
  "dependencies": {
61
- "@rspack/binding": "npm:@rspack-debug/binding@2.0.0-beta.2"
61
+ "@rspack/binding": "npm:@rspack-debug/binding@2.0.0-beta.3"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@module-federation/runtime-tools": "^0.24.1 || ^2.0.0",
@@ -75,9 +75,6 @@
75
75
  "scripts": {
76
76
  "build": "rslib build",
77
77
  "build:browser": "rslib build -c rslib.browser.config.ts",
78
- "dev": "rslib build --watch",
79
- "doc-coverage": "tsx ./scripts/check-documentation-coverage.ts",
80
- "api-extractor": "api-extractor run --verbose",
81
- "api-extractor:ci": "api-extractor run --verbose || diff temp/core.api.md etc/core.api.md"
78
+ "dev": "rslib build --watch"
82
79
  }
83
80
  }