@rsbuild/core 1.2.16 → 1.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,5 +1,32 @@
1
+ /*! For license information please see index.cjs.LICENSE.txt */
1
2
  let __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
2
3
  var __webpack_modules__ = {
4
+ "../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
5
+ "use strict";
6
+ 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");
7
+ module.exports = function cloneDeep(val, instanceClone) {
8
+ switch(typeOf(val)){
9
+ case 'object':
10
+ return function(val, instanceClone) {
11
+ if ('function' == typeof instanceClone) return instanceClone(val);
12
+ if (instanceClone || isPlainObject(val)) {
13
+ let res = new val.constructor();
14
+ for(let key in val)res[key] = cloneDeep(val[key], instanceClone);
15
+ return res;
16
+ }
17
+ return val;
18
+ }(val, instanceClone);
19
+ case 'array':
20
+ return function(val, instanceClone) {
21
+ let res = new val.constructor(val.length);
22
+ for(let i = 0; i < val.length; i++)res[i] = cloneDeep(val[i], instanceClone);
23
+ return res;
24
+ }(val, instanceClone);
25
+ default:
26
+ return clone(val);
27
+ }
28
+ };
29
+ },
3
30
  "../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js": function(module) {
4
31
  "use strict";
5
32
  var isMergeableObject = function(value) {
@@ -232,6 +259,627 @@ var __webpack_modules__ = {
232
259
  };
233
260
  module.exports.configDotenv = DotenvModule.configDotenv, module.exports._configVault = DotenvModule._configVault, module.exports._parseVault = DotenvModule._parseVault, module.exports.config = DotenvModule.config, module.exports.decrypt = DotenvModule.decrypt, module.exports.parse = DotenvModule.parse, module.exports.populate = DotenvModule.populate, module.exports = DotenvModule;
234
261
  },
262
+ "../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js": function(module) {
263
+ function isBuffer(obj) {
264
+ return obj && obj.constructor && 'function' == typeof obj.constructor.isBuffer && obj.constructor.isBuffer(obj);
265
+ }
266
+ function keyIdentity(key) {
267
+ return key;
268
+ }
269
+ function flatten(target, opts) {
270
+ let delimiter = (opts = opts || {}).delimiter || '.', maxDepth = opts.maxDepth, transformKey = opts.transformKey || keyIdentity, output = {};
271
+ return !function step(object, prev, currentDepth) {
272
+ currentDepth = currentDepth || 1, Object.keys(object).forEach(function(key) {
273
+ 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);
274
+ if (!isarray && !isbuffer && ('[object Object]' === type || '[object Array]' === type) && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
275
+ output[newKey] = value;
276
+ });
277
+ }(target), output;
278
+ }
279
+ module.exports = flatten, flatten.flatten = flatten, flatten.unflatten = function unflatten(target, opts) {
280
+ let delimiter = (opts = opts || {}).delimiter || '.', overwrite = opts.overwrite || !1, transformKey = opts.transformKey || keyIdentity, result = {};
281
+ if (isBuffer(target) || '[object Object]' !== Object.prototype.toString.call(target)) return target;
282
+ function getkey(key) {
283
+ let parsedKey = Number(key);
284
+ return isNaN(parsedKey) || -1 !== key.indexOf('.') || opts.object ? key : parsedKey;
285
+ }
286
+ return Object.keys(target = Object.keys(target).reduce(function(result, key) {
287
+ var target1;
288
+ let type = Object.prototype.toString.call(target[key]);
289
+ return '[object Object]' !== type && '[object Array]' !== type || function(val) {
290
+ let type = Object.prototype.toString.call(val);
291
+ return !val || ('[object Array]' === type ? !val.length : '[object Object]' === type ? !Object.keys(val).length : void 0);
292
+ }(target[key]) ? (result[key] = target[key], result) : Object.keys(target1 = flatten(target[key], opts)).reduce(function(result, key1) {
293
+ return result[key + delimiter + key1] = target1[key1], result;
294
+ }, result);
295
+ }, {})).forEach(function(key) {
296
+ let split = key.split(delimiter).map(transformKey), key1 = getkey(split.shift()), key2 = getkey(split[0]), recipient = result;
297
+ for(; void 0 !== key2;){
298
+ if ('__proto__' === key1) return;
299
+ let type = Object.prototype.toString.call(recipient[key1]), isobject = '[object Object]' === type || '[object Array]' === type;
300
+ if (!overwrite && !isobject && void 0 !== recipient[key1]) return;
301
+ (!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]));
302
+ }
303
+ recipient[key1] = unflatten(target[key], opts);
304
+ }), result;
305
+ };
306
+ },
307
+ "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
308
+ "use strict";
309
+ var isObject = __webpack_require__("../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js");
310
+ function isObjectObject(o) {
311
+ return !0 === isObject(o) && '[object Object]' === Object.prototype.toString.call(o);
312
+ }
313
+ module.exports = function(o) {
314
+ var ctor, prot;
315
+ return !1 !== isObjectObject(o) && 'function' == typeof (ctor = o.constructor) && !1 !== isObjectObject(prot = ctor.prototype) && !1 !== prot.hasOwnProperty('isPrototypeOf');
316
+ };
317
+ },
318
+ "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js": function(module) {
319
+ "use strict";
320
+ module.exports = function(val) {
321
+ return null != val && 'object' == typeof val && !1 === Array.isArray(val);
322
+ };
323
+ },
324
+ "../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js": function(module) {
325
+ var toString = Object.prototype.toString;
326
+ function ctorName(val) {
327
+ return 'function' == typeof val.constructor ? val.constructor.name : null;
328
+ }
329
+ module.exports = function(val) {
330
+ if (void 0 === val) return 'undefined';
331
+ if (null === val) return 'null';
332
+ var val1, val2, val3, val4, val5, val6, val7, type = typeof val;
333
+ if ('boolean' === type) return 'boolean';
334
+ if ('string' === type) return 'string';
335
+ if ('number' === type) return 'number';
336
+ if ('symbol' === type) return 'symbol';
337
+ if ('function' === type) {
338
+ return 'GeneratorFunction' === ctorName(val) ? 'generatorfunction' : 'function';
339
+ }
340
+ if (val2 = val, Array.isArray ? Array.isArray(val2) : val2 instanceof Array) return 'array';
341
+ if ((val3 = val).constructor && 'function' == typeof val3.constructor.isBuffer && val3.constructor.isBuffer(val3)) return 'buffer';
342
+ if (function(val) {
343
+ try {
344
+ if ('number' == typeof val.length && 'function' == typeof val.callee) return !0;
345
+ } catch (err) {
346
+ if (-1 !== err.message.indexOf('callee')) return !0;
347
+ }
348
+ return !1;
349
+ }(val)) return 'arguments';
350
+ if ((val4 = val) instanceof Date || 'function' == typeof val4.toDateString && 'function' == typeof val4.getDate && 'function' == typeof val4.setDate) return 'date';
351
+ if ((val5 = val) instanceof Error || 'string' == typeof val5.message && val5.constructor && 'number' == typeof val5.constructor.stackTraceLimit) return 'error';
352
+ if ((val6 = val) instanceof RegExp || 'string' == typeof val6.flags && 'boolean' == typeof val6.ignoreCase && 'boolean' == typeof val6.multiline && 'boolean' == typeof val6.global) return 'regexp';
353
+ switch(ctorName(val)){
354
+ case 'Symbol':
355
+ return 'symbol';
356
+ case 'Promise':
357
+ return 'promise';
358
+ case 'WeakMap':
359
+ return 'weakmap';
360
+ case 'WeakSet':
361
+ return 'weakset';
362
+ case 'Map':
363
+ return 'map';
364
+ case 'Set':
365
+ return 'set';
366
+ case 'Int8Array':
367
+ return 'int8array';
368
+ case 'Uint8Array':
369
+ return 'uint8array';
370
+ case 'Uint8ClampedArray':
371
+ return 'uint8clampedarray';
372
+ case 'Int16Array':
373
+ return 'int16array';
374
+ case 'Uint16Array':
375
+ return 'uint16array';
376
+ case 'Int32Array':
377
+ return 'int32array';
378
+ case 'Uint32Array':
379
+ return 'uint32array';
380
+ case 'Float32Array':
381
+ return 'float32array';
382
+ case 'Float64Array':
383
+ return 'float64array';
384
+ }
385
+ if ('function' == typeof (val7 = val).throw && 'function' == typeof val7.return && 'function' == typeof val7.next) return 'generator';
386
+ switch(type = toString.call(val)){
387
+ case '[object Object]':
388
+ return 'object';
389
+ case '[object Map Iterator]':
390
+ return 'mapiterator';
391
+ case '[object Set Iterator]':
392
+ return 'setiterator';
393
+ case '[object String Iterator]':
394
+ return 'stringiterator';
395
+ case '[object Array Iterator]':
396
+ return 'arrayiterator';
397
+ }
398
+ return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
399
+ };
400
+ },
401
+ "../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
402
+ "use strict";
403
+ let valueOf = Symbol.prototype.valueOf, typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js");
404
+ module.exports = function(val, deep) {
405
+ var val1, val2, deep1;
406
+ switch(typeOf(val)){
407
+ case 'array':
408
+ return val.slice();
409
+ case 'object':
410
+ return Object.assign({}, val);
411
+ case 'date':
412
+ return new val.constructor(Number(val));
413
+ case 'map':
414
+ return new Map(val);
415
+ case 'set':
416
+ return new Set(val);
417
+ case 'buffer':
418
+ return function(val) {
419
+ let len = val.length, buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len);
420
+ return val.copy(buf), buf;
421
+ }(val);
422
+ case 'symbol':
423
+ return val1 = val, valueOf ? Object(valueOf.call(val1)) : {};
424
+ case 'arraybuffer':
425
+ return function(val) {
426
+ let res = new val.constructor(val.byteLength);
427
+ return new Uint8Array(res).set(new Uint8Array(val)), res;
428
+ }(val);
429
+ case 'float32array':
430
+ case 'float64array':
431
+ case 'int16array':
432
+ case 'int32array':
433
+ case 'int8array':
434
+ case 'uint16array':
435
+ case 'uint32array':
436
+ case 'uint8clampedarray':
437
+ case 'uint8array':
438
+ return new (val2 = val).constructor(val2.buffer, val2.byteOffset, val2.length);
439
+ case 'regexp':
440
+ return function(val) {
441
+ let flags = void 0 !== val.flags ? val.flags : /\w+$/.exec(val) || void 0, re = new val.constructor(val.source, flags);
442
+ return re.lastIndex = val.lastIndex, re;
443
+ }(val);
444
+ case 'error':
445
+ return Object.create(val);
446
+ default:
447
+ return val;
448
+ }
449
+ };
450
+ },
451
+ "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
452
+ "use strict";
453
+ var __read = this && this.__read || function(o, n) {
454
+ var m = "function" == typeof Symbol && o[Symbol.iterator];
455
+ if (!m) return o;
456
+ var r, e, i = m.call(o), ar = [];
457
+ try {
458
+ for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
459
+ } catch (error) {
460
+ e = {
461
+ error: error
462
+ };
463
+ } finally{
464
+ try {
465
+ r && !r.done && (m = i.return) && m.call(i);
466
+ } finally{
467
+ if (e) throw e.error;
468
+ }
469
+ }
470
+ return ar;
471
+ }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
472
+ 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]);
473
+ return to.concat(ar || Array.prototype.slice.call(from));
474
+ }, __importDefault = this && this.__importDefault || function(mod) {
475
+ return mod && mod.__esModule ? mod : {
476
+ default: mod
477
+ };
478
+ };
479
+ Object.defineProperty(exports1, "__esModule", {
480
+ value: !0
481
+ }), exports1.unique = exports1.mergeWithRules = exports1.mergeWithCustomize = exports1.default = exports1.merge = exports1.CustomizeRule = exports1.customizeObject = exports1.customizeArray = void 0;
482
+ 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")), unique_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js"));
483
+ exports1.unique = unique_1.default;
484
+ var types_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js");
485
+ Object.defineProperty(exports1, "CustomizeRule", {
486
+ enumerable: !0,
487
+ get: function() {
488
+ return types_1.CustomizeRule;
489
+ }
490
+ });
491
+ var utils_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js");
492
+ function merge(firstConfiguration) {
493
+ for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
494
+ return mergeWithCustomize({}).apply(void 0, __spreadArray([
495
+ firstConfiguration
496
+ ], __read(configurations), !1));
497
+ }
498
+ function mergeWithCustomize(options) {
499
+ return function(firstConfiguration) {
500
+ for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
501
+ if ((0, utils_1.isUndefined)(firstConfiguration) || configurations.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
502
+ if (firstConfiguration.then) throw TypeError("Promises are not supported");
503
+ if (!firstConfiguration) return {};
504
+ if (0 === configurations.length) {
505
+ if (Array.isArray(firstConfiguration)) {
506
+ if (0 === firstConfiguration.length) return {};
507
+ if (firstConfiguration.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
508
+ if (firstConfiguration[0].then) throw TypeError("Promises are not supported");
509
+ return (0, merge_with_1.default)(firstConfiguration, (0, join_arrays_1.default)(options));
510
+ }
511
+ return firstConfiguration;
512
+ }
513
+ return (0, merge_with_1.default)([
514
+ firstConfiguration
515
+ ].concat(configurations), (0, join_arrays_1.default)(options));
516
+ };
517
+ }
518
+ exports1.merge = merge, exports1.default = merge, exports1.mergeWithCustomize = mergeWithCustomize, exports1.customizeArray = function(rules) {
519
+ return function(a, b, key) {
520
+ var matchedRule = Object.keys(rules).find(function(rule) {
521
+ return (0, wildcard_1.default)(rule, key);
522
+ }) || "";
523
+ if (matchedRule) switch(rules[matchedRule]){
524
+ case types_1.CustomizeRule.Prepend:
525
+ return __spreadArray(__spreadArray([], __read(b), !1), __read(a), !1);
526
+ case types_1.CustomizeRule.Replace:
527
+ return b;
528
+ case types_1.CustomizeRule.Append:
529
+ default:
530
+ return __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
531
+ }
532
+ };
533
+ }, exports1.mergeWithRules = function(rules) {
534
+ return mergeWithCustomize({
535
+ customizeArray: function(a, b, key) {
536
+ var currentRule = rules;
537
+ return (key.split(".").forEach(function(k) {
538
+ currentRule && (currentRule = currentRule[k]);
539
+ }), (0, utils_1.isPlainObject)(currentRule)) ? function mergeWithRule(_a) {
540
+ var currentRule = _a.currentRule, a = _a.a, b = _a.b;
541
+ if (!isArray(a)) return a;
542
+ var bAllMatches = [];
543
+ return a.map(function(ao) {
544
+ if (!(0, utils_1.isPlainObject)(currentRule)) return ao;
545
+ var ret = {}, rulesToMatch = [], operations = {};
546
+ Object.entries(currentRule).forEach(function(_a) {
547
+ var _b = __read(_a, 2), k = _b[0], v = _b[1];
548
+ v === types_1.CustomizeRule.Match ? rulesToMatch.push(k) : operations[k] = v;
549
+ });
550
+ var bMatches = b.filter(function(o) {
551
+ var matches = rulesToMatch.every(function(rule) {
552
+ return (0, utils_1.isSameCondition)(ao[rule], o[rule]);
553
+ });
554
+ return matches && bAllMatches.push(o), matches;
555
+ });
556
+ return (0, utils_1.isPlainObject)(ao) ? (Object.entries(ao).forEach(function(_a) {
557
+ var _b = __read(_a, 2), k = _b[0], v = _b[1];
558
+ switch(currentRule[k]){
559
+ case types_1.CustomizeRule.Match:
560
+ ret[k] = v, Object.entries(currentRule).forEach(function(_a) {
561
+ var _b = __read(_a, 2), k = _b[0];
562
+ if (_b[1] === types_1.CustomizeRule.Replace && bMatches.length > 0) {
563
+ var val = last(bMatches)[k];
564
+ void 0 !== val && (ret[k] = val);
565
+ }
566
+ });
567
+ break;
568
+ case types_1.CustomizeRule.Append:
569
+ if (!bMatches.length) {
570
+ ret[k] = v;
571
+ break;
572
+ }
573
+ var appendValue = last(bMatches)[k];
574
+ if (!isArray(v) || !isArray(appendValue)) throw TypeError("Trying to append non-arrays");
575
+ ret[k] = v.concat(appendValue);
576
+ break;
577
+ case types_1.CustomizeRule.Merge:
578
+ if (!bMatches.length) {
579
+ ret[k] = v;
580
+ break;
581
+ }
582
+ var lastValue = last(bMatches)[k];
583
+ if (!(0, utils_1.isPlainObject)(v) || !(0, utils_1.isPlainObject)(lastValue)) throw TypeError("Trying to merge non-objects");
584
+ ret[k] = merge(v, lastValue);
585
+ break;
586
+ case types_1.CustomizeRule.Prepend:
587
+ if (!bMatches.length) {
588
+ ret[k] = v;
589
+ break;
590
+ }
591
+ var prependValue = last(bMatches)[k];
592
+ if (!isArray(v) || !isArray(prependValue)) throw TypeError("Trying to prepend non-arrays");
593
+ ret[k] = prependValue.concat(v);
594
+ break;
595
+ case types_1.CustomizeRule.Replace:
596
+ ret[k] = bMatches.length > 0 ? last(bMatches)[k] : v;
597
+ break;
598
+ default:
599
+ var currentRule_1 = operations[k], b_1 = bMatches.map(function(o) {
600
+ return o[k];
601
+ }).reduce(function(acc, val) {
602
+ return isArray(acc) && isArray(val) ? __spreadArray(__spreadArray([], __read(acc), !1), __read(val), !1) : acc;
603
+ }, []);
604
+ ret[k] = mergeWithRule({
605
+ currentRule: currentRule_1,
606
+ a: v,
607
+ b: b_1
608
+ });
609
+ }
610
+ }), ret) : ao;
611
+ }).concat(b.filter(function(o) {
612
+ return !bAllMatches.includes(o);
613
+ }));
614
+ }({
615
+ currentRule: currentRule,
616
+ a: a,
617
+ b: b
618
+ }) : "string" == typeof currentRule ? function(_a) {
619
+ var currentRule = _a.currentRule, a = _a.a, b = _a.b;
620
+ switch(currentRule){
621
+ case types_1.CustomizeRule.Append:
622
+ return a.concat(b);
623
+ case types_1.CustomizeRule.Prepend:
624
+ return b.concat(a);
625
+ case types_1.CustomizeRule.Replace:
626
+ return b;
627
+ }
628
+ return a;
629
+ }({
630
+ currentRule: currentRule,
631
+ a: a,
632
+ b: b
633
+ }) : void 0;
634
+ }
635
+ });
636
+ };
637
+ var isArray = Array.isArray;
638
+ function last(arr) {
639
+ return arr[arr.length - 1];
640
+ }
641
+ exports1.customizeObject = function(rules) {
642
+ return function(a, b, key) {
643
+ switch(rules[key]){
644
+ case types_1.CustomizeRule.Prepend:
645
+ return (0, merge_with_1.default)([
646
+ b,
647
+ a
648
+ ], (0, join_arrays_1.default)());
649
+ case types_1.CustomizeRule.Replace:
650
+ return b;
651
+ case types_1.CustomizeRule.Append:
652
+ return (0, merge_with_1.default)([
653
+ a,
654
+ b
655
+ ], (0, join_arrays_1.default)());
656
+ }
657
+ };
658
+ };
659
+ },
660
+ "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/join-arrays.js": function(__unused_webpack_module, exports1, __webpack_require__) {
661
+ "use strict";
662
+ var __read = this && this.__read || function(o, n) {
663
+ var m = "function" == typeof Symbol && o[Symbol.iterator];
664
+ if (!m) return o;
665
+ var r, e, i = m.call(o), ar = [];
666
+ try {
667
+ for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
668
+ } catch (error) {
669
+ e = {
670
+ error: error
671
+ };
672
+ } finally{
673
+ try {
674
+ r && !r.done && (m = i.return) && m.call(i);
675
+ } finally{
676
+ if (e) throw e.error;
677
+ }
678
+ }
679
+ return ar;
680
+ }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
681
+ 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]);
682
+ return to.concat(ar || Array.prototype.slice.call(from));
683
+ }, __importDefault = this && this.__importDefault || function(mod) {
684
+ return mod && mod.__esModule ? mod : {
685
+ default: mod
686
+ };
687
+ };
688
+ Object.defineProperty(exports1, "__esModule", {
689
+ value: !0
690
+ });
691
+ 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;
692
+ exports1.default = function joinArrays(_a) {
693
+ var _b = void 0 === _a ? {} : _a, customizeArray = _b.customizeArray, customizeObject = _b.customizeObject, key = _b.key;
694
+ return function _joinArrays(a, b, k) {
695
+ var newKey = key ? "".concat(key, ".").concat(k) : k;
696
+ if ((0, utils_1.isFunction)(a) && (0, utils_1.isFunction)(b)) return function() {
697
+ for(var args = [], _i = 0; _i < arguments.length; _i++)args[_i] = arguments[_i];
698
+ return _joinArrays(a.apply(void 0, __spreadArray([], __read(args), !1)), b.apply(void 0, __spreadArray([], __read(args), !1)), k);
699
+ };
700
+ if (isArray(a) && isArray(b)) {
701
+ var customResult = customizeArray && customizeArray(a, b, newKey);
702
+ return customResult || __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
703
+ }
704
+ if ((0, utils_1.isRegex)(b)) return b;
705
+ if ((0, utils_1.isPlainObject)(a) && (0, utils_1.isPlainObject)(b)) {
706
+ var customResult = customizeObject && customizeObject(a, b, newKey);
707
+ return customResult || (0, merge_with_1.default)([
708
+ a,
709
+ b
710
+ ], joinArrays({
711
+ customizeArray: customizeArray,
712
+ customizeObject: customizeObject,
713
+ key: newKey
714
+ }));
715
+ }
716
+ return (0, utils_1.isPlainObject)(b) ? (0, clone_deep_1.default)(b) : isArray(b) ? __spreadArray([], __read(b), !1) : b;
717
+ };
718
+ };
719
+ },
720
+ "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js": function(__unused_webpack_module, exports1) {
721
+ "use strict";
722
+ var __read = this && this.__read || function(o, n) {
723
+ var m = "function" == typeof Symbol && o[Symbol.iterator];
724
+ if (!m) return o;
725
+ var r, e, i = m.call(o), ar = [];
726
+ try {
727
+ for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
728
+ } catch (error) {
729
+ e = {
730
+ error: error
731
+ };
732
+ } finally{
733
+ try {
734
+ r && !r.done && (m = i.return) && m.call(i);
735
+ } finally{
736
+ if (e) throw e.error;
737
+ }
738
+ }
739
+ return ar;
740
+ };
741
+ Object.defineProperty(exports1, "__esModule", {
742
+ value: !0
743
+ }), exports1.default = function(objects, customizer) {
744
+ var _a = __read(objects), first = _a[0], rest = _a.slice(1), ret = first;
745
+ return rest.forEach(function(a) {
746
+ var a1, b, customizer1, ret1;
747
+ a1 = ret, b = a, customizer1 = customizer, ret1 = {}, Object.keys(a1).concat(Object.keys(b)).forEach(function(k) {
748
+ var v = customizer1(a1[k], b[k], k);
749
+ ret1[k] = void 0 === v ? a1[k] : v;
750
+ }), ret = ret1;
751
+ }), ret;
752
+ };
753
+ },
754
+ "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js": function(__unused_webpack_module, exports1) {
755
+ "use strict";
756
+ var CustomizeRule, CustomizeRule1;
757
+ Object.defineProperty(exports1, "__esModule", {
758
+ value: !0
759
+ }), exports1.CustomizeRule = void 0, (CustomizeRule1 = CustomizeRule || (exports1.CustomizeRule = CustomizeRule = {})).Match = "match", CustomizeRule1.Merge = "merge", CustomizeRule1.Append = "append", CustomizeRule1.Prepend = "prepend", CustomizeRule1.Replace = "replace";
760
+ },
761
+ "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js": function(__unused_webpack_module, exports1) {
762
+ "use strict";
763
+ var __read = this && this.__read || function(o, n) {
764
+ var m = "function" == typeof Symbol && o[Symbol.iterator];
765
+ if (!m) return o;
766
+ var r, e, i = m.call(o), ar = [];
767
+ try {
768
+ for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
769
+ } catch (error) {
770
+ e = {
771
+ error: error
772
+ };
773
+ } finally{
774
+ try {
775
+ r && !r.done && (m = i.return) && m.call(i);
776
+ } finally{
777
+ if (e) throw e.error;
778
+ }
779
+ }
780
+ return ar;
781
+ }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
782
+ 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]);
783
+ return to.concat(ar || Array.prototype.slice.call(from));
784
+ };
785
+ Object.defineProperty(exports1, "__esModule", {
786
+ value: !0
787
+ }), exports1.default = function(key, uniques, getter) {
788
+ var uniquesSet = new Set(uniques);
789
+ return function(a, b, k) {
790
+ return k === key && Array.from(__spreadArray(__spreadArray([], __read(a), !1), __read(b), !1).map(function(it) {
791
+ return {
792
+ key: getter(it),
793
+ value: it
794
+ };
795
+ }).map(function(_a) {
796
+ var key = _a.key, value = _a.value;
797
+ return {
798
+ key: uniquesSet.has(key) ? key : value,
799
+ value: value
800
+ };
801
+ }).reduce(function(m, _a) {
802
+ var key = _a.key, value = _a.value;
803
+ return m.delete(key), m.set(key, value);
804
+ }, new Map()).values());
805
+ };
806
+ };
807
+ },
808
+ "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js": function(__unused_webpack_module, exports1, __webpack_require__) {
809
+ "use strict";
810
+ var __read = this && this.__read || function(o, n) {
811
+ var m = "function" == typeof Symbol && o[Symbol.iterator];
812
+ if (!m) return o;
813
+ var r, e, i = m.call(o), ar = [];
814
+ try {
815
+ for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
816
+ } catch (error) {
817
+ e = {
818
+ error: error
819
+ };
820
+ } finally{
821
+ try {
822
+ r && !r.done && (m = i.return) && m.call(i);
823
+ } finally{
824
+ if (e) throw e.error;
825
+ }
826
+ }
827
+ return ar;
828
+ };
829
+ Object.defineProperty(exports1, "__esModule", {
830
+ value: !0
831
+ }), exports1.isSameCondition = exports1.isUndefined = exports1.isPlainObject = exports1.isFunction = exports1.isRegex = void 0;
832
+ var flat_1 = __webpack_require__("../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js");
833
+ function isRegex(o) {
834
+ return o instanceof RegExp;
835
+ }
836
+ function isFunction(functionToCheck) {
837
+ return functionToCheck && "[object Function]" === ({}).toString.call(functionToCheck);
838
+ }
839
+ exports1.isRegex = isRegex, exports1.isFunction = isFunction, exports1.isPlainObject = function(a) {
840
+ return !(null === a || Array.isArray(a)) && "object" == typeof a;
841
+ }, exports1.isUndefined = function(a) {
842
+ return void 0 === a;
843
+ }, exports1.isSameCondition = function(a, b) {
844
+ if (!a || !b) return a === b;
845
+ if ("string" == typeof a || "string" == typeof b || isRegex(a) || isRegex(b) || isFunction(a) || isFunction(b)) return a.toString() === b.toString();
846
+ var _a, _b, entriesA = Object.entries((0, flat_1.flatten)(a)), entriesB = Object.entries((0, flat_1.flatten)(b));
847
+ if (entriesA.length !== entriesB.length) return !1;
848
+ 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, "[]");
849
+ function cmp(_a, _b) {
850
+ var _c = __read(_a, 2), k1 = _c[0], v1 = _c[1], _d = __read(_b, 2), k2 = _d[0], v2 = _d[1];
851
+ return k1 < k2 ? -1 : k1 > k2 ? 1 : v1 < v2 ? -1 : +(v1 > v2);
852
+ }
853
+ if (entriesA.sort(cmp), entriesB.sort(cmp), entriesA.length !== entriesB.length) return !1;
854
+ for(var i = 0; i < entriesA.length; i++)if (entriesA[i][0] !== entriesB[i][0] || (null === (_a = entriesA[i][1]) || void 0 === _a ? void 0 : _a.toString()) !== (null === (_b = entriesB[i][1]) || void 0 === _b ? void 0 : _b.toString())) return !1;
855
+ return !0;
856
+ };
857
+ },
858
+ "../../node_modules/.pnpm/wildcard@2.0.1/node_modules/wildcard/index.js": function(module) {
859
+ "use strict";
860
+ var REGEXP_PARTS = /(\*|\?)/g;
861
+ function WildcardMatcher(text, separator) {
862
+ this.text = text = text || '', this.hasWild = text.indexOf('*') >= 0, this.separator = separator, this.parts = text.split(separator).map(this.classifyPart.bind(this));
863
+ }
864
+ WildcardMatcher.prototype.match = function(input) {
865
+ var ii, testParts, matches = !0, parts = this.parts, partsCount = parts.length;
866
+ if ('string' == typeof input || input instanceof String) {
867
+ if (this.hasWild || this.text == input) {
868
+ for(ii = 0, testParts = (input || '').split(this.separator); matches && ii < partsCount; ii++)'*' !== parts[ii] && (matches = ii < testParts.length && (parts[ii] instanceof RegExp ? parts[ii].test(testParts[ii]) : parts[ii] === testParts[ii]));
869
+ matches = matches && testParts;
870
+ } else matches = !1;
871
+ } else if ('function' == typeof input.splice) for(matches = [], ii = input.length; ii--;)this.match(input[ii]) && (matches[matches.length] = input[ii]);
872
+ else if ('object' == typeof input) for(var key in matches = {}, input)this.match(key) && (matches[key] = input[key]);
873
+ return matches;
874
+ }, WildcardMatcher.prototype.classifyPart = function(part) {
875
+ if ('*' === part) ;
876
+ else if (part.indexOf('*') >= 0 || part.indexOf('?') >= 0) return new RegExp(part.replace(REGEXP_PARTS, '\.$1'));
877
+ return part;
878
+ }, module.exports = function(text, test, separator) {
879
+ var matcher = new WildcardMatcher(text, separator || /[\/\.]/);
880
+ return void 0 !== test ? matcher.match(test) : matcher;
881
+ };
882
+ },
235
883
  crypto: function(module) {
236
884
  "use strict";
237
885
  module.exports = require("crypto");
@@ -304,10 +952,6 @@ var __webpack_modules__ = {
304
952
  "use strict";
305
953
  module.exports = import("../compiled/webpack-bundle-analyzer/index.js");
306
954
  },
307
- "../../compiled/webpack-merge/index.js": function(module) {
308
- "use strict";
309
- module.exports = import("../compiled/webpack-merge/index.js");
310
- },
311
955
  "../../compiled/ws/index.js": function(module) {
312
956
  "use strict";
313
957
  module.exports = import("../compiled/ws/index.js");
@@ -339,25 +983,19 @@ function __webpack_require__(moduleId) {
339
983
  var module = __webpack_module_cache__[moduleId] = {
340
984
  exports: {}
341
985
  };
342
- return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
986
+ return __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.exports;
343
987
  }
344
- __webpack_require__.n = function(module) {
345
- var getter = module && module.__esModule ? function() {
346
- return module.default;
347
- } : function() {
348
- return module;
349
- };
988
+ __webpack_require__.n = (module)=>{
989
+ var getter = module && module.__esModule ? ()=>module.default : ()=>module;
350
990
  return __webpack_require__.d(getter, {
351
991
  a: getter
352
992
  }), getter;
353
- }, __webpack_require__.d = function(exports1, definition) {
993
+ }, __webpack_require__.d = (exports1, definition)=>{
354
994
  for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
355
995
  enumerable: !0,
356
996
  get: definition[key]
357
997
  });
358
- }, __webpack_require__.o = function(obj, prop) {
359
- return Object.prototype.hasOwnProperty.call(obj, prop);
360
- }, __webpack_require__.r = function(exports1) {
998
+ }, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = function(exports1) {
361
999
  'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
362
1000
  value: 'Module'
363
1001
  }), Object.defineProperty(exports1, '__esModule', {
@@ -369,18 +1007,18 @@ var __webpack_exports__ = {};
369
1007
  "use strict";
370
1008
  let swcHelpersPath, pluginHelper_htmlPlugin, cssExtractPlugin;
371
1009
  __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
372
- ensureAssetPrefix: ()=>ensureAssetPrefix,
373
- PLUGIN_CSS_NAME: ()=>PLUGIN_CSS_NAME,
374
- mergeRsbuildConfig: ()=>mergeRsbuildConfig,
375
1010
  logger: ()=>rslog_index_js_namespaceObject.logger,
376
- loadEnv: ()=>loadEnv,
377
1011
  createRsbuild: ()=>createRsbuild,
378
1012
  rspack: ()=>core_namespaceObject.rspack,
1013
+ defineConfig: ()=>defineConfig,
1014
+ mergeRsbuildConfig: ()=>mergeRsbuildConfig,
379
1015
  runCLI: ()=>runCLI,
380
1016
  version: ()=>src_rslib_entry_version,
381
1017
  PLUGIN_SWC_NAME: ()=>PLUGIN_SWC_NAME,
1018
+ PLUGIN_CSS_NAME: ()=>PLUGIN_CSS_NAME,
382
1019
  loadConfig: ()=>config_loadConfig,
383
- defineConfig: ()=>defineConfig
1020
+ ensureAssetPrefix: ()=>ensureAssetPrefix,
1021
+ loadEnv: ()=>loadEnv
384
1022
  });
