@rsbuild/core 1.6.10 → 1.6.12-canary-63b4dae2-20251204065915

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/131.js CHANGED
@@ -17,35 +17,7 @@ import { isPromise, isRegExp } from "node:util/types";
17
17
  import { promisify as external_node_util_promisify } from "node:util";
18
18
  import node_zlib from "node:zlib";
19
19
  __webpack_require__.add({
20
- "../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
21
- let clone = __webpack_require__("../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js"), typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js"), isPlainObject = __webpack_require__("../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js");
22
- function cloneDeep(val, instanceClone) {
23
- switch(typeOf(val)){
24
- case 'object':
25
- return cloneObjectDeep(val, instanceClone);
26
- case 'array':
27
- return cloneArrayDeep(val, instanceClone);
28
- default:
29
- return clone(val);
30
- }
31
- }
32
- function cloneObjectDeep(val, instanceClone) {
33
- if ('function' == typeof instanceClone) return instanceClone(val);
34
- if (instanceClone || isPlainObject(val)) {
35
- let res = new val.constructor();
36
- for(let key in val)res[key] = cloneDeep(val[key], instanceClone);
37
- return res;
38
- }
39
- return val;
40
- }
41
- function cloneArrayDeep(val, instanceClone) {
42
- let res = new val.constructor(val.length);
43
- for(let i = 0; i < val.length; i++)res[i] = cloneDeep(val[i], instanceClone);
44
- return res;
45
- }
46
- module.exports = cloneDeep;
47
- },
48
- "../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js": function(module) {
20
+ "../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js" (module) {
49
21
  var isMergeableObject = function isMergeableObject(value) {
50
22
  return isNonNullObject(value) && !isSpecial(value);
51
23
  };
@@ -114,7 +86,7 @@ __webpack_require__.add({
114
86
  }, {});
115
87
  }, module.exports = deepmerge;
116
88
  },
117
- "../../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js": function(module) {
89
+ "../../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js" (module) {
118
90
  function _resolveEscapeSequences(value) {
119
91
  return value.replace(/\\\$/g, '$');
120
92
  }
@@ -146,7 +118,7 @@ __webpack_require__.add({
146
118
  }
147
119
  module.exports.expand = expand;
148
120
  },
149
- "../../node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js": function(module) {
121
+ "../../node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js" (module) {
150
122
  function listener(event, done) {
151
123
  return function onevent(arg1) {
152
124
  for(var args = Array(arguments.length), i = 0; i < args.length; i++)args[i] = arguments[i];
@@ -179,72 +151,7 @@ __webpack_require__.add({
179
151
  return thunk.cancel = cleanup, thunk;
180
152
  };
181
153
  },
182
- "../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js": function(module) {
183
- function isBuffer(obj) {
184
- return obj && obj.constructor && 'function' == typeof obj.constructor.isBuffer && obj.constructor.isBuffer(obj);
185
- }
186
- function keyIdentity(key) {
187
- return key;
188
- }
189
- function flatten(target, opts) {
190
- let delimiter = (opts = opts || {}).delimiter || '.', maxDepth = opts.maxDepth, transformKey = opts.transformKey || keyIdentity, output = {};
191
- function step(object, prev, currentDepth) {
192
- currentDepth = currentDepth || 1, Object.keys(object).forEach(function(key) {
193
- let value = object[key], isarray = opts.safe && Array.isArray(value), type = Object.prototype.toString.call(value), isbuffer = isBuffer(value), newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
194
- if (!isarray && !isbuffer && ('[object Object]' === type || '[object Array]' === type) && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
195
- output[newKey] = value;
196
- });
197
- }
198
- return step(target), output;
199
- }
200
- function unflatten(target, opts) {
201
- let delimiter = (opts = opts || {}).delimiter || '.', overwrite = opts.overwrite || !1, transformKey = opts.transformKey || keyIdentity, result = {};
202
- if (isBuffer(target) || '[object Object]' !== Object.prototype.toString.call(target)) return target;
203
- function getkey(key) {
204
- let parsedKey = Number(key);
205
- return isNaN(parsedKey) || -1 !== key.indexOf('.') || opts.object ? key : parsedKey;
206
- }
207
- function addKeys(keyPrefix, recipient, target) {
208
- return Object.keys(target).reduce(function(result, key) {
209
- return result[keyPrefix + delimiter + key] = target[key], result;
210
- }, recipient);
211
- }
212
- function isEmpty(val) {
213
- let type = Object.prototype.toString.call(val);
214
- return !val || ('[object Array]' === type ? !val.length : '[object Object]' === type ? !Object.keys(val).length : void 0);
215
- }
216
- return Object.keys(target = Object.keys(target).reduce(function(result, key) {
217
- let type = Object.prototype.toString.call(target[key]);
218
- return '[object Object]' !== type && '[object Array]' !== type || isEmpty(target[key]) ? (result[key] = target[key], result) : addKeys(key, result, flatten(target[key], opts));
219
- }, {})).forEach(function(key) {
220
- let split = key.split(delimiter).map(transformKey), key1 = getkey(split.shift()), key2 = getkey(split[0]), recipient = result;
221
- for(; void 0 !== key2;){
222
- if ('__proto__' === key1) return;
223
- let type = Object.prototype.toString.call(recipient[key1]), isobject = '[object Object]' === type || '[object Array]' === type;
224
- if (!overwrite && !isobject && void 0 !== recipient[key1]) return;
225
- (!overwrite || isobject) && (overwrite || null != recipient[key1]) || (recipient[key1] = 'number' != typeof key2 || opts.object ? {} : []), recipient = recipient[key1], split.length > 0 && (key1 = getkey(split.shift()), key2 = getkey(split[0]));
226
- }
227
- recipient[key1] = unflatten(target[key], opts);
228
- }), result;
229
- }
230
- module.exports = flatten, flatten.flatten = flatten, flatten.unflatten = unflatten;
231
- },
232
- "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
233
- var isObject = __webpack_require__("../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js");
234
- function isObjectObject(o) {
235
- return !0 === isObject(o) && '[object Object]' === Object.prototype.toString.call(o);
236
- }
237
- module.exports = function isPlainObject(o) {
238
- var ctor, prot;
239
- return !1 !== isObjectObject(o) && 'function' == typeof (ctor = o.constructor) && !1 !== isObjectObject(prot = ctor.prototype) && !1 !== prot.hasOwnProperty('isPrototypeOf');
240
- };
241
- },
242
- "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js": function(module) {
243
- module.exports = function isObject(val) {
244
- return null != val && 'object' == typeof val && !1 === Array.isArray(val);
245
- };
246
- },
247
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js": function(__unused_webpack_module, exports) {
154
+ "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js" (__unused_webpack_module, exports) {
248
155
  Object.defineProperty(exports, "__esModule", {
249
156
  value: !0
250
157
  }), exports.arrayToString = void 0, exports.arrayToString = (array, space, next)=>{
@@ -255,7 +162,7 @@ __webpack_require__.add({
255
162
  return `[${eol}${values}${eol}]`;
256
163
  };
257
164
  },
258
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js": function(__unused_webpack_module, exports, __webpack_require__) {
165
+ "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js" (__unused_webpack_module, exports, __webpack_require__) {
259
166
  Object.defineProperty(exports, "__esModule", {
260
167
  value: !0
261
168
  }), exports.FunctionParser = exports.dedentFunction = exports.functionToString = exports.USED_METHOD_KEY = void 0;
@@ -393,7 +300,7 @@ __webpack_require__.add({
393
300
  }
394
301
  exports.FunctionParser = FunctionParser;
395
302
  },
396
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
303
+ "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js" (__unused_webpack_module, exports, __webpack_require__) {
397
304
  exports.stringify = void 0;
398
305
  let stringify_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js"), quote_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), ROOT_SENTINEL = Symbol("root");
399
306
  function replacerToString(replacer) {
@@ -429,7 +336,7 @@ __webpack_require__.add({
429
336
  return result;
430
337
  };
431
338
  },
432
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js": function(__unused_webpack_module, exports, __webpack_require__) {
339
+ "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js" (__unused_webpack_module, exports, __webpack_require__) {
433
340
  Object.defineProperty(exports, "__esModule", {
434
341
  value: !0
435
342
  }), exports.objectToString = void 0;
@@ -463,7 +370,7 @@ __webpack_require__.add({
463
370
  "[object Window]": globalToString
464
371
  };
465
372
  },
466
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js": function(__unused_webpack_module, exports) {
373
+ "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js" (__unused_webpack_module, exports) {
467
374
  Object.defineProperty(exports, "__esModule", {
468
375
  value: !0
469
376
  }), exports.stringifyPath = exports.quoteKey = exports.isValidVariableName = exports.IS_VALID_IDENTIFIER = exports.quoteString = void 0;
@@ -519,7 +426,7 @@ __webpack_require__.add({
519
426
  return result;
520
427
  };
521
428
  },
522
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js": function(__unused_webpack_module, exports, __webpack_require__) {
429
+ "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js" (__unused_webpack_module, exports, __webpack_require__) {
523
430
  Object.defineProperty(exports, "__esModule", {
524
431
  value: !0
525
432
  }), exports.toString = void 0;
@@ -538,104 +445,7 @@ __webpack_require__.add({
538
445
  };
539
446
  exports.toString = (value, space, next, key)=>null === value ? "null" : PRIMITIVE_TYPES[typeof value](value, space, next, key);
540
447
  },
541
- "../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js": function(module) {
542
- var toString = Object.prototype.toString;
543
- function ctorName(val) {
544
- return 'function' == typeof val.constructor ? val.constructor.name : null;
545
- }
546
- function isArray(val) {
547
- return Array.isArray ? Array.isArray(val) : val instanceof Array;
548
- }
549
- function isError(val) {
550
- return val instanceof Error || 'string' == typeof val.message && val.constructor && 'number' == typeof val.constructor.stackTraceLimit;
551
- }
552
- function isDate(val) {
553
- return val instanceof Date || 'function' == typeof val.toDateString && 'function' == typeof val.getDate && 'function' == typeof val.setDate;
554
- }
555
- function isRegexp(val) {
556
- return val instanceof RegExp || 'string' == typeof val.flags && 'boolean' == typeof val.ignoreCase && 'boolean' == typeof val.multiline && 'boolean' == typeof val.global;
557
- }
558
- function isGeneratorFn(name, val) {
559
- return 'GeneratorFunction' === ctorName(name);
560
- }
561
- function isGeneratorObj(val) {
562
- return 'function' == typeof val.throw && 'function' == typeof val.return && 'function' == typeof val.next;
563
- }
564
- function isArguments(val) {
565
- try {
566
- if ('number' == typeof val.length && 'function' == typeof val.callee) return !0;
567
- } catch (err) {
568
- if (-1 !== err.message.indexOf('callee')) return !0;
569
- }
570
- return !1;
571
- }
572
- function isBuffer(val) {
573
- return !!val.constructor && 'function' == typeof val.constructor.isBuffer && val.constructor.isBuffer(val);
574
- }
575
- module.exports = function kindOf(val) {
576
- if (void 0 === val) return 'undefined';
577
- if (null === val) return 'null';
578
- var type = typeof val;
579
- if ('boolean' === type) return 'boolean';
580
- if ('string' === type) return 'string';
581
- if ('number' === type) return 'number';
582
- if ('symbol' === type) return 'symbol';
583
- if ('function' === type) return isGeneratorFn(val) ? 'generatorfunction' : 'function';
584
- if (isArray(val)) return 'array';
585
- if (isBuffer(val)) return 'buffer';
586
- if (isArguments(val)) return 'arguments';
587
- if (isDate(val)) return 'date';
588
- if (isError(val)) return 'error';
589
- if (isRegexp(val)) return 'regexp';
590
- switch(ctorName(val)){
591
- case 'Symbol':
592
- return 'symbol';
593
- case 'Promise':
594
- return 'promise';
595
- case 'WeakMap':
596
- return 'weakmap';
597
- case 'WeakSet':
598
- return 'weakset';
599
- case 'Map':
600
- return 'map';
601
- case 'Set':
602
- return 'set';
603
- case 'Int8Array':
604
- return 'int8array';
605
- case 'Uint8Array':
606
- return 'uint8array';
607
- case 'Uint8ClampedArray':
608
- return 'uint8clampedarray';
609
- case 'Int16Array':
610
- return 'int16array';
611
- case 'Uint16Array':
612
- return 'uint16array';
613
- case 'Int32Array':
614
- return 'int32array';
615
- case 'Uint32Array':
616
- return 'uint32array';
617
- case 'Float32Array':
618
- return 'float32array';
619
- case 'Float64Array':
620
- return 'float64array';
621
- }
622
- if (isGeneratorObj(val)) return 'generator';
623
- switch(type = toString.call(val)){
624
- case '[object Object]':
625
- return 'object';
626
- case '[object Map Iterator]':
627
- return 'mapiterator';
628
- case '[object Set Iterator]':
629
- return 'setiterator';
630
- case '[object String Iterator]':
631
- return 'stringiterator';
632
- case '[object Array Iterator]':
633
- return 'arrayiterator';
634
- }
635
- return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
636
- };
637
- },
638
- "../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
448
+ "../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js" (module, __unused_webpack_exports, __webpack_require__) {
639
449
  let path = __webpack_require__("path"), fs = __webpack_require__("fs"), os = __webpack_require__("os"), url = __webpack_require__("url"), fsReadFileAsync = fs.promises.readFile;
640
450
  function getDefaultSearchPlaces(name, sync) {
641
451
  return [
@@ -890,7 +700,7 @@ __webpack_require__.add({
890
700
  };
891
701
  };
892
702
  },
893
- "../../node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
703
+ "../../node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js" (module, __unused_webpack_exports, __webpack_require__) {
894
704
  module.exports = onFinished, module.exports.isFinished = isFinished;
895
705
  var asyncHooks = tryRequireAsyncHooks(), first = __webpack_require__("../../node_modules/.pnpm/ee-first@1.1.1/node_modules/ee-first/index.js"), defer = 'function' == typeof setImmediate ? setImmediate : function(fn) {
896
706
  process.nextTick(fn.bind.apply(fn, arguments));
@@ -956,7 +766,7 @@ __webpack_require__.add({
956
766
  return (asyncHooks.AsyncResource && (res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')), res && res.runInAsyncScope) ? res.runInAsyncScope.bind(res, fn, null) : fn;
957
767
  }
958
768
  },
959
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
769
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/index.js" (module, __unused_webpack_exports, __webpack_require__) {
960
770
  let yaml, { resolve } = __webpack_require__("node:path"), config = __webpack_require__("../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js"), loadOptions = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/options.js"), loadPlugins = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js"), req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/req.js");
961
771
  async function processResult(ctx, result) {
962
772
  let obj, file = result.filepath || '', projectConfig = ((obj = result.config) && obj.__esModule ? obj : {
@@ -1030,7 +840,7 @@ __webpack_require__.add({
1030
840
  });
1031
841
  };
1032
842
  },
1033
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/options.js": function(module, __unused_webpack_exports, __webpack_require__) {
843
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/options.js" (module, __unused_webpack_exports, __webpack_require__) {
1034
844
  let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/req.js");
1035
845
  module.exports = async function options(config, file) {
1036
846
  if (config.parser && 'string' == typeof config.parser) try {
@@ -1051,7 +861,7 @@ __webpack_require__.add({
1051
861
  return config;
1052
862
  };
1053
863
  },
1054
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js": function(module, __unused_webpack_exports, __webpack_require__) {
864
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/plugins.js" (module, __unused_webpack_exports, __webpack_require__) {
1055
865
  let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/req.js");
1056
866
  async function load(plugin, options, file) {
1057
867
  try {
@@ -1068,9 +878,9 @@ __webpack_require__.add({
1068
878
  }), list;
1069
879
  };
1070
880
  },
1071
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/req.js": function(module, __unused_webpack_exports, __webpack_require__) {
881
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.1/node_modules/postcss-load-config/src/req.js" (module, __unused_webpack_exports, __webpack_require__) {
1072
882
  let tsx, jiti;
1073
- var __filename = __webpack_fileURLToPath__(import.meta.url);
883
+ var __filename = __rspack_fileURLToPath(import.meta.url);
1074
884
  let { createRequire } = __webpack_require__("node:module"), { pathToFileURL } = __webpack_require__("node:url"), TS_EXT_RE = /\.[mc]?ts$/, importError = [];
1075
885
  module.exports = async function req(name, rootFile = __filename) {
1076
886
  let url = createRequire(rootFile).resolve(name);
@@ -1099,516 +909,28 @@ __webpack_require__.add({
1099
909
  throw Error(`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${importError.map((error)=>error.message).join('\n')}`);
1100
910
  };
1101
911
  },
1102
- "../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1103
- let valueOf = Symbol.prototype.valueOf, typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js");
1104
- function cloneRegExp(val) {
1105
- let flags = void 0 !== val.flags ? val.flags : /\w+$/.exec(val) || void 0, re = new val.constructor(val.source, flags);
1106
- return re.lastIndex = val.lastIndex, re;
1107
- }
1108
- function cloneArrayBuffer(val) {
1109
- let res = new val.constructor(val.byteLength);
1110
- return new Uint8Array(res).set(new Uint8Array(val)), res;
1111
- }
1112
- function cloneTypedArray(val, deep) {
1113
- return new val.constructor(val.buffer, val.byteOffset, val.length);
1114
- }
1115
- function cloneBuffer(val) {
1116
- let len = val.length, buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len);
1117
- return val.copy(buf), buf;
1118
- }
1119
- function cloneSymbol(val) {
1120
- return valueOf ? Object(valueOf.call(val)) : {};
1121
- }
1122
- module.exports = function clone(val, deep) {
1123
- switch(typeOf(val)){
1124
- case 'array':
1125
- return val.slice();
1126
- case 'object':
1127
- return Object.assign({}, val);
1128
- case 'date':
1129
- return new val.constructor(Number(val));
1130
- case 'map':
1131
- return new Map(val);
1132
- case 'set':
1133
- return new Set(val);
1134
- case 'buffer':
1135
- return cloneBuffer(val);
1136
- case 'symbol':
1137
- return cloneSymbol(val);
1138
- case 'arraybuffer':
1139
- return cloneArrayBuffer(val);
1140
- case 'float32array':
1141
- case 'float64array':
1142
- case 'int16array':
1143
- case 'int32array':
1144
- case 'int8array':
1145
- case 'uint16array':
1146
- case 'uint32array':
1147
- case 'uint8clampedarray':
1148
- case 'uint8array':
1149
- return cloneTypedArray(val);
1150
- case 'regexp':
1151
- return cloneRegExp(val);
1152
- case 'error':
1153
- return Object.create(val);
1154
- default:
1155
- return val;
1156
- }
1157
- };
1158
- },
1159
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
1160
- var __read = this && this.__read || function(o, n) {
1161
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1162
- if (!m) return o;
1163
- var r, e, i = m.call(o), ar = [];
1164
- try {
1165
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1166
- } catch (error) {
1167
- e = {
1168
- error: error
1169
- };
1170
- } finally{
1171
- try {
1172
- r && !r.done && (m = i.return) && m.call(i);
1173
- } finally{
1174
- if (e) throw e.error;
1175
- }
1176
- }
1177
- return ar;
1178
- }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
1179
- if (pack || 2 == arguments.length) for(var ar, i = 0, l = from.length; i < l; i++)!ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
1180
- return to.concat(ar || Array.prototype.slice.call(from));
1181
- }, __importDefault = this && this.__importDefault || function(mod) {
1182
- return mod && mod.__esModule ? mod : {
1183
- default: mod
1184
- };
1185
- };
1186
- Object.defineProperty(exports, "__esModule", {
1187
- value: !0
1188
- }), exports.unique = exports.mergeWithRules = exports.mergeWithCustomize = exports.default = exports.merge = exports.CustomizeRule = exports.customizeObject = exports.customizeArray = void 0;
1189
- var wildcard_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/wildcard@2.0.1/node_modules/wildcard/index.js")), merge_with_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js")), join_arrays_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/join-arrays.js"));
1190
- exports.unique = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js")).default;
1191
- var types_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js");
1192
- Object.defineProperty(exports, "CustomizeRule", {
1193
- enumerable: !0,
1194
- get: function() {
1195
- return types_1.CustomizeRule;
1196
- }
1197
- });
1198
- var utils_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js");
1199
- function merge(firstConfiguration) {
1200
- for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
1201
- return mergeWithCustomize({}).apply(void 0, __spreadArray([
1202
- firstConfiguration
1203
- ], __read(configurations), !1));
1204
- }
1205
- function mergeWithCustomize(options) {
1206
- return function mergeWithOptions(firstConfiguration) {
1207
- for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
1208
- if ((0, utils_1.isUndefined)(firstConfiguration) || configurations.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
1209
- if (firstConfiguration.then) throw TypeError("Promises are not supported");
1210
- if (!firstConfiguration) return {};
1211
- if (0 === configurations.length) {
1212
- if (Array.isArray(firstConfiguration)) {
1213
- if (0 === firstConfiguration.length) return {};
1214
- if (firstConfiguration.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
1215
- if (firstConfiguration[0].then) throw TypeError("Promises are not supported");
1216
- return (0, merge_with_1.default)(firstConfiguration, (0, join_arrays_1.default)(options));
1217
- }
1218
- return firstConfiguration;
1219
- }
1220
- return (0, merge_with_1.default)([
1221
- firstConfiguration
1222
- ].concat(configurations), (0, join_arrays_1.default)(options));
1223
- };
1224
- }
1225
- exports.merge = merge, exports.default = merge, exports.mergeWithCustomize = mergeWithCustomize, exports.customizeArray = function customizeArray(rules) {
1226
- return function(a, b, key) {
1227
- var matchedRule = Object.keys(rules).find(function(rule) {
1228
- return (0, wildcard_1.default)(rule, key);
1229
- }) || "";
1230
- if (matchedRule) switch(rules[matchedRule]){
1231
- case types_1.CustomizeRule.Prepend:
1232
- return __spreadArray(__spreadArray([], __read(b), !1), __read(a), !1);
1233
- case types_1.CustomizeRule.Replace:
1234
- return b;
1235
- case types_1.CustomizeRule.Append:
1236
- default:
1237
- return __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
1238
- }
1239
- };
1240
- }, exports.mergeWithRules = function mergeWithRules(rules) {
1241
- return mergeWithCustomize({
1242
- customizeArray: function(a, b, key) {
1243
- var currentRule = rules;
1244
- return (key.split(".").forEach(function(k) {
1245
- currentRule && (currentRule = currentRule[k]);
1246
- }), (0, utils_1.isPlainObject)(currentRule)) ? mergeWithRule({
1247
- currentRule: currentRule,
1248
- a: a,
1249
- b: b
1250
- }) : "string" == typeof currentRule ? mergeIndividualRule({
1251
- currentRule: currentRule,
1252
- a: a,
1253
- b: b
1254
- }) : void 0;
1255
- }
1256
- });
1257
- };
1258
- var isArray = Array.isArray;
1259
- function mergeWithRule(_a) {
1260
- var currentRule = _a.currentRule, a = _a.a, b = _a.b;
1261
- if (!isArray(a)) return a;
1262
- var bAllMatches = [];
1263
- return a.map(function(ao) {
1264
- if (!(0, utils_1.isPlainObject)(currentRule)) return ao;
1265
- var ret = {}, rulesToMatch = [], operations = {};
1266
- Object.entries(currentRule).forEach(function(_a) {
1267
- var _b = __read(_a, 2), k = _b[0], v = _b[1];
1268
- v === types_1.CustomizeRule.Match ? rulesToMatch.push(k) : operations[k] = v;
1269
- });
1270
- var bMatches = b.filter(function(o) {
1271
- var matches = rulesToMatch.every(function(rule) {
1272
- return (0, utils_1.isSameCondition)(ao[rule], o[rule]);
1273
- });
1274
- return matches && bAllMatches.push(o), matches;
1275
- });
1276
- return (0, utils_1.isPlainObject)(ao) ? (Object.entries(ao).forEach(function(_a) {
1277
- var _b = __read(_a, 2), k = _b[0], v = _b[1];
1278
- switch(currentRule[k]){
1279
- case types_1.CustomizeRule.Match:
1280
- ret[k] = v, Object.entries(currentRule).forEach(function(_a) {
1281
- var _b = __read(_a, 2), k = _b[0];
1282
- if (_b[1] === types_1.CustomizeRule.Replace && bMatches.length > 0) {
1283
- var val = last(bMatches)[k];
1284
- void 0 !== val && (ret[k] = val);
1285
- }
1286
- });
1287
- break;
1288
- case types_1.CustomizeRule.Append:
1289
- if (!bMatches.length) {
1290
- ret[k] = v;
1291
- break;
1292
- }
1293
- var appendValue = last(bMatches)[k];
1294
- if (!isArray(v) || !isArray(appendValue)) throw TypeError("Trying to append non-arrays");
1295
- ret[k] = v.concat(appendValue);
1296
- break;
1297
- case types_1.CustomizeRule.Merge:
1298
- if (!bMatches.length) {
1299
- ret[k] = v;
1300
- break;
1301
- }
1302
- var lastValue = last(bMatches)[k];
1303
- if (!(0, utils_1.isPlainObject)(v) || !(0, utils_1.isPlainObject)(lastValue)) throw TypeError("Trying to merge non-objects");
1304
- ret[k] = merge(v, lastValue);
1305
- break;
1306
- case types_1.CustomizeRule.Prepend:
1307
- if (!bMatches.length) {
1308
- ret[k] = v;
1309
- break;
1310
- }
1311
- var prependValue = last(bMatches)[k];
1312
- if (!isArray(v) || !isArray(prependValue)) throw TypeError("Trying to prepend non-arrays");
1313
- ret[k] = prependValue.concat(v);
1314
- break;
1315
- case types_1.CustomizeRule.Replace:
1316
- ret[k] = bMatches.length > 0 ? last(bMatches)[k] : v;
1317
- break;
1318
- default:
1319
- var currentRule_1 = operations[k], b_1 = bMatches.map(function(o) {
1320
- return o[k];
1321
- }).reduce(function(acc, val) {
1322
- return isArray(acc) && isArray(val) ? __spreadArray(__spreadArray([], __read(acc), !1), __read(val), !1) : acc;
1323
- }, []);
1324
- ret[k] = mergeWithRule({
1325
- currentRule: currentRule_1,
1326
- a: v,
1327
- b: b_1
1328
- });
1329
- }
1330
- }), ret) : ao;
1331
- }).concat(b.filter(function(o) {
1332
- return !bAllMatches.includes(o);
1333
- }));
1334
- }
1335
- function mergeIndividualRule(_a) {
1336
- var currentRule = _a.currentRule, a = _a.a, b = _a.b;
1337
- switch(currentRule){
1338
- case types_1.CustomizeRule.Append:
1339
- return a.concat(b);
1340
- case types_1.CustomizeRule.Prepend:
1341
- return b.concat(a);
1342
- case types_1.CustomizeRule.Replace:
1343
- return b;
1344
- }
1345
- return a;
1346
- }
1347
- function last(arr) {
1348
- return arr[arr.length - 1];
1349
- }
1350
- exports.customizeObject = function customizeObject(rules) {
1351
- return function(a, b, key) {
1352
- switch(rules[key]){
1353
- case types_1.CustomizeRule.Prepend:
1354
- return (0, merge_with_1.default)([
1355
- b,
1356
- a
1357
- ], (0, join_arrays_1.default)());
1358
- case types_1.CustomizeRule.Replace:
1359
- return b;
1360
- case types_1.CustomizeRule.Append:
1361
- return (0, merge_with_1.default)([
1362
- a,
1363
- b
1364
- ], (0, join_arrays_1.default)());
1365
- }
1366
- };
1367
- };
1368
- },
1369
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/join-arrays.js": function(__unused_webpack_module, exports, __webpack_require__) {
1370
- var __read = this && this.__read || function(o, n) {
1371
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1372
- if (!m) return o;
1373
- var r, e, i = m.call(o), ar = [];
1374
- try {
1375
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1376
- } catch (error) {
1377
- e = {
1378
- error: error
1379
- };
1380
- } finally{
1381
- try {
1382
- r && !r.done && (m = i.return) && m.call(i);
1383
- } finally{
1384
- if (e) throw e.error;
1385
- }
1386
- }
1387
- return ar;
1388
- }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
1389
- if (pack || 2 == arguments.length) for(var ar, i = 0, l = from.length; i < l; i++)!ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
1390
- return to.concat(ar || Array.prototype.slice.call(from));
1391
- }, __importDefault = this && this.__importDefault || function(mod) {
1392
- return mod && mod.__esModule ? mod : {
1393
- default: mod
1394
- };
1395
- };
1396
- Object.defineProperty(exports, "__esModule", {
1397
- value: !0
1398
- });
1399
- var clone_deep_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js")), merge_with_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js")), utils_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js"), isArray = Array.isArray;
1400
- function joinArrays(_a) {
1401
- var _b = void 0 === _a ? {} : _a, customizeArray = _b.customizeArray, customizeObject = _b.customizeObject, key = _b.key;
1402
- return function _joinArrays(a, b, k) {
1403
- var newKey = key ? "".concat(key, ".").concat(k) : k;
1404
- if ((0, utils_1.isFunction)(a) && (0, utils_1.isFunction)(b)) return function() {
1405
- for(var args = [], _i = 0; _i < arguments.length; _i++)args[_i] = arguments[_i];
1406
- return _joinArrays(a.apply(void 0, __spreadArray([], __read(args), !1)), b.apply(void 0, __spreadArray([], __read(args), !1)), k);
1407
- };
1408
- if (isArray(a) && isArray(b)) {
1409
- var customResult = customizeArray && customizeArray(a, b, newKey);
1410
- return customResult || __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
1411
- }
1412
- if ((0, utils_1.isRegex)(b)) return b;
1413
- if ((0, utils_1.isPlainObject)(a) && (0, utils_1.isPlainObject)(b)) {
1414
- var customResult = customizeObject && customizeObject(a, b, newKey);
1415
- return customResult || (0, merge_with_1.default)([
1416
- a,
1417
- b
1418
- ], joinArrays({
1419
- customizeArray: customizeArray,
1420
- customizeObject: customizeObject,
1421
- key: newKey
1422
- }));
1423
- }
1424
- return (0, utils_1.isPlainObject)(b) ? (0, clone_deep_1.default)(b) : isArray(b) ? __spreadArray([], __read(b), !1) : b;
1425
- };
1426
- }
1427
- exports.default = joinArrays;
1428
- },
1429
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js": function(__unused_webpack_module, exports) {
1430
- var __read = this && this.__read || function(o, n) {
1431
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1432
- if (!m) return o;
1433
- var r, e, i = m.call(o), ar = [];
1434
- try {
1435
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1436
- } catch (error) {
1437
- e = {
1438
- error: error
1439
- };
1440
- } finally{
1441
- try {
1442
- r && !r.done && (m = i.return) && m.call(i);
1443
- } finally{
1444
- if (e) throw e.error;
1445
- }
1446
- }
1447
- return ar;
1448
- };
1449
- function mergeTo(a, b, customizer) {
1450
- var ret = {};
1451
- return Object.keys(a).concat(Object.keys(b)).forEach(function(k) {
1452
- var v = customizer(a[k], b[k], k);
1453
- ret[k] = void 0 === v ? a[k] : v;
1454
- }), ret;
1455
- }
1456
- Object.defineProperty(exports, "__esModule", {
1457
- value: !0
1458
- }), exports.default = function mergeWith(objects, customizer) {
1459
- var _a = __read(objects), first = _a[0], rest = _a.slice(1), ret = first;
1460
- return rest.forEach(function(a) {
1461
- ret = mergeTo(ret, a, customizer);
1462
- }), ret;
1463
- };
1464
- },
1465
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js": function(__unused_webpack_module, exports) {
1466
- var CustomizeRule, CustomizeRule1;
1467
- Object.defineProperty(exports, "__esModule", {
1468
- value: !0
1469
- }), exports.CustomizeRule = void 0, (CustomizeRule1 = CustomizeRule || (exports.CustomizeRule = CustomizeRule = {})).Match = "match", CustomizeRule1.Merge = "merge", CustomizeRule1.Append = "append", CustomizeRule1.Prepend = "prepend", CustomizeRule1.Replace = "replace";
1470
- },
1471
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js": function(__unused_webpack_module, exports) {
1472
- var __read = this && this.__read || function(o, n) {
1473
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1474
- if (!m) return o;
1475
- var r, e, i = m.call(o), ar = [];
1476
- try {
1477
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1478
- } catch (error) {
1479
- e = {
1480
- error: error
1481
- };
1482
- } finally{
1483
- try {
1484
- r && !r.done && (m = i.return) && m.call(i);
1485
- } finally{
1486
- if (e) throw e.error;
1487
- }
1488
- }
1489
- return ar;
1490
- }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
1491
- if (pack || 2 == arguments.length) for(var ar, i = 0, l = from.length; i < l; i++)!ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
1492
- return to.concat(ar || Array.prototype.slice.call(from));
1493
- };
1494
- Object.defineProperty(exports, "__esModule", {
1495
- value: !0
1496
- }), exports.default = function mergeUnique(key, uniques, getter) {
1497
- var uniquesSet = new Set(uniques);
1498
- return function(a, b, k) {
1499
- return k === key && Array.from(__spreadArray(__spreadArray([], __read(a), !1), __read(b), !1).map(function(it) {
1500
- return {
1501
- key: getter(it),
1502
- value: it
1503
- };
1504
- }).map(function(_a) {
1505
- var key = _a.key, value = _a.value;
1506
- return {
1507
- key: uniquesSet.has(key) ? key : value,
1508
- value: value
1509
- };
1510
- }).reduce(function(m, _a) {
1511
- var key = _a.key, value = _a.value;
1512
- return m.delete(key), m.set(key, value);
1513
- }, new Map()).values());
1514
- };
1515
- };
1516
- },
1517
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js": function(__unused_webpack_module, exports, __webpack_require__) {
1518
- var __read = this && this.__read || function(o, n) {
1519
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1520
- if (!m) return o;
1521
- var r, e, i = m.call(o), ar = [];
1522
- try {
1523
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1524
- } catch (error) {
1525
- e = {
1526
- error: error
1527
- };
1528
- } finally{
1529
- try {
1530
- r && !r.done && (m = i.return) && m.call(i);
1531
- } finally{
1532
- if (e) throw e.error;
1533
- }
1534
- }
1535
- return ar;
1536
- };
1537
- Object.defineProperty(exports, "__esModule", {
1538
- value: !0
1539
- }), exports.isSameCondition = exports.isUndefined = exports.isPlainObject = exports.isFunction = exports.isRegex = void 0;
1540
- var flat_1 = __webpack_require__("../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js");
1541
- function isRegex(o) {
1542
- return o instanceof RegExp;
1543
- }
1544
- function isFunction(functionToCheck) {
1545
- return functionToCheck && "[object Function]" === ({}).toString.call(functionToCheck);
1546
- }
1547
- exports.isRegex = isRegex, exports.isFunction = isFunction, exports.isPlainObject = function isPlainObject(a) {
1548
- return !(null === a || Array.isArray(a)) && "object" == typeof a;
1549
- }, exports.isUndefined = function isUndefined(a) {
1550
- return void 0 === a;
1551
- }, exports.isSameCondition = function isSameCondition(a, b) {
1552
- if (!a || !b) return a === b;
1553
- if ("string" == typeof a || "string" == typeof b || isRegex(a) || isRegex(b) || isFunction(a) || isFunction(b)) return a.toString() === b.toString();
1554
- var _a, _b, entriesA = Object.entries((0, flat_1.flatten)(a)), entriesB = Object.entries((0, flat_1.flatten)(b));
1555
- if (entriesA.length !== entriesB.length) return !1;
1556
- for(var i = 0; i < entriesA.length; i++)entriesA[i][0] = entriesA[i][0].replace(/\b\d+\b/g, "[]"), entriesB[i][0] = entriesB[i][0].replace(/\b\d+\b/g, "[]");
1557
- function cmp(_a, _b) {
1558
- var _c = __read(_a, 2), k1 = _c[0], v1 = _c[1], _d = __read(_b, 2), k2 = _d[0], v2 = _d[1];
1559
- return k1 < k2 ? -1 : k1 > k2 ? 1 : v1 < v2 ? -1 : +(v1 > v2);
1560
- }
1561
- if (entriesA.sort(cmp), entriesB.sort(cmp), entriesA.length !== entriesB.length) return !1;
1562
- for(var i = 0; i < entriesA.length; i++)if (entriesA[i][0] !== entriesB[i][0] || (null == (_a = entriesA[i][1]) ? void 0 : _a.toString()) !== (null == (_b = entriesB[i][1]) ? void 0 : _b.toString())) return !1;
1563
- return !0;
1564
- };
1565
- },
1566
- "../../node_modules/.pnpm/wildcard@2.0.1/node_modules/wildcard/index.js": function(module) {
1567
- var REGEXP_PARTS = /(\*|\?)/g;
1568
- function WildcardMatcher(text, separator) {
1569
- this.text = text = text || '', this.hasWild = text.indexOf('*') >= 0, this.separator = separator, this.parts = text.split(separator).map(this.classifyPart.bind(this));
1570
- }
1571
- WildcardMatcher.prototype.match = function(input) {
1572
- var ii, testParts, matches = !0, parts = this.parts, partsCount = parts.length;
1573
- if ('string' == typeof input || input instanceof String) if (this.hasWild || this.text == input) {
1574
- for(ii = 0, testParts = (input || '').split(this.separator); matches && ii < partsCount; ii++)if ('*' === parts[ii]) continue;
1575
- else matches = ii < testParts.length && (parts[ii] instanceof RegExp ? parts[ii].test(testParts[ii]) : parts[ii] === testParts[ii]);
1576
- matches = matches && testParts;
1577
- } else matches = !1;
1578
- else if ('function' == typeof input.splice) for(matches = [], ii = input.length; ii--;)this.match(input[ii]) && (matches[matches.length] = input[ii]);
1579
- else if ('object' == typeof input) for(var key in matches = {}, input)this.match(key) && (matches[key] = input[key]);
1580
- return matches;
1581
- }, WildcardMatcher.prototype.classifyPart = function(part) {
1582
- if ('*' === part) ;
1583
- else if (part.indexOf('*') >= 0 || part.indexOf('?') >= 0) return new RegExp(part.replace(REGEXP_PARTS, '\.$1'));
1584
- return part;
1585
- }, module.exports = function(text, test, separator) {
1586
- var matcher = new WildcardMatcher(text, separator || /[\/\.]/);
1587
- return void 0 !== test ? matcher.match(test) : matcher;
1588
- };
1589
- },
1590
- async_hooks: function(module) {
912
+ async_hooks (module) {
1591
913
  module.exports = __rspack_external_async_hooks;
1592
914
  },
1593
- fs: function(module) {
915
+ fs (module) {
1594
916
  module.exports = __rspack_external_fs;
1595
917
  },
1596
- "node:module": function(module) {
918
+ "node:module" (module) {
1597
919
  module.exports = __rspack_external_node_module_ab9f2194;
1598
920
  },
1599
- "node:path": function(module) {
921
+ "node:path" (module) {
1600
922
  module.exports = __rspack_external_node_path_c5b9b54f;
1601
923
  },
1602
- "node:url": function(module) {
924
+ "node:url" (module) {
1603
925
  module.exports = __rspack_external_node_url_e96de089;
1604
926
  },
1605
- os: function(module) {
927
+ os (module) {
1606
928
  module.exports = __rspack_external_os;
1607
929
  },
1608
- path: function(module) {
930
+ path (module) {
1609
931
  module.exports = __rspack_external_path;
1610
932
  },
1611
- url: function(module) {
933
+ url (module) {
1612
934
  module.exports = __rspack_external_url;
1613
935
  }
1614
936
  });
@@ -1629,7 +951,7 @@ __webpack_require__.r(provider_helpers_namespaceObject), __webpack_require__.d(p
1629
951
  setCssExtractPlugin: ()=>setCssExtractPlugin,
1630
952
  setHTMLPlugin: ()=>setHTMLPlugin
1631
953
  });
1632
- let external_node_module_ = __webpack_require__("node:module"), rspack_rspack = (0, external_node_module_.createRequire)(import.meta.url)('@rspack/core'), external_node_path_ = __webpack_require__("node:path"), external_node_url_ = __webpack_require__("node:url"), constants_filename = (0, external_node_url_.fileURLToPath)(import.meta.url), constants_dirname = (0, external_node_path_.dirname)(constants_filename), isDeno = 'undefined' != typeof Deno, isWindows = 'win32' === process.platform, ROOT_DIST_DIR = 'dist', LOADER_PATH = (0, external_node_path_.join)(constants_dirname), STATIC_PATH = (0, external_node_path_.join)(constants_dirname, '../static'), COMPILED_PATH = (0, external_node_path_.join)(constants_dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', DEFAULT_DEV_HOST = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_WEB_BROWSERSLIST = [
954
+ let external_node_module_ = __webpack_require__("node:module"), rspack_rspack = (0, external_node_module_.createRequire)(import.meta.url)('@rspack/core'), external_node_path_ = __webpack_require__("node:path"), external_node_url_ = __webpack_require__("node:url"), constants_filename = (0, external_node_url_.fileURLToPath)(import.meta.url), constants_dirname = (0, external_node_path_.dirname)(constants_filename), isDeno = 'undefined' != typeof Deno, isWindows = 'win32' === process.platform, ROOT_DIST_DIR = 'dist', LOADER_PATH = (0, external_node_path_.join)(constants_dirname), STATIC_PATH = (0, external_node_path_.join)(constants_dirname, '../static'), CLIENT_PATH = (0, external_node_path_.join)(constants_dirname, 'client'), COMPILED_PATH = (0, external_node_path_.join)(constants_dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', DEFAULT_DEV_HOST = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_WEB_BROWSERSLIST = [
1633
955
  'chrome >= 87',
1634
956
  'edge >= 88',
1635
957
  'firefox >= 78',
@@ -3073,11 +2395,14 @@ function resolveFileName(stats) {
3073
2395
  }
3074
2396
  function formatModuleTrace(stats, errorFile) {
3075
2397
  if (!stats.moduleTrace) return;
3076
- let moduleNames = stats.moduleTrace.map((trace)=>trace.originName).filter(Boolean);
2398
+ let moduleNames = stats.moduleTrace.map((trace)=>trace.originName && removeLoaderChainDelimiter(trace.originName)).filter(Boolean);
3077
2399
  if (!moduleNames.length) return;
3078
- errorFile && moduleNames.unshift(`${errorFile} ${color.bold(color.red('×'))}`);
2400
+ if (errorFile) {
2401
+ let formatted = removeLoaderChainDelimiter(errorFile);
2402
+ moduleNames[0] !== formatted && moduleNames.unshift(formatted);
2403
+ }
3079
2404
  let rawTrace = moduleNames.reverse().map((item)=>`\n ${item}`).join('');
3080
- return color.dim(`Import traces (entry → error):${rawTrace}`);
2405
+ return color.dim(`Import traces (entry → error):${rawTrace} ${color.bold(color.red('×'))}`);
3081
2406
  }
3082
2407
  function hintUnknownFiles(message) {
3083
2408
  let hint = 'You may need an appropriate loader to handle this file type.';
@@ -3119,8 +2444,17 @@ function hintUnknownFiles(message) {
3119
2444
  ])if (plugin.test.test(message)) return message.replace(hint, plugin.hint);
3120
2445
  return message;
3121
2446
  }
3122
- function formatStatsError(stats) {
3123
- let fileName = resolveFileName(stats), message = `${!fileName ? '' : /:\d+:\d+/.test(fileName) ? `File: ${color.cyan(fileName)}\n` : stats.loc ? `File: ${color.cyan(`${fileName}:${stats.loc}`)}\n` : `File: ${color.cyan(`${fileName}:1:1`)}\n`}${stats.message}`, verbose = 'verbose' === logger.level;
2447
+ function formatStatsError(stats, root) {
2448
+ let fileName = resolveFileName(stats), message = `${((fileName, stats, root)=>{
2449
+ if (!fileName) return '';
2450
+ let DATA_URI_PREFIX = "data:text/javascript,";
2451
+ if (fileName.startsWith(DATA_URI_PREFIX)) {
2452
+ let snippet = fileName.replace(DATA_URI_PREFIX, '');
2453
+ return snippet.length > 30 && (snippet = `${snippet.slice(0, 30)}...`), `File: ${color.cyan('data-uri virtual module')} ${color.dim(`(${snippet})`)}\n`;
2454
+ }
2455
+ let prefix = root + external_node_path_.sep;
2456
+ return (fileName.startsWith(prefix) && (fileName = fileName.replace(prefix, `.${external_node_path_.sep}`)), /:\d+:\d+/.test(fileName)) ? `File: ${color.cyan(fileName)}\n` : stats.loc ? `File: ${color.cyan(`${fileName}:${stats.loc}`)}\n` : `File: ${color.cyan(`${fileName}:1:1`)}\n`;
2457
+ })(fileName, stats, root)}${stats.message}`, verbose = 'verbose' === logger.level;
3124
2458
  verbose && (stats.details && (message += `\nDetails: ${stats.details}\n`), stats.stack && (message += `\n${stats.stack}`));
3125
2459
  let moduleTrace = formatModuleTrace(stats, fileName);
3126
2460
  moduleTrace && (message += moduleTrace);
@@ -3226,12 +2560,12 @@ function getRsbuildStats(statsInstance, compiler, action) {
3226
2560
  let statsOptions = getStatsOptions(compiler, action);
3227
2561
  return statsInstance.toJson(statsOptions);
3228
2562
  }
3229
- function formatStats(stats, hasErrors) {
2563
+ function formatStats(stats, hasErrors, root) {
3230
2564
  if (hasErrors) return {
3231
- message: formatErrorMessage(getStatsErrors(stats).map((item)=>formatStatsError(item))),
2565
+ message: formatErrorMessage(getStatsErrors(stats).map((item)=>formatStatsError(item, root))),
3232
2566
  level: 'error'
3233
2567
  };
3234
- let warningMessages = getStatsWarnings(stats).map((item)=>formatStatsError(item));
2568
+ let warningMessages = getStatsWarnings(stats).map((item)=>formatStatsError(item, root));
3235
2569
  if (warningMessages.length) {
3236
2570
  let title = color.bold(color.yellow(warningMessages.length > 1 ? 'Build warnings: \n' : 'Build warning: \n'));
3237
2571
  return {
@@ -3422,7 +2756,7 @@ let OVERRIDE_PATHS = new Set([
3422
2756
  'resolve.conditionNames',
3423
2757
  'resolve.mainFields',
3424
2758
  'provider'
3425
- ]), merge = (x, y, path = '')=>{
2759
+ ]), mergeConfig_merge = (x, y, path = '')=>{
3426
2760
  if (((key)=>{
3427
2761
  if (key.startsWith('environments.')) {
3428
2762
  let realKey = key.split('.').slice(2).join('.');
@@ -3455,7 +2789,7 @@ let OVERRIDE_PATHS = new Set([
3455
2789
  ...Object.keys(y)
3456
2790
  ])){
3457
2791
  let childPath = path ? `${path}.${key}` : key;
3458
- merged[key] = merge(x[key], y[key], childPath);
2792
+ merged[key] = mergeConfig_merge(x[key], y[key], childPath);
3459
2793
  }
3460
2794
  return merged;
3461
2795
  }, normalizeConfigStructure = (config)=>{
@@ -3475,7 +2809,7 @@ let OVERRIDE_PATHS = new Set([
3475
2809
  ]), normalizedConfig.dev = dev), normalizedConfig;
3476
2810
  }, mergeRsbuildConfig = (...originalConfigs)=>{
3477
2811
  let configs = originalConfigs.filter((config)=>void 0 !== config).map(normalizeConfigStructure);
3478
- return 2 === configs.length ? merge(configs[0], configs[1]) : 1 === configs.length ? configs[0] : 0 === configs.length ? {} : configs.reduce((result, config)=>merge(result, config), {});
2812
+ return 2 === configs.length ? mergeConfig_merge(configs[0], configs[1]) : 1 === configs.length ? configs[0] : 0 === configs.length ? {} : configs.reduce((result, config)=>mergeConfig_merge(result, config), {});
3479
2813
  }, defaultConfig_require = (0, external_node_module_.createRequire)(import.meta.url), defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/, createDefaultConfig = ()=>({
3480
2814
  dev: {
3481
2815
  hmr: !0,
@@ -4084,7 +3418,7 @@ function createPublicContext(context) {
4084
3418
  async function createContext(options, userConfig) {
4085
3419
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
4086
3420
  return {
4087
- version: "1.6.10",
3421
+ version: "1.6.12-canary-63b4dae2-20251204065915",
4088
3422
  rootPath,
4089
3423
  distPath: '',
4090
3424
  cachePath,
@@ -4343,7 +3677,7 @@ let configChain_CHAIN_ID = {
4343
3677
  plugin && (pluginHelper_htmlPlugin = plugin);
4344
3678
  }, pluginHelper_getHTMLPlugin = (config)=>config?.html.implementation === 'native' ? rspack_rspack.HtmlRspackPlugin : (pluginHelper_htmlPlugin || (pluginHelper_htmlPlugin = requireCompiledPackage('html-rspack-plugin')), pluginHelper_htmlPlugin), setCssExtractPlugin = (plugin)=>{
4345
3679
  cssExtractPlugin = plugin;
4346
- }, dist_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
3680
+ };
4347
3681
  async function modifyRspackConfig(context, rspackConfig, chainUtils) {
4348
3682
  logger.debug('applying modifyRspackConfig hook');
4349
3683
  let currentConfig = rspackConfig, utils = getConfigUtils(()=>currentConfig, chainUtils);
@@ -4370,7 +3704,10 @@ async function modifyRspackConfig(context, rspackConfig, chainUtils) {
4370
3704
  function getConfigUtils(getCurrentConfig, chainUtils) {
4371
3705
  return {
4372
3706
  ...chainUtils,
4373
- mergeConfig: dist_1.merge,
3707
+ mergeConfig: (...args)=>{
3708
+ let { merge } = requireCompiledPackage('webpack-merge');
3709
+ return merge(...args);
3710
+ },
4374
3711
  addRules (rules) {
4375
3712
  let config = getCurrentConfig(), ruleArr = helpers_castArray(rules);
4376
3713
  config.module || (config.module = {}), config.module.rules || (config.module.rules = []), config.module.rules.unshift(...ruleArr);
@@ -4683,7 +4020,7 @@ async function createCompiler_createCompiler(options) {
4683
4020
  }), compiler.hooks.done.tap(HOOK_NAME, (statsInstance)=>{
4684
4021
  let stats = getRsbuildStats(statsInstance, compiler, context.action), hasErrors = statsInstance.hasErrors();
4685
4022
  context.buildState.stats = stats, context.buildState.status = 'done', context.buildState.hasErrors = hasErrors, context.socketServer?.onBuildDone();
4686
- let { message, level } = formatStats(stats, hasErrors);
4023
+ let { message, level } = formatStats(stats, hasErrors, options.context.rootPath);
4687
4024
  'error' === level && logger.error(message), 'warning' === level && logger.warn(message), isMultiCompiler || printTime(0, hasErrors), isCompiling = !1;
4688
4025
  }), 'dev' === context.action && registerDevHook({
4689
4026
  context,
@@ -5000,7 +4337,38 @@ async function gzipSize(input) {
5000
4337
  let data = await fileSize_gzip(input);
5001
4338
  return Buffer.byteLength(data);
5002
4339
  }
5003
- let EXCLUDE_ASSET_REGEX = /\.(?:map|LICENSE\.txt|d\.ts)$/, excludeAsset = (asset)=>EXCLUDE_ASSET_REGEX.test(asset.name), getAssetColor = (size)=>size > 300000 ? color.red : size > 100000 ? color.yellow : color.green;
4340
+ function getSnapshotPath(dir) {
4341
+ return external_node_path_.default.join(dir, 'rsbuild/file-sizes.json');
4342
+ }
4343
+ function normalizeFileName(fileName) {
4344
+ return fileName.replace(/\.[a-f0-9]{8,}\./g, '.');
4345
+ }
4346
+ async function loadPreviousSizes(dir) {
4347
+ let snapshotPath = getSnapshotPath(dir);
4348
+ try {
4349
+ let content = await node_fs.promises.readFile(snapshotPath, 'utf-8');
4350
+ return JSON.parse(content);
4351
+ } catch {
4352
+ return null;
4353
+ }
4354
+ }
4355
+ async function saveSnapshots(dir, snapshots) {
4356
+ let snapshotPath = getSnapshotPath(dir);
4357
+ try {
4358
+ await node_fs.promises.mkdir(external_node_path_.default.dirname(snapshotPath), {
4359
+ recursive: !0
4360
+ }), await node_fs.promises.writeFile(snapshotPath, JSON.stringify(snapshots, null, 2));
4361
+ } catch (err) {
4362
+ logger.debug('Failed to save file size snapshots:', err);
4363
+ }
4364
+ }
4365
+ let EXCLUDE_ASSET_REGEX = /\.(?:map|LICENSE\.txt|d\.ts)$/, excludeAsset = (asset)=>EXCLUDE_ASSET_REGEX.test(asset.name), formatDiff = (diff)=>{
4366
+ let label = `(${diff > 0 ? '+' : '-'}${calcFileSize(Math.abs(diff))})`;
4367
+ return {
4368
+ label: (diff > 0 ? color.red : color.green)(label),
4369
+ length: label.length
4370
+ };
4371
+ }, getAssetColor = (size)=>size > 300000 ? color.red : size > 100000 ? color.yellow : color.green;
5004
4372
  function getHeader(maxFileLength, maxSizeLength, fileHeader, showGzipHeader) {
5005
4373
  let lengths = [
5006
4374
  maxFileLength,
@@ -5020,21 +4388,42 @@ let calcFileSize = (len)=>{
5020
4388
  let val = len / 1000;
5021
4389
  return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
5022
4390
  }, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? color.cyan(assetName) : assetName.endsWith('.css') ? color.yellow(assetName) : assetName.endsWith('.html') ? color.green(assetName) : color.magenta(assetName), COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest|md)$/i;
5023
- async function printFileSizes(options, stats, rootPath, distPath, environmentName) {
5024
- let logs = [], showDetail = !1 !== options.detail, showTotal = !1 !== options.total;
5025
- if (!showTotal && !showDetail) return logs;
5026
- let exclude = options.exclude ?? excludeAsset, relativeDistPath = external_node_path_.default.relative(rootPath, distPath), formatAsset = async (asset)=>{
5027
- let fileName = asset.name.split('?')[0], contents = await node_fs.promises.readFile(external_node_path_.default.join(distPath, fileName)), size = Buffer.byteLength(contents), gzippedSize = options.compressed && COMPRESSIBLE_REGEX.test(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
4391
+ async function printFileSizes(options, stats, rootPath, distPath, environmentName, previousSizes) {
4392
+ let logs = [], showDetail = !1 !== options.detail, showDiff = !1 !== options.diff && null !== previousSizes, showTotal = !1 !== options.total;
4393
+ if (!showTotal && !showDetail) return {
4394
+ logs
4395
+ };
4396
+ let exclude = options.exclude ?? excludeAsset, relativeDistPath = external_node_path_.default.relative(rootPath, distPath), sizes = {}, formatAsset = async (asset)=>{
4397
+ let fileName = asset.name.split('?')[0], contents = await node_fs.promises.readFile(external_node_path_.default.join(distPath, fileName)), size = Buffer.byteLength(contents), gzippedSize = options.compressed && COMPRESSIBLE_REGEX.test(fileName) ? await gzipSize(contents) : null, normalizedName = normalizeFileName(fileName);
4398
+ sizes[normalizeFileName(fileName)] = {
4399
+ size,
4400
+ gzippedSize: gzippedSize ?? void 0
4401
+ };
4402
+ let sizeLabel = calcFileSize(size), sizeLabelLength = sizeLabel.length, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
4403
+ if (showDiff) {
4404
+ let sizeData = previousSizes[environmentName]?.[normalizedName], sizeDiff = size - (sizeData?.size ?? 0);
4405
+ if (0 !== sizeDiff) {
4406
+ let { label, length } = formatDiff(sizeDiff);
4407
+ sizeLabel += ` ${label}`, sizeLabelLength += length + 1;
4408
+ }
4409
+ if (gzippedSize) {
4410
+ let gzipDiff = gzippedSize - (sizeData?.gzippedSize ?? 0);
4411
+ 0 !== gzipDiff && (gzipSizeLabel += ` ${formatDiff(gzipDiff).label}`);
4412
+ }
4413
+ }
5028
4414
  return {
5029
4415
  size,
4416
+ sizeLabel,
4417
+ sizeLabelLength,
5030
4418
  folder: external_node_path_.default.join(relativeDistPath, external_node_path_.default.dirname(fileName)),
5031
4419
  name: external_node_path_.default.basename(fileName),
5032
4420
  gzippedSize,
5033
- sizeLabel: calcFileSize(size),
5034
4421
  gzipSizeLabel
5035
4422
  };
5036
4423
  }, getAssets = async ()=>Promise.all(getAssetsFromStats(stats).filter((asset)=>!exclude(asset) && (!options.include || options.include(asset))).map((asset)=>formatAsset(asset))), assets = await getAssets();
5037
- if (0 === assets.length) return logs;
4424
+ if (0 === assets.length) return {
4425
+ logs
4426
+ };
5038
4427
  logs.push(''), assets.sort((a, b)=>a.size - b.size);
5039
4428
  let totalSize = 0, totalGzipSize = 0;
5040
4429
  for (let asset of (showTotal = showTotal && !(showDetail && 1 === assets.length), assets))totalSize += asset.size, options.compressed && (totalGzipSize += asset.gzippedSize ?? asset.size);
@@ -5049,12 +4438,10 @@ async function printFileSizes(options, stats, rootPath, distPath, environmentNam
5049
4438
  totalGzipSize
5050
4439
  }) : null;
5051
4440
  if (showDetail) {
5052
- let maxFileLength = Math.max(...assets.map((a)=>(a.folder + external_node_path_.default.sep + a.name).length), showTotal ? totalSizeLabel.length : 0, fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabel.length), totalSizeStr.length), showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
4441
+ let maxFileLength = Math.max(...assets.map((a)=>(a.folder + external_node_path_.default.sep + a.name).length), showTotal ? totalSizeLabel.length : 0, fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabelLength), totalSizeStr.length), showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
5053
4442
  for (let asset of (logs.push(getHeader(maxFileLength, maxSizeLength, fileHeader, showGzipHeader)), assets)){
5054
- let { sizeLabel } = asset, { name, folder, gzipSizeLabel } = asset, fileNameLength = (folder + external_node_path_.default.sep + name).length, sizeLength = sizeLabel.length;
5055
- sizeLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLength));
5056
- let fileNameLabel = color.dim(asset.folder + external_node_path_.default.sep) + coloringAssetName(asset.name);
5057
- fileNameLength < maxFileLength && (fileNameLabel += ' '.repeat(maxFileLength - fileNameLength));
4443
+ let { sizeLabel, sizeLabelLength, gzipSizeLabel } = asset, { name, folder } = asset, fileNameLength = (folder + external_node_path_.default.sep + name).length, fileNameLabel = color.dim(asset.folder + external_node_path_.default.sep) + coloringAssetName(asset.name);
4444
+ sizeLabelLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLabelLength)), fileNameLength < maxFileLength && (fileNameLabel += ' '.repeat(maxFileLength - fileNameLength));
5058
4445
  let log = `${fileNameLabel} ${sizeLabel}`;
5059
4446
  gzipSizeLabel && (log += ` ${gzipSizeLabel}`), logs.push(log);
5060
4447
  }
@@ -5079,7 +4466,10 @@ async function printFileSizes(options, stats, rootPath, distPath, environmentNam
5079
4466
  options.compressed && (log += color.green(` (${calcFileSize(totalGzipSize)} gzipped)`)), logs.push(log);
5080
4467
  }
5081
4468
  }
5082
- return logs.push(''), logs;
4469
+ return logs.push(''), {
4470
+ logs,
4471
+ sizes
4472
+ };
5083
4473
  }
5084
4474
  let entryNameSymbol = Symbol('entryName'), VOID_TAGS = [
5085
4475
  'area',
@@ -5659,13 +5049,14 @@ function doesChunkBelongToHtml({ chunk, htmlPluginData }) {
5659
5049
  }
5660
5050
  let isCSSPath = (filePath)=>filePath.endsWith('.css');
5661
5051
  function normalizeManifestObjectConfig(manifest) {
5662
- if ('string' == typeof manifest) return {
5663
- filename: manifest
5664
- };
5665
5052
  let defaultOptions = {
5053
+ prefix: !0,
5666
5054
  filename: 'manifest.json'
5667
5055
  };
5668
- return 'boolean' == typeof manifest ? defaultOptions : {
5056
+ return 'string' == typeof manifest ? {
5057
+ ...defaultOptions,
5058
+ filename: manifest
5059
+ } : 'boolean' == typeof manifest ? defaultOptions : {
5669
5060
  ...defaultOptions,
5670
5061
  ...manifest
5671
5062
  };
@@ -6417,8 +5808,8 @@ function applyHMREntry({ config, compiler, token, resolvedHost, resolvedPort })
6417
5808
  ...config.dev.client
6418
5809
  };
6419
5810
  '<port>' === clientConfig.port && (clientConfig.port = resolvedPort);
6420
- let hmrEntry = `import { init } from '@rsbuild/core/client/hmr';
6421
- ${config.dev.client.overlay ? "import '@rsbuild/core/client/overlay';" : ''}
5811
+ let hmrEntry = `import { init } from '${toPosixPath((0, external_node_path_.join)(CLIENT_PATH, 'hmr'))}';
5812
+ ${config.dev.client.overlay ? `import '${toPosixPath((0, external_node_path_.join)(CLIENT_PATH, 'overlay'))}';` : ''}
6422
5813
 
6423
5814
  init({
6424
5815
  token: '${token}',
@@ -6451,27 +5842,34 @@ let assets_middleware_assetsMiddleware = async ({ config, compiler, context, soc
6451
5842
  let { target } = compiler.options;
6452
5843
  return !!target && (Array.isArray(target) ? target.includes('node') : 'node' === target);
6453
5844
  })(compiler)) return;
6454
- let errorsCount = null;
5845
+ let errorsCount = null, warningsCount = null;
6455
5846
  compiler.hooks.invalid.tap('rsbuild-dev-server', (fileName)=>{
6456
- errorsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && socketServer.sockWrite({
5847
+ errorsCount = null, warningsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && socketServer.sockWrite({
6457
5848
  type: 'static-changed'
6458
5849
  }, token);
6459
5850
  }), compiler.hooks.done.tap('rsbuild-dev-server', (stats)=>{
6460
- let { errors } = stats.compilation;
6461
- if (errors.length === errorsCount) return;
6462
- let isRecalled = null !== errorsCount;
6463
- if (errorsCount = errors.length, isRecalled) {
6464
- let tsErrors = errors.filter(isTsError);
6465
- if (!tsErrors.length) return;
6466
- let { stats: statsJson } = context.buildState, statsErrors = tsErrors.map((item)=>pick(item, [
6467
- 'message',
6468
- 'file'
6469
- ]));
6470
- statsJson && (statsJson.errors = statsJson.errors ? [
6471
- ...statsJson.errors,
6472
- ...statsErrors
6473
- ] : statsErrors), socketServer.sendError(statsErrors, token);
6474
- return;
5851
+ let { errors, warnings } = stats.compilation;
5852
+ if (errors.length === errorsCount && warnings.length === warningsCount) return;
5853
+ let isRecalled = null !== errorsCount || null !== warningsCount;
5854
+ if (errorsCount = errors.length, warningsCount = warnings.length, isRecalled) {
5855
+ let tsErrors = errors.filter(isTsError), tsWarnings = warnings.filter(isTsError);
5856
+ if (!tsErrors.length && !tsWarnings.length) return;
5857
+ let { stats: statsJson } = context.buildState, handleTsIssues = (issues, type, sendFn)=>{
5858
+ let statsIssues = issues.map((item)=>pick(item, [
5859
+ 'message',
5860
+ 'file'
5861
+ ]));
5862
+ statsJson && (statsJson[type] = statsJson[type] ? [
5863
+ ...statsJson[type],
5864
+ ...statsIssues
5865
+ ] : statsIssues), sendFn(statsIssues, token);
5866
+ };
5867
+ if (tsErrors.length > 0) return void handleTsIssues(tsErrors, 'errors', (issues, token)=>{
5868
+ socketServer.sendError(issues, token);
5869
+ });
5870
+ if (tsWarnings.length > 0) return void handleTsIssues(tsWarnings, 'warnings', (issues, token)=>{
5871
+ socketServer.sendWarning(issues, token);
5872
+ });
6475
5873
  }
6476
5874
  });
6477
5875
  })({
@@ -6905,7 +6303,7 @@ class SocketServer {
6905
6303
  });
6906
6304
  }
6907
6305
  sendError(errors, token) {
6908
- let formattedErrors = errors.map((item)=>formatStatsError(item));
6306
+ let formattedErrors = errors.map((item)=>formatStatsError(item, this.context.rootPath));
6909
6307
  this.sockWrite({
6910
6308
  type: 'errors',
6911
6309
  data: {
@@ -6914,6 +6312,15 @@ class SocketServer {
6914
6312
  }
6915
6313
  }, token);
6916
6314
  }
6315
+ sendWarning(warnings, token) {
6316
+ let formattedWarnings = warnings.map((item)=>formatStatsError(item, this.context.rootPath));
6317
+ this.sockWrite({
6318
+ type: 'warnings',
6319
+ data: {
6320
+ text: formattedWarnings
6321
+ }
6322
+ }, token);
6323
+ }
6917
6324
  sockWrite(message, token) {
6918
6325
  let messageStr = JSON.stringify(message), sendToSockets = (sockets)=>{
6919
6326
  for (let socket of sockets)this.send(socket, messageStr);
@@ -6991,18 +6398,7 @@ class SocketServer {
6991
6398
  data: stats.hash
6992
6399
  }, token);
6993
6400
  }
6994
- if (errors.length > 0) return void this.sendError(errors, token);
6995
- if (warnings.length > 0) {
6996
- let warningMessages = warnings.map((item)=>formatStatsError(item));
6997
- this.sockWrite({
6998
- type: 'warnings',
6999
- data: {
7000
- text: warningMessages
7001
- }
7002
- }, token);
7003
- return;
7004
- }
7005
- this.sockWrite({
6401
+ errors.length > 0 ? this.sendError(errors, token) : warnings.length > 0 ? this.sendWarning(warnings, token) : this.sockWrite({
7006
6402
  type: 'ok'
7007
6403
  }, token);
7008
6404
  }
@@ -7106,35 +6502,34 @@ async function setupCliShortcuts({ help = !0, openPage, closeServer, printUrls,
7106
6502
  };
7107
6503
  }
7108
6504
  let ENCODING_REGEX = /\bgzip\b/, CONTENT_TYPE_REGEX = /text|javascript|\/json|xml/i, gzipMiddleware_gzipMiddleware = ({ filter, level = node_zlib.constants.Z_BEST_SPEED } = {})=>function gzipMiddleware(req, res, next) {
7109
- let gzip, writeHeadStatus;
6505
+ let gzip, writeHeadStatus, writeHeadMessage;
7110
6506
  if (filter && !filter(req, res)) return void next();
7111
6507
  let accept = req.headers['accept-encoding'], encoding = 'string' == typeof accept && ENCODING_REGEX.test(accept);
7112
6508
  if ('HEAD' === req.method || !encoding) return void next();
7113
6509
  let started = !1, on = res.on.bind(res), end = res.end.bind(res), write = res.write.bind(res), writeHead = res.writeHead.bind(res), listeners = [], start = ()=>{
7114
- if (!started) {
7115
- if (started = !0, ((res)=>{
7116
- if (res.getHeader('Content-Encoding')) return !1;
7117
- let contentType = String(res.getHeader('Content-Type'));
7118
- if (contentType && !CONTENT_TYPE_REGEX.test(contentType)) return !1;
7119
- let size = res.getHeader('Content-Length');
7120
- return void 0 === size || Number(size) > 1024;
7121
- })(res)) for (let listener of (res.setHeader('Content-Encoding', 'gzip'), res.removeHeader('Content-Length'), (gzip = node_zlib.createGzip({
7122
- level
7123
- })).on('data', (chunk)=>{
7124
- write(chunk) || gzip.pause();
7125
- }), on('drain', ()=>gzip.resume()), gzip.on('end', ()=>{
7126
- end();
7127
- }), listeners))gzip.on.apply(gzip, listener);
7128
- else for (let listener of listeners)on.apply(res, listener);
7129
- writeHead(writeHeadStatus ?? res.statusCode);
7130
- }
6510
+ if (started) return;
6511
+ if (started = !0, ((res)=>{
6512
+ if (res.getHeader('Content-Encoding')) return !1;
6513
+ let contentType = String(res.getHeader('Content-Type'));
6514
+ if (contentType && !CONTENT_TYPE_REGEX.test(contentType)) return !1;
6515
+ let size = res.getHeader('Content-Length');
6516
+ return void 0 === size || Number(size) > 1024;
6517
+ })(res)) for (let listener of (res.setHeader('Content-Encoding', 'gzip'), res.removeHeader('Content-Length'), (gzip = node_zlib.createGzip({
6518
+ level
6519
+ })).on('data', (chunk)=>{
6520
+ write(chunk) || gzip.pause();
6521
+ }), on('drain', ()=>gzip.resume()), gzip.on('end', ()=>{
6522
+ end();
6523
+ }), listeners))gzip.on.apply(gzip, listener);
6524
+ else for (let listener of listeners)on.apply(res, listener);
6525
+ let statusCode = writeHeadStatus ?? res.statusCode;
6526
+ void 0 !== writeHeadMessage ? writeHead(statusCode, writeHeadMessage) : writeHead(statusCode);
7131
6527
  };
7132
6528
  res.writeHead = (status, reason, headers)=>{
7133
- if ('string' == typeof reason) {
7134
- if (headers) for (let [key, value] of Object.entries(headers))res.setHeader(key, value);
7135
- res.statusMessage = reason;
7136
- } else if (reason) for (let [key, value] of Object.entries(reason))void 0 !== value && res.setHeader(key, value);
7137
- return writeHeadStatus = status, res;
6529
+ writeHeadStatus = status, 'string' == typeof reason && (writeHeadMessage = reason);
6530
+ let resolvedHeaders = 'string' == typeof reason ? headers : reason;
6531
+ if (resolvedHeaders) for (let [key, value] of Object.entries(resolvedHeaders))res.setHeader(key, value);
6532
+ return res;
7138
6533
  }, res.write = (...args)=>(start(), gzip ? gzip.write(...args) : write.apply(res, args)), res.end = (...args)=>(start(), gzip ? gzip.end(...args) : end.apply(res, args)), res.on = (type, listener)=>(started ? gzip && 'drain' === type ? gzip.on(type, listener) : on(type, listener) : listeners.push([
7139
6534
  type,
7140
6535
  listener
@@ -8356,25 +7751,29 @@ function applyDefaultPlugins(pluginManager, context) {
8356
7751
  {
8357
7752
  name: 'rsbuild:file-size',
8358
7753
  setup (api) {
8359
- api.onAfterBuild(async ({ stats, environments, isFirstCompile })=>{
7754
+ api.onAfterBuild(async ({ stats, isFirstCompile })=>{
8360
7755
  let { hasErrors } = context.buildState;
8361
7756
  if (!stats || hasErrors || !isFirstCompile) return;
8362
- let logs = [];
8363
- await Promise.all(Object.values(environments).map(async (environment, index)=>{
7757
+ let environments = context.environmentList.filter(({ config })=>!1 !== config.performance.printFileSize);
7758
+ if (!environments.length) return;
7759
+ let showDiff = environments.some((environment)=>{
8364
7760
  let { printFileSize } = environment.config.performance;
8365
- if (!1 === printFileSize) return;
8366
- let defaultConfig = {
7761
+ return 'object' == typeof printFileSize && !!printFileSize.diff;
7762
+ }), previousSizes = showDiff ? await loadPreviousSizes(api.context.cachePath) : null, nextSizes = {}, logs = await Promise.all(environments.map(async ({ name, index, config, distPath })=>{
7763
+ let { printFileSize } = config.performance, defaultConfig = {
8367
7764
  total: !0,
8368
7765
  detail: !0,
8369
- compressed: 'node' !== environment.config.output.target
7766
+ diff: !1,
7767
+ compressed: 'node' !== config.output.target
8370
7768
  }, mergedConfig = !0 === printFileSize ? defaultConfig : {
8371
7769
  ...defaultConfig,
8372
7770
  ...printFileSize
8373
- }, statsItem = 'stats' in stats ? stats.stats[index] : stats, statsLogs = await printFileSizes(mergedConfig, statsItem, api.context.rootPath, environment.distPath, environment.name);
8374
- logs.push(...statsLogs);
7771
+ }, statsItem = 'stats' in stats ? stats.stats[index] : stats, { logs: sizeLogs, sizes } = await printFileSizes(mergedConfig, statsItem, api.context.rootPath, distPath, name, previousSizes);
7772
+ return sizes && (nextSizes[name] = sizes), sizeLogs.join('\n');
8375
7773
  })).catch((err)=>{
8376
7774
  logger.warn('Failed to print file size.'), logger.warn(err);
8377
- }), logger.log(logs.join('\n'));
7775
+ });
7776
+ logs && logger.log(logs.join('\n')), showDiff && await saveSnapshots(api.context.cachePath, nextSizes);
8378
7777
  });
8379
7778
  }
8380
7779
  },
@@ -9256,67 +8655,69 @@ try {
9256
8655
  let { output: { manifest }, dev: { writeToDisk } } = environment.config;
9257
8656
  if (!1 === manifest) return;
9258
8657
  let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = requireCompiledPackage('rspack-manifest-plugin'), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
9259
- manifestFilenames.set(environment.name, manifestOptions.filename), chain.plugin(CHAIN_ID.PLUGIN.MANIFEST).use(RspackManifestPlugin, [
9260
- {
9261
- fileName: manifestOptions.filename,
9262
- filter,
9263
- writeToFileEmit: isDev && !0 !== writeToDisk,
9264
- generate: (_seed, files, entries, { compilation })=>{
9265
- let chunkEntries = new Map(), licenseMap = new Map(), publicPath = getPublicPathFromCompiler(compilation), integrity = {}, allFiles = files.map((file)=>{
9266
- if (file.integrity && (integrity[file.path] = file.integrity), file.chunk) for (let entryName of recursiveChunkEntryNames(file.chunk))chunkEntries.set(entryName, [
9267
- file,
9268
- ...chunkEntries.get(entryName) || []
9269
- ]);
9270
- if (file.path.endsWith('.LICENSE.txt')) {
9271
- let sourceFilePath = file.path.split('.LICENSE.txt')[0];
9272
- licenseMap.set(sourceFilePath, file.path);
9273
- }
9274
- return file.path;
9275
- }), manifestEntries = {};
9276
- for (let [entryName, chunkFiles] of chunkEntries){
9277
- let assets = new Set(), initialJS = [], initialCSS = [], asyncJS = [], asyncCSS = [];
9278
- if (entries[entryName]) for (let filePath of entries[entryName]){
9279
- let fileURL = ensureAssetPrefix(filePath, publicPath);
9280
- isCSSPath(filePath) ? initialCSS.push(fileURL) : initialJS.push(fileURL);
9281
- }
9282
- for (let file of chunkFiles){
9283
- file.isInitial || (isCSSPath(file.path) ? asyncCSS.push(file.path) : asyncJS.push(file.path));
9284
- let relatedLICENSE = licenseMap.get(file.path);
9285
- if (relatedLICENSE && assets.add(relatedLICENSE), file.chunk) for (let auxiliaryFile of file.chunk.auxiliaryFiles)assets.add(auxiliaryFile);
9286
- }
9287
- let entryManifest = {};
9288
- assets.size && (entryManifest.assets = Array.from(assets));
9289
- let htmlPath = files.find((f)=>f.name === htmlPaths[entryName])?.path;
9290
- htmlPath && (entryManifest.html = [
9291
- htmlPath
9292
- ]), initialJS.length && (entryManifest.initial = {
9293
- js: initialJS
9294
- }), initialCSS.length && (entryManifest.initial = {
9295
- ...entryManifest.initial || {},
9296
- css: initialCSS
9297
- }), asyncJS.length && (entryManifest.async = {
9298
- js: asyncJS
9299
- }), asyncCSS.length && (entryManifest.async = {
9300
- ...entryManifest.async || {},
9301
- css: asyncCSS
9302
- }), manifestEntries[entryName] = entryManifest;
8658
+ manifestFilenames.set(environment.name, manifestOptions.filename);
8659
+ let pluginOptions = {
8660
+ fileName: manifestOptions.filename,
8661
+ filter,
8662
+ writeToFileEmit: isDev && !0 !== writeToDisk,
8663
+ generate: (_seed, files, entries, { compilation })=>{
8664
+ let chunkEntries = new Map(), licenseMap = new Map(), publicPath = getPublicPathFromCompiler(compilation), integrity = {}, allFiles = files.map((file)=>{
8665
+ if (file.integrity && (integrity[file.path] = file.integrity), file.chunk) for (let entryName of recursiveChunkEntryNames(file.chunk))chunkEntries.set(entryName, [
8666
+ file,
8667
+ ...chunkEntries.get(entryName) || []
8668
+ ]);
8669
+ if (file.path.endsWith('.LICENSE.txt')) {
8670
+ let sourceFilePath = file.path.split('.LICENSE.txt')[0];
8671
+ licenseMap.set(sourceFilePath, file.path);
9303
8672
  }
9304
- let manifestData = {
9305
- allFiles,
9306
- entries: manifestEntries,
9307
- integrity
9308
- };
9309
- if (manifestOptions.generate) {
9310
- let generatedManifest = manifestOptions.generate({
9311
- files,
9312
- manifestData
9313
- });
9314
- if (isObject(generatedManifest)) return environment.manifest = generatedManifest, generatedManifest;
9315
- throw Error(`${color.dim('[rsbuild:manifest]')} \`manifest.generate\` function must return a valid manifest object.`);
8673
+ return file.path;
8674
+ }), manifestEntries = {};
8675
+ for (let [entryName, chunkFiles] of chunkEntries){
8676
+ let assets = new Set(), initialJS = [], initialCSS = [], asyncJS = [], asyncCSS = [];
8677
+ if (entries[entryName]) for (let filePath of entries[entryName]){
8678
+ let fileURL = manifestOptions.prefix ? ensureAssetPrefix(filePath, publicPath) : filePath;
8679
+ isCSSPath(filePath) ? initialCSS.push(fileURL) : initialJS.push(fileURL);
9316
8680
  }
9317
- return environment.manifest = manifestData, manifestData;
8681
+ for (let file of chunkFiles){
8682
+ file.isInitial || (isCSSPath(file.path) ? asyncCSS.push(file.path) : asyncJS.push(file.path));
8683
+ let relatedLICENSE = licenseMap.get(file.path);
8684
+ if (relatedLICENSE && assets.add(relatedLICENSE), file.chunk) for (let auxiliaryFile of file.chunk.auxiliaryFiles)assets.add(auxiliaryFile);
8685
+ }
8686
+ let entryManifest = {};
8687
+ assets.size && (entryManifest.assets = Array.from(assets));
8688
+ let htmlPath = files.find((f)=>f.name === htmlPaths[entryName])?.path;
8689
+ htmlPath && (entryManifest.html = [
8690
+ htmlPath
8691
+ ]), initialJS.length && (entryManifest.initial = {
8692
+ js: initialJS
8693
+ }), initialCSS.length && (entryManifest.initial = {
8694
+ ...entryManifest.initial || {},
8695
+ css: initialCSS
8696
+ }), asyncJS.length && (entryManifest.async = {
8697
+ js: asyncJS
8698
+ }), asyncCSS.length && (entryManifest.async = {
8699
+ ...entryManifest.async || {},
8700
+ css: asyncCSS
8701
+ }), manifestEntries[entryName] = entryManifest;
9318
8702
  }
8703
+ let manifestData = {
8704
+ allFiles,
8705
+ entries: manifestEntries,
8706
+ integrity
8707
+ };
8708
+ if (manifestOptions.generate) {
8709
+ let generatedManifest = manifestOptions.generate({
8710
+ files,
8711
+ manifestData
8712
+ });
8713
+ if (isObject(generatedManifest)) return environment.manifest = generatedManifest, generatedManifest;
8714
+ throw Error(`${color.dim('[rsbuild:manifest]')} \`manifest.generate\` function must return a valid manifest object.`);
8715
+ }
8716
+ return environment.manifest = manifestData, manifestData;
9319
8717
  }
8718
+ };
8719
+ manifestOptions.prefix || (pluginOptions.publicPath = ''), chain.plugin(CHAIN_ID.PLUGIN.MANIFEST).use(RspackManifestPlugin, [
8720
+ pluginOptions
9320
8721
  ]);
9321
8722
  }), api.onAfterCreateCompiler(()=>{
9322
8723
  if (manifestFilenames.size <= 1) return void manifestFilenames.clear();
@@ -9718,7 +9119,7 @@ let applyServerOptions = (command)=>{
9718
9119
  };
9719
9120
  function setupCommands() {
9720
9121
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9721
- cli.version("1.6.10"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9122
+ cli.version("1.6.12-canary-63b4dae2-20251204065915"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9722
9123
  default: 'auto'
9723
9124
  }).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
9724
9125
  type: [
@@ -9787,7 +9188,7 @@ function initNodeEnv() {
9787
9188
  }
9788
9189
  function showGreeting() {
9789
9190
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9790
- logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.10\n`);
9191
+ logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.12-canary-63b4dae2-20251204065915\n`);
9791
9192
  }
9792
9193
  function setupLogLevel() {
9793
9194
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9808,9 +9209,9 @@ function runCLI() {
9808
9209
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
9809
9210
  }
9810
9211
  }
9811
- let src_version = "1.6.10";
9212
+ let src_version = "1.6.12-canary-63b4dae2-20251204065915";
9812
9213
  import * as __rspack_external_node_module_ab9f2194 from "node:module";
9813
9214
  import { createRequire as __rspack_createRequire } from "node:module";
9814
9215
  import * as __rspack_external_node_url_e96de089 from "node:url";
9815
- import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
9216
+ import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
9816
9217
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, logger, mergeRsbuildConfig, node_fs, node_os, node_process, rspack_rspack as rspack, runCLI, src_version as version };