385
1023
  var provider_helpers_namespaceObject = {};
386
1024
  __webpack_require__.r(provider_helpers_namespaceObject), __webpack_require__.d(provider_helpers_namespaceObject, {
@@ -867,7 +1505,7 @@ var __webpack_exports__ = {};
867
1505
  }
868
1506
  function pickEnv(config, opts) {
869
1507
  let name;
870
- return 'object' != typeof config ? config : ('string' == typeof opts.env ? name = opts.env : process.env.BROWSERSLIST_ENV ? name = process.env.BROWSERSLIST_ENV : process.env.NODE_ENV ? name = process.env.NODE_ENV : name = 'production', config[name] || config.defaults);
1508
+ return 'object' != typeof config ? config : config['string' == typeof opts.env ? opts.env : process.env.BROWSERSLIST_ENV ? process.env.BROWSERSLIST_ENV : process.env.NODE_ENV ? process.env.NODE_ENV : 'production'] || config.defaults;
871
1509
  }
872
1510
  function eachParent(file, callback) {
873
1511
  let dir = isFile(file) ? external_node_path_namespaceObject.dirname(file) : file, loc = external_node_path_namespaceObject.resolve(dir);
@@ -894,7 +1532,7 @@ var __webpack_exports__ = {};
894
1532
  return OVERRIDE_PATHS.includes(realKey);
895
1533
  }
896
1534
  return OVERRIDE_PATHS.includes(key);
897
- }, mergeConfig_merge = (x, y, path = '')=>{
1535
+ }, merge = (x, y, path = '')=>{
898
1536
  if (isOverridePath(path)) return y ?? x;
899
1537
  if (void 0 === x) return isPlainObject(y) ? cloneDeep(y) : y;
900
1538
  if (void 0 === y) return isPlainObject(x) ? cloneDeep(x) : x;
@@ -915,10 +1553,10 @@ var __webpack_exports__ = {};
915
1553
  ...Object.keys(y)
916
1554
  ])){
917
1555
  let childPath = path ? `${path}.${key}` : key;
918
- merged[key] = mergeConfig_merge(x[key], y[key], childPath);
1556
+ merged[key] = merge(x[key], y[key], childPath);
919
1557
  }
920
1558
  return merged;
921
- }, mergeRsbuildConfig = (...configs)=>2 === configs.length ? mergeConfig_merge(configs[0], configs[1]) : configs.length < 2 ? configs[0] : configs.reduce((result, config)=>mergeConfig_merge(result, config), {}), commonOpts = {}, getEnvDir = (cwd, envDir)=>envDir ? external_node_path_default().isAbsolute(envDir) ? envDir : external_node_path_default().join(cwd, envDir) : cwd;
1559
+ }, mergeRsbuildConfig = (...configs)=>2 === configs.length ? merge(configs[0], configs[1]) : configs.length < 2 ? configs[0] : configs.reduce((result, config)=>merge(result, config), {}), commonOpts = {}, getEnvDir = (cwd, envDir)=>envDir ? external_node_path_default().isAbsolute(envDir) ? envDir : external_node_path_default().join(cwd, envDir) : cwd;
922
1560
  async function init({ cliOptions, isRestart, isBuildWatch = !1 }) {
923
1561
  cliOptions && (commonOpts = cliOptions);
924
1562
  try {
@@ -1239,7 +1877,7 @@ var __webpack_exports__ = {};
1239
1877
  ignorePermissionErrors: !0,
1240
1878
  ...watchOptions
1241
1879
  }), callback = (func = async (filePath)=>{
1242
- watcher.close(), isBuildWatch ? await restartBuild({
1880
+ await watcher.close(), isBuildWatch ? await restartBuild({
1243
1881
  filePath
1244
1882
  }) : await restartDevServer({
1245
1883
  filePath
@@ -1744,7 +2382,7 @@ var __webpack_exports__ = {};
1744
2382
  async function createContext(options, userConfig, bundlerType) {
1745
2383
  let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_namespaceObject.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
1746
2384
  return {
1747
- version: "1.2.16",
2385
+ version: "1.2.17",
1748
2386
  rootPath,
1749
2387
  distPath: '',
1750
2388
  cachePath,
@@ -4262,6 +4900,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4262
4900
  }
4263
4901
  };
4264
4902
  }
4903
+ var dist = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
4265
4904
  async function modifyRspackConfig(context, rspackConfig, utils) {
4266
4905
  var _utils_environment_config_tools;
4267
4906
  rslog_index_js_namespaceObject.logger.debug('modify Rspack config');
@@ -4280,11 +4919,10 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4280
4919
  })), rslog_index_js_namespaceObject.logger.debug('modify Rspack config done'), modifiedConfig;
4281
4920
  }
4282
4921
  async function getConfigUtils(config, chainUtils) {
4283
- let { merge } = await Promise.resolve().then(__webpack_require__.bind(__webpack_require__, "../../compiled/webpack-merge/index.js"));
4284
4922
  return {
4285
4923
  ...chainUtils,
4286
4924
  rspack: core_namespaceObject.rspack,
4287
- mergeConfig: merge,
4925
+ mergeConfig: dist.merge,
4288
4926
  addRules (rules) {
4289
4927
  let ruleArr = castArray(rules);
4290
4928
  config.module || (config.module = {}), config.module.rules || (config.module.rules = []), config.module.rules.unshift(...ruleArr);
@@ -4722,47 +5360,50 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4722
5360
  let curStats = this.stats[name];
4723
5361
  if (!curStats) return null;
4724
5362
  let statsOptions = getStatsOptions(curStats.compilation.compiler);
4725
- return curStats.toJson({
4726
- all: !1,
4727
- hash: !0,
4728
- assets: !0,
4729
- warnings: !0,
4730
- warningsCount: !0,
4731
- errors: !0,
4732
- errorsCount: !0,
4733
- errorDetails: !1,
4734
- entrypoints: !0,
4735
- children: !0,
4736
- moduleTrace: !0,
4737
- ...statsOptions
4738
- });
5363
+ return {
5364
+ statsJson: curStats.toJson({
5365
+ all: !1,
5366
+ hash: !0,
5367
+ assets: !0,
5368
+ warnings: !0,
5369
+ warningsCount: !0,
5370
+ errors: !0,
5371
+ errorsCount: !0,
5372
+ errorDetails: !1,
5373
+ entrypoints: !0,
5374
+ children: !0,
5375
+ moduleTrace: !0,
5376
+ ...statsOptions
5377
+ }),
5378
+ root: curStats.compilation.compiler.options.context
5379
+ };
4739
5380
  }
4740
5381
  sendStats({ force = !1, compilationId }) {
4741
- let stats = this.getStats(compilationId);
4742
- if (!stats) return null;
4743
- let newInitialChunks = new Set();
4744
- if (stats.entrypoints) for (let entrypoint of Object.values(stats.entrypoints)){
5382
+ let result = this.getStats(compilationId);
5383
+ if (!result) return null;
5384
+ let { statsJson, root } = result, newInitialChunks = new Set();
5385
+ if (statsJson.entrypoints) for (let entrypoint of Object.values(statsJson.entrypoints)){
4745
5386
  let chunks = entrypoint.chunks;
4746
5387
  if (Array.isArray(chunks)) for (let chunkName of chunks)chunkName && newInitialChunks.add(String(chunkName));
4747
5388
  }
4748
- let initialChunks = this.initialChunks[compilationId], shouldReload = !!stats.entrypoints && !!initialChunks && !(initialChunks.size === newInitialChunks.size && [
5389
+ let initialChunks = this.initialChunks[compilationId], shouldReload = !!statsJson.entrypoints && !!initialChunks && !(initialChunks.size === newInitialChunks.size && [
4749
5390
  ...initialChunks
4750
5391
  ].every((value)=>newInitialChunks.has(value)));
4751
5392
  if (this.initialChunks[compilationId] = newInitialChunks, shouldReload) return this.sockWrite({
4752
5393
  type: 'static-changed',
4753
5394
  compilationId
4754
5395
  });
4755
- if (!force && stats && !stats.errorsCount && stats.assets && stats.assets.every((asset)=>!asset.emitted)) return this.sockWrite({
5396
+ if (!force && statsJson && !statsJson.errorsCount && statsJson.assets && statsJson.assets.every((asset)=>!asset.emitted)) return this.sockWrite({
4756
5397
  type: 'still-ok',
4757
5398
  compilationId
4758
5399
  });
4759
5400
  if (this.sockWrite({
4760
5401
  type: 'hash',
4761
5402
  compilationId,
4762
- data: stats.hash
4763
- }), stats.errorsCount) {
5403
+ data: statsJson.hash
5404
+ }), statsJson.errorsCount) {
4764
5405
  let { errors: formattedErrors } = formatStatsMessages({
4765
- errors: getAllStatsErrors(stats),
5406
+ errors: getAllStatsErrors(statsJson),
4766
5407
  warnings: []
4767
5408
  });
4768
5409
  return this.sockWrite({
@@ -4770,10 +5411,13 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4770
5411
  compilationId,
4771
5412
  data: {
4772
5413
  text: formattedErrors,
4773
- html: function(errors) {
4774
- let htmlItems = errors.map((item)=>server_ansiHTML(item ? item.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;') : '').replace(/(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g, (file)=>{
4775
- let hasClosingSpan = file.includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file;
4776
- return `<a class="file-link" data-file="${filePath}">${filePath}</a>${hasClosingSpan ? '</span>' : ''}`;
5414
+ html: function(errors, root) {
5415
+ let htmlItems = errors.map((item)=>server_ansiHTML(item ? item.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;') : '').replace(/(?:\.\.?[\/\\]|[a-zA-Z]:\\|\/)[^:]*:\d+:\d+/g, (file)=>{
5416
+ let hasClosingSpan = file.includes('</span>') && !file.includes('<span'), filePath = hasClosingSpan ? file.replace('</span>', '') : file, isAbsolute = external_node_path_default().isAbsolute(filePath), absolutePath = root && !isAbsolute ? external_node_path_default().join(root, filePath) : filePath, relativePath = root && isAbsolute ? function(base, filepath) {
5417
+ let relativePath = (0, external_node_path_namespaceObject.relative)(base, filepath);
5418
+ return '' === relativePath ? `.${external_node_path_namespaceObject.sep}` : relativePath.startsWith('.') ? relativePath : `.${external_node_path_namespaceObject.sep}${relativePath}`;
5419
+ }(root, filePath) : filePath;
5420
+ return `<a class="file-link" data-file="${absolutePath}">${relativePath}</a>${hasClosingSpan ? '</span>' : ''}`;
4777
5421
  }));
4778
5422
  return `
4779
5423
  <style>
@@ -4895,13 +5539,13 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
4895
5539
  </div>
4896
5540
  </div>
4897
5541
  `;
4898
- }(formattedErrors)
5542
+ }(formattedErrors, root)
4899
5543
  }
4900
5544
  });
4901
5545
  }
4902
- if (stats.warningsCount) {
5546
+ if (statsJson.warningsCount) {
4903
5547
  let { warnings: formattedWarnings } = formatStatsMessages({
4904
- warnings: getAllStatsWarnings(stats),
5548
+ warnings: getAllStatsWarnings(statsJson),
4905
5549
  errors: []
4906
5550
  });
4907
5551
  return this.sockWrite({
@@ -6756,7 +7400,7 @@ ${section.body}` : section.body).join("\n\n"));
6756
7400
  }), actionArgs.push(options), command.commandAction.apply(this, actionArgs);
6757
7401
  }
6758
7402
  }
6759
- let dist = (name = "")=>new CAC(name), applyCommonOptions = (cli)=>{
7403
+ let cac_dist = (name = "")=>new CAC(name), applyCommonOptions = (cli)=>{
6760
7404
  cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
6761
7405
  default: 'jiti'
6762
7406
  }).option('-r, --root <root>', 'specify the project root directory, can be an absolute path or a path relative to cwd').option('-m, --mode <mode>', 'specify the build mode, can be `development`, `production` or `none`').option('--env-mode <mode>', 'specify the env mode to load the `.env.[mode]` file').option('--environment <name>', 'specify the name of environment to build', {
@@ -6780,12 +7424,12 @@ ${section.body}` : section.body).join("\n\n"));
6780
7424
  }
6781
7425
  }(), process.title = 'rsbuild-node';
6782
7426
  let { npm_execpath } = process.env;
6783
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.16\n`);
7427
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.17\n`);
6784
7428
  }();
6785
7429
  try {
6786
7430
  !function() {
6787
- let cli = dist('rsbuild');
6788
- cli.help(), cli.version("1.2.16"), applyCommonOptions(cli);
7431
+ let cli = cac_dist('rsbuild');
7432
+ cli.help(), cli.version("1.2.17"), applyCommonOptions(cli);
6789
7433
  let devCommand = cli.command('dev', 'starting the dev server'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
6790
7434
  applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
6791
7435
  try {
@@ -6836,7 +7480,7 @@ ${section.body}` : section.body).join("\n\n"));
6836
7480
  rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
6837
7481
  }
6838
7482
  }
6839
- let src_rslib_entry_version = "1.2.16";
7483
+ let src_rslib_entry_version = "1.2.17";
6840
7484
  })();
6841
7485
  var __webpack_export_target__ = exports;
6842
7486
  for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];