@rsbuild/core 1.6.10 → 1.6.11

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,35 +1,6 @@
1
1
  /*! For license information please see index.cjs.LICENSE.txt */
2
2
  const __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;
3
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
- function cloneDeep(val, instanceClone) {
8
- switch(typeOf(val)){
9
- case 'object':
10
- return cloneObjectDeep(val, instanceClone);
11
- case 'array':
12
- return cloneArrayDeep(val, instanceClone);
13
- default:
14
- return clone(val);
15
- }
16
- }
17
- function cloneObjectDeep(val, instanceClone) {
18
- if ('function' == typeof instanceClone) return instanceClone(val);
19
- if (instanceClone || isPlainObject(val)) {
20
- let res = new val.constructor();
21
- for(let key in val)res[key] = cloneDeep(val[key], instanceClone);
22
- return res;
23
- }
24
- return val;
25
- }
26
- function cloneArrayDeep(val, instanceClone) {
27
- let res = new val.constructor(val.length);
28
- for(let i = 0; i < val.length; i++)res[i] = cloneDeep(val[i], instanceClone);
29
- return res;
30
- }
31
- module.exports = cloneDeep;
32
- },
33
4
  "../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js": function(module) {
34
5
  "use strict";
35
6
  var isMergeableObject = function isMergeableObject(value) {
@@ -167,73 +138,6 @@ var __webpack_modules__ = {
167
138
  return thunk.cancel = cleanup, thunk;
168
139
  };
169
140
  },
170
- "../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js": function(module) {
171
- function isBuffer(obj) {
172
- return obj && obj.constructor && 'function' == typeof obj.constructor.isBuffer && obj.constructor.isBuffer(obj);
173
- }
174
- function keyIdentity(key) {
175
- return key;
176
- }
177
- function flatten(target, opts) {
178
- let delimiter = (opts = opts || {}).delimiter || '.', maxDepth = opts.maxDepth, transformKey = opts.transformKey || keyIdentity, output = {};
179
- function step(object, prev, currentDepth) {
180
- currentDepth = currentDepth || 1, Object.keys(object).forEach(function(key) {
181
- 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);
182
- if (!isarray && !isbuffer && ('[object Object]' === type || '[object Array]' === type) && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
183
- output[newKey] = value;
184
- });
185
- }
186
- return step(target), output;
187
- }
188
- function unflatten(target, opts) {
189
- let delimiter = (opts = opts || {}).delimiter || '.', overwrite = opts.overwrite || !1, transformKey = opts.transformKey || keyIdentity, result = {};
190
- if (isBuffer(target) || '[object Object]' !== Object.prototype.toString.call(target)) return target;
191
- function getkey(key) {
192
- let parsedKey = Number(key);
193
- return isNaN(parsedKey) || -1 !== key.indexOf('.') || opts.object ? key : parsedKey;
194
- }
195
- function addKeys(keyPrefix, recipient, target) {
196
- return Object.keys(target).reduce(function(result, key) {
197
- return result[keyPrefix + delimiter + key] = target[key], result;
198
- }, recipient);
199
- }
200
- function isEmpty(val) {
201
- let type = Object.prototype.toString.call(val);
202
- return !val || ('[object Array]' === type ? !val.length : '[object Object]' === type ? !Object.keys(val).length : void 0);
203
- }
204
- return Object.keys(target = Object.keys(target).reduce(function(result, key) {
205
- let type = Object.prototype.toString.call(target[key]);
206
- return '[object Object]' !== type && '[object Array]' !== type || isEmpty(target[key]) ? (result[key] = target[key], result) : addKeys(key, result, flatten(target[key], opts));
207
- }, {})).forEach(function(key) {
208
- let split = key.split(delimiter).map(transformKey), key1 = getkey(split.shift()), key2 = getkey(split[0]), recipient = result;
209
- for(; void 0 !== key2;){
210
- if ('__proto__' === key1) return;
211
- let type = Object.prototype.toString.call(recipient[key1]), isobject = '[object Object]' === type || '[object Array]' === type;
212
- if (!overwrite && !isobject && void 0 !== recipient[key1]) return;
213
- (!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]));
214
- }
215
- recipient[key1] = unflatten(target[key], opts);
216
- }), result;
217
- }
218
- module.exports = flatten, flatten.flatten = flatten, flatten.unflatten = unflatten;
219
- },
220
- "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
221
- "use strict";
222
- var isObject = __webpack_require__("../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js");
223
- function isObjectObject(o) {
224
- return !0 === isObject(o) && '[object Object]' === Object.prototype.toString.call(o);
225
- }
226
- module.exports = function isPlainObject(o) {
227
- var ctor, prot;
228
- return !1 !== isObjectObject(o) && 'function' == typeof (ctor = o.constructor) && !1 !== isObjectObject(prot = ctor.prototype) && !1 !== prot.hasOwnProperty('isPrototypeOf');
229
- };
230
- },
231
- "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js": function(module) {
232
- "use strict";
233
- module.exports = function isObject(val) {
234
- return null != val && 'object' == typeof val && !1 === Array.isArray(val);
235
- };
236
- },
237
141
  "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js": function(__unused_webpack_module, exports1) {
238
142
  "use strict";
239
143
  Object.defineProperty(exports1, "__esModule", {
@@ -534,103 +438,6 @@ var __webpack_modules__ = {
534
438
  };
535
439
  exports1.toString = (value, space, next, key)=>null === value ? "null" : PRIMITIVE_TYPES[typeof value](value, space, next, key);
536
440
  },
537
- "../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js": function(module) {
538
- var toString = Object.prototype.toString;
539
- function ctorName(val) {
540
- return 'function' == typeof val.constructor ? val.constructor.name : null;
541
- }
542
- function isArray(val) {
543
- return Array.isArray ? Array.isArray(val) : val instanceof Array;
544
- }
545
- function isError(val) {
546
- return val instanceof Error || 'string' == typeof val.message && val.constructor && 'number' == typeof val.constructor.stackTraceLimit;
547
- }
548
- function isDate(val) {
549
- return val instanceof Date || 'function' == typeof val.toDateString && 'function' == typeof val.getDate && 'function' == typeof val.setDate;
550
- }
551
- function isRegexp(val) {
552
- return val instanceof RegExp || 'string' == typeof val.flags && 'boolean' == typeof val.ignoreCase && 'boolean' == typeof val.multiline && 'boolean' == typeof val.global;
553
- }
554
- function isGeneratorFn(name, val) {
555
- return 'GeneratorFunction' === ctorName(name);
556
- }
557
- function isGeneratorObj(val) {
558
- return 'function' == typeof val.throw && 'function' == typeof val.return && 'function' == typeof val.next;
559
- }
560
- function isArguments(val) {
561
- try {
562
- if ('number' == typeof val.length && 'function' == typeof val.callee) return !0;
563
- } catch (err) {
564
- if (-1 !== err.message.indexOf('callee')) return !0;
565
- }
566
- return !1;
567
- }
568
- function isBuffer(val) {
569
- return !!val.constructor && 'function' == typeof val.constructor.isBuffer && val.constructor.isBuffer(val);
570
- }
571
- module.exports = function kindOf(val) {
572
- if (void 0 === val) return 'undefined';
573
- if (null === val) return 'null';
574
- var type = typeof val;
575
- if ('boolean' === type) return 'boolean';
576
- if ('string' === type) return 'string';
577
- if ('number' === type) return 'number';
578
- if ('symbol' === type) return 'symbol';
579
- if ('function' === type) return isGeneratorFn(val) ? 'generatorfunction' : 'function';
580
- if (isArray(val)) return 'array';
581
- if (isBuffer(val)) return 'buffer';
582
- if (isArguments(val)) return 'arguments';
583
- if (isDate(val)) return 'date';
584
- if (isError(val)) return 'error';
585
- if (isRegexp(val)) return 'regexp';
586
- switch(ctorName(val)){
587
- case 'Symbol':
588
- return 'symbol';
589
- case 'Promise':
590
- return 'promise';
591
- case 'WeakMap':
592
- return 'weakmap';
593
- case 'WeakSet':
594
- return 'weakset';
595
- case 'Map':
596
- return 'map';
597
- case 'Set':
598
- return 'set';
599
- case 'Int8Array':
600
- return 'int8array';
601
- case 'Uint8Array':
602
- return 'uint8array';
603
- case 'Uint8ClampedArray':
604
- return 'uint8clampedarray';
605
- case 'Int16Array':
606
- return 'int16array';
607
- case 'Uint16Array':
608
- return 'uint16array';
609
- case 'Int32Array':
610
- return 'int32array';
611
- case 'Uint32Array':
612
- return 'uint32array';
613
- case 'Float32Array':
614
- return 'float32array';
615
- case 'Float64Array':
616
- return 'float64array';
617
- }
618
- if (isGeneratorObj(val)) return 'generator';
619
- switch(type = toString.call(val)){
620
- case '[object Object]':
621
- return 'object';
622
- case '[object Map Iterator]':
623
- return 'mapiterator';
624
- case '[object Set Iterator]':
625
- return 'setiterator';
626
- case '[object String Iterator]':
627
- return 'stringiterator';
628
- case '[object Array Iterator]':
629
- return 'arrayiterator';
630
- }
631
- return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
632
- };
633
- },
634
441
  "../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
635
442
  let path = __webpack_require__("path"), fs = __webpack_require__("fs"), os = __webpack_require__("os"), url = __webpack_require__("url"), fsReadFileAsync = fs.promises.readFile;
636
443
  function getDefaultSearchPlaces(name, sync) {
@@ -1094,502 +901,6 @@ var __webpack_modules__ = {
1094
901
  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')}`);
1095
902
  };
1096
903
  },
1097
- "../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1098
- "use strict";
1099
- let valueOf = Symbol.prototype.valueOf, typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js");
1100
- function cloneRegExp(val) {
1101
- let flags = void 0 !== val.flags ? val.flags : /\w+$/.exec(val) || void 0, re = new val.constructor(val.source, flags);
1102
- return re.lastIndex = val.lastIndex, re;
1103
- }
1104
- function cloneArrayBuffer(val) {
1105
- let res = new val.constructor(val.byteLength);
1106
- return new Uint8Array(res).set(new Uint8Array(val)), res;
1107
- }
1108
- function cloneTypedArray(val, deep) {
1109
- return new val.constructor(val.buffer, val.byteOffset, val.length);
1110
- }
1111
- function cloneBuffer(val) {
1112
- let len = val.length, buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len);
1113
- return val.copy(buf), buf;
1114
- }
1115
- function cloneSymbol(val) {
1116
- return valueOf ? Object(valueOf.call(val)) : {};
1117
- }
1118
- module.exports = function clone(val, deep) {
1119
- switch(typeOf(val)){
1120
- case 'array':
1121
- return val.slice();
1122
- case 'object':
1123
- return Object.assign({}, val);
1124
- case 'date':
1125
- return new val.constructor(Number(val));
1126
- case 'map':
1127
- return new Map(val);
1128
- case 'set':
1129
- return new Set(val);
1130
- case 'buffer':
1131
- return cloneBuffer(val);
1132
- case 'symbol':
1133
- return cloneSymbol(val);
1134
- case 'arraybuffer':
1135
- return cloneArrayBuffer(val);
1136
- case 'float32array':
1137
- case 'float64array':
1138
- case 'int16array':
1139
- case 'int32array':
1140
- case 'int8array':
1141
- case 'uint16array':
1142
- case 'uint32array':
1143
- case 'uint8clampedarray':
1144
- case 'uint8array':
1145
- return cloneTypedArray(val);
1146
- case 'regexp':
1147
- return cloneRegExp(val);
1148
- case 'error':
1149
- return Object.create(val);
1150
- default:
1151
- return val;
1152
- }
1153
- };
1154
- },
1155
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
1156
- "use strict";
1157
- var __read = this && this.__read || function(o, n) {
1158
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1159
- if (!m) return o;
1160
- var r, e, i = m.call(o), ar = [];
1161
- try {
1162
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1163
- } catch (error) {
1164
- e = {
1165
- error: error
1166
- };
1167
- } finally{
1168
- try {
1169
- r && !r.done && (m = i.return) && m.call(i);
1170
- } finally{
1171
- if (e) throw e.error;
1172
- }
1173
- }
1174
- return ar;
1175
- }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
1176
- 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]);
1177
- return to.concat(ar || Array.prototype.slice.call(from));
1178
- }, __importDefault = this && this.__importDefault || function(mod) {
1179
- return mod && mod.__esModule ? mod : {
1180
- default: mod
1181
- };
1182
- };
1183
- Object.defineProperty(exports1, "__esModule", {
1184
- value: !0
1185
- }), exports1.unique = exports1.mergeWithRules = exports1.mergeWithCustomize = exports1.default = exports1.merge = exports1.CustomizeRule = exports1.customizeObject = exports1.customizeArray = void 0;
1186
- 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"));
1187
- exports1.unique = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js")).default;
1188
- var types_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js");
1189
- Object.defineProperty(exports1, "CustomizeRule", {
1190
- enumerable: !0,
1191
- get: function() {
1192
- return types_1.CustomizeRule;
1193
- }
1194
- });
1195
- var utils_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js");
1196
- function merge(firstConfiguration) {
1197
- for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
1198
- return mergeWithCustomize({}).apply(void 0, __spreadArray([
1199
- firstConfiguration
1200
- ], __read(configurations), !1));
1201
- }
1202
- function mergeWithCustomize(options) {
1203
- return function mergeWithOptions(firstConfiguration) {
1204
- for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
1205
- if ((0, utils_1.isUndefined)(firstConfiguration) || configurations.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
1206
- if (firstConfiguration.then) throw TypeError("Promises are not supported");
1207
- if (!firstConfiguration) return {};
1208
- if (0 === configurations.length) {
1209
- if (Array.isArray(firstConfiguration)) {
1210
- if (0 === firstConfiguration.length) return {};
1211
- if (firstConfiguration.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
1212
- if (firstConfiguration[0].then) throw TypeError("Promises are not supported");
1213
- return (0, merge_with_1.default)(firstConfiguration, (0, join_arrays_1.default)(options));
1214
- }
1215
- return firstConfiguration;
1216
- }
1217
- return (0, merge_with_1.default)([
1218
- firstConfiguration
1219
- ].concat(configurations), (0, join_arrays_1.default)(options));
1220
- };
1221
- }
1222
- exports1.merge = merge, exports1.default = merge, exports1.mergeWithCustomize = mergeWithCustomize, exports1.customizeArray = function customizeArray(rules) {
1223
- return function(a, b, key) {
1224
- var matchedRule = Object.keys(rules).find(function(rule) {
1225
- return (0, wildcard_1.default)(rule, key);
1226
- }) || "";
1227
- if (matchedRule) switch(rules[matchedRule]){
1228
- case types_1.CustomizeRule.Prepend:
1229
- return __spreadArray(__spreadArray([], __read(b), !1), __read(a), !1);
1230
- case types_1.CustomizeRule.Replace:
1231
- return b;
1232
- case types_1.CustomizeRule.Append:
1233
- default:
1234
- return __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
1235
- }
1236
- };
1237
- }, exports1.mergeWithRules = function mergeWithRules(rules) {
1238
- return mergeWithCustomize({
1239
- customizeArray: function(a, b, key) {
1240
- var currentRule = rules;
1241
- return (key.split(".").forEach(function(k) {
1242
- currentRule && (currentRule = currentRule[k]);
1243
- }), (0, utils_1.isPlainObject)(currentRule)) ? mergeWithRule({
1244
- currentRule: currentRule,
1245
- a: a,
1246
- b: b
1247
- }) : "string" == typeof currentRule ? mergeIndividualRule({
1248
- currentRule: currentRule,
1249
- a: a,
1250
- b: b
1251
- }) : void 0;
1252
- }
1253
- });
1254
- };
1255
- var isArray = Array.isArray;
1256
- function mergeWithRule(_a) {
1257
- var currentRule = _a.currentRule, a = _a.a, b = _a.b;
1258
- if (!isArray(a)) return a;
1259
- var bAllMatches = [];
1260
- return a.map(function(ao) {
1261
- if (!(0, utils_1.isPlainObject)(currentRule)) return ao;
1262
- var ret = {}, rulesToMatch = [], operations = {};
1263
- Object.entries(currentRule).forEach(function(_a) {
1264
- var _b = __read(_a, 2), k = _b[0], v = _b[1];
1265
- v === types_1.CustomizeRule.Match ? rulesToMatch.push(k) : operations[k] = v;
1266
- });
1267
- var bMatches = b.filter(function(o) {
1268
- var matches = rulesToMatch.every(function(rule) {
1269
- return (0, utils_1.isSameCondition)(ao[rule], o[rule]);
1270
- });
1271
- return matches && bAllMatches.push(o), matches;
1272
- });
1273
- return (0, utils_1.isPlainObject)(ao) ? (Object.entries(ao).forEach(function(_a) {
1274
- var _b = __read(_a, 2), k = _b[0], v = _b[1];
1275
- switch(currentRule[k]){
1276
- case types_1.CustomizeRule.Match:
1277
- ret[k] = v, Object.entries(currentRule).forEach(function(_a) {
1278
- var _b = __read(_a, 2), k = _b[0];
1279
- if (_b[1] === types_1.CustomizeRule.Replace && bMatches.length > 0) {
1280
- var val = last(bMatches)[k];
1281
- void 0 !== val && (ret[k] = val);
1282
- }
1283
- });
1284
- break;
1285
- case types_1.CustomizeRule.Append:
1286
- if (!bMatches.length) {
1287
- ret[k] = v;
1288
- break;
1289
- }
1290
- var appendValue = last(bMatches)[k];
1291
- if (!isArray(v) || !isArray(appendValue)) throw TypeError("Trying to append non-arrays");
1292
- ret[k] = v.concat(appendValue);
1293
- break;
1294
- case types_1.CustomizeRule.Merge:
1295
- if (!bMatches.length) {
1296
- ret[k] = v;
1297
- break;
1298
- }
1299
- var lastValue = last(bMatches)[k];
1300
- if (!(0, utils_1.isPlainObject)(v) || !(0, utils_1.isPlainObject)(lastValue)) throw TypeError("Trying to merge non-objects");
1301
- ret[k] = merge(v, lastValue);
1302
- break;
1303
- case types_1.CustomizeRule.Prepend:
1304
- if (!bMatches.length) {
1305
- ret[k] = v;
1306
- break;
1307
- }
1308
- var prependValue = last(bMatches)[k];
1309
- if (!isArray(v) || !isArray(prependValue)) throw TypeError("Trying to prepend non-arrays");
1310
- ret[k] = prependValue.concat(v);
1311
- break;
1312
- case types_1.CustomizeRule.Replace:
1313
- ret[k] = bMatches.length > 0 ? last(bMatches)[k] : v;
1314
- break;
1315
- default:
1316
- var currentRule_1 = operations[k], b_1 = bMatches.map(function(o) {
1317
- return o[k];
1318
- }).reduce(function(acc, val) {
1319
- return isArray(acc) && isArray(val) ? __spreadArray(__spreadArray([], __read(acc), !1), __read(val), !1) : acc;
1320
- }, []);
1321
- ret[k] = mergeWithRule({
1322
- currentRule: currentRule_1,
1323
- a: v,
1324
- b: b_1
1325
- });
1326
- }
1327
- }), ret) : ao;
1328
- }).concat(b.filter(function(o) {
1329
- return !bAllMatches.includes(o);
1330
- }));
1331
- }
1332
- function mergeIndividualRule(_a) {
1333
- var currentRule = _a.currentRule, a = _a.a, b = _a.b;
1334
- switch(currentRule){
1335
- case types_1.CustomizeRule.Append:
1336
- return a.concat(b);
1337
- case types_1.CustomizeRule.Prepend:
1338
- return b.concat(a);
1339
- case types_1.CustomizeRule.Replace:
1340
- return b;
1341
- }
1342
- return a;
1343
- }
1344
- function last(arr) {
1345
- return arr[arr.length - 1];
1346
- }
1347
- exports1.customizeObject = function customizeObject(rules) {
1348
- return function(a, b, key) {
1349
- switch(rules[key]){
1350
- case types_1.CustomizeRule.Prepend:
1351
- return (0, merge_with_1.default)([
1352
- b,
1353
- a
1354
- ], (0, join_arrays_1.default)());
1355
- case types_1.CustomizeRule.Replace:
1356
- return b;
1357
- case types_1.CustomizeRule.Append:
1358
- return (0, merge_with_1.default)([
1359
- a,
1360
- b
1361
- ], (0, join_arrays_1.default)());
1362
- }
1363
- };
1364
- };
1365
- },
1366
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/join-arrays.js": function(__unused_webpack_module, exports1, __webpack_require__) {
1367
- "use strict";
1368
- var __read = this && this.__read || function(o, n) {
1369
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1370
- if (!m) return o;
1371
- var r, e, i = m.call(o), ar = [];
1372
- try {
1373
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1374
- } catch (error) {
1375
- e = {
1376
- error: error
1377
- };
1378
- } finally{
1379
- try {
1380
- r && !r.done && (m = i.return) && m.call(i);
1381
- } finally{
1382
- if (e) throw e.error;
1383
- }
1384
- }
1385
- return ar;
1386
- }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
1387
- 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]);
1388
- return to.concat(ar || Array.prototype.slice.call(from));
1389
- }, __importDefault = this && this.__importDefault || function(mod) {
1390
- return mod && mod.__esModule ? mod : {
1391
- default: mod
1392
- };
1393
- };
1394
- Object.defineProperty(exports1, "__esModule", {
1395
- value: !0
1396
- });
1397
- 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;
1398
- function joinArrays(_a) {
1399
- var _b = void 0 === _a ? {} : _a, customizeArray = _b.customizeArray, customizeObject = _b.customizeObject, key = _b.key;
1400
- return function _joinArrays(a, b, k) {
1401
- var newKey = key ? "".concat(key, ".").concat(k) : k;
1402
- if ((0, utils_1.isFunction)(a) && (0, utils_1.isFunction)(b)) return function() {
1403
- for(var args = [], _i = 0; _i < arguments.length; _i++)args[_i] = arguments[_i];
1404
- return _joinArrays(a.apply(void 0, __spreadArray([], __read(args), !1)), b.apply(void 0, __spreadArray([], __read(args), !1)), k);
1405
- };
1406
- if (isArray(a) && isArray(b)) {
1407
- var customResult = customizeArray && customizeArray(a, b, newKey);
1408
- return customResult || __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
1409
- }
1410
- if ((0, utils_1.isRegex)(b)) return b;
1411
- if ((0, utils_1.isPlainObject)(a) && (0, utils_1.isPlainObject)(b)) {
1412
- var customResult = customizeObject && customizeObject(a, b, newKey);
1413
- return customResult || (0, merge_with_1.default)([
1414
- a,
1415
- b
1416
- ], joinArrays({
1417
- customizeArray: customizeArray,
1418
- customizeObject: customizeObject,
1419
- key: newKey
1420
- }));
1421
- }
1422
- return (0, utils_1.isPlainObject)(b) ? (0, clone_deep_1.default)(b) : isArray(b) ? __spreadArray([], __read(b), !1) : b;
1423
- };
1424
- }
1425
- exports1.default = joinArrays;
1426
- },
1427
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js": function(__unused_webpack_module, exports1) {
1428
- "use strict";
1429
- var __read = this && this.__read || function(o, n) {
1430
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1431
- if (!m) return o;
1432
- var r, e, i = m.call(o), ar = [];
1433
- try {
1434
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1435
- } catch (error) {
1436
- e = {
1437
- error: error
1438
- };
1439
- } finally{
1440
- try {
1441
- r && !r.done && (m = i.return) && m.call(i);
1442
- } finally{
1443
- if (e) throw e.error;
1444
- }
1445
- }
1446
- return ar;
1447
- };
1448
- function mergeTo(a, b, customizer) {
1449
- var ret = {};
1450
- return Object.keys(a).concat(Object.keys(b)).forEach(function(k) {
1451
- var v = customizer(a[k], b[k], k);
1452
- ret[k] = void 0 === v ? a[k] : v;
1453
- }), ret;
1454
- }
1455
- Object.defineProperty(exports1, "__esModule", {
1456
- value: !0
1457
- }), exports1.default = function mergeWith(objects, customizer) {
1458
- var _a = __read(objects), first = _a[0], rest = _a.slice(1), ret = first;
1459
- return rest.forEach(function(a) {
1460
- ret = mergeTo(ret, a, customizer);
1461
- }), ret;
1462
- };
1463
- },
1464
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js": function(__unused_webpack_module, exports1) {
1465
- "use strict";
1466
- var CustomizeRule, CustomizeRule1;
1467
- Object.defineProperty(exports1, "__esModule", {
1468
- value: !0
1469
- }), exports1.CustomizeRule = void 0, (CustomizeRule1 = CustomizeRule || (exports1.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, exports1) {
1472
- "use strict";
1473
- var __read = this && this.__read || function(o, n) {
1474
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1475
- if (!m) return o;
1476
- var r, e, i = m.call(o), ar = [];
1477
- try {
1478
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1479
- } catch (error) {
1480
- e = {
1481
- error: error
1482
- };
1483
- } finally{
1484
- try {
1485
- r && !r.done && (m = i.return) && m.call(i);
1486
- } finally{
1487
- if (e) throw e.error;
1488
- }
1489
- }
1490
- return ar;
1491
- }, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
1492
- 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]);
1493
- return to.concat(ar || Array.prototype.slice.call(from));
1494
- };
1495
- Object.defineProperty(exports1, "__esModule", {
1496
- value: !0
1497
- }), exports1.default = function mergeUnique(key, uniques, getter) {
1498
- var uniquesSet = new Set(uniques);
1499
- return function(a, b, k) {
1500
- return k === key && Array.from(__spreadArray(__spreadArray([], __read(a), !1), __read(b), !1).map(function(it) {
1501
- return {
1502
- key: getter(it),
1503
- value: it
1504
- };
1505
- }).map(function(_a) {
1506
- var key = _a.key, value = _a.value;
1507
- return {
1508
- key: uniquesSet.has(key) ? key : value,
1509
- value: value
1510
- };
1511
- }).reduce(function(m, _a) {
1512
- var key = _a.key, value = _a.value;
1513
- return m.delete(key), m.set(key, value);
1514
- }, new Map()).values());
1515
- };
1516
- };
1517
- },
1518
- "../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js": function(__unused_webpack_module, exports1, __webpack_require__) {
1519
- "use strict";
1520
- var __read = this && this.__read || function(o, n) {
1521
- var m = "function" == typeof Symbol && o[Symbol.iterator];
1522
- if (!m) return o;
1523
- var r, e, i = m.call(o), ar = [];
1524
- try {
1525
- for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
1526
- } catch (error) {
1527
- e = {
1528
- error: error
1529
- };
1530
- } finally{
1531
- try {
1532
- r && !r.done && (m = i.return) && m.call(i);
1533
- } finally{
1534
- if (e) throw e.error;
1535
- }
1536
- }
1537
- return ar;
1538
- };
1539
- Object.defineProperty(exports1, "__esModule", {
1540
- value: !0
1541
- }), exports1.isSameCondition = exports1.isUndefined = exports1.isPlainObject = exports1.isFunction = exports1.isRegex = void 0;
1542
- var flat_1 = __webpack_require__("../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js");
1543
- function isRegex(o) {
1544
- return o instanceof RegExp;
1545
- }
1546
- function isFunction(functionToCheck) {
1547
- return functionToCheck && "[object Function]" === ({}).toString.call(functionToCheck);
1548
- }
1549
- exports1.isRegex = isRegex, exports1.isFunction = isFunction, exports1.isPlainObject = function isPlainObject(a) {
1550
- return !(null === a || Array.isArray(a)) && "object" == typeof a;
1551
- }, exports1.isUndefined = function isUndefined(a) {
1552
- return void 0 === a;
1553
- }, exports1.isSameCondition = function isSameCondition(a, b) {
1554
- if (!a || !b) return a === b;
1555
- if ("string" == typeof a || "string" == typeof b || isRegex(a) || isRegex(b) || isFunction(a) || isFunction(b)) return a.toString() === b.toString();
1556
- var _a, _b, entriesA = Object.entries((0, flat_1.flatten)(a)), entriesB = Object.entries((0, flat_1.flatten)(b));
1557
- if (entriesA.length !== entriesB.length) return !1;
1558
- 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, "[]");
1559
- function cmp(_a, _b) {
1560
- var _c = __read(_a, 2), k1 = _c[0], v1 = _c[1], _d = __read(_b, 2), k2 = _d[0], v2 = _d[1];
1561
- return k1 < k2 ? -1 : k1 > k2 ? 1 : v1 < v2 ? -1 : +(v1 > v2);
1562
- }
1563
- if (entriesA.sort(cmp), entriesB.sort(cmp), entriesA.length !== entriesB.length) return !1;
1564
- 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;
1565
- return !0;
1566
- };
1567
- },
1568
- "../../node_modules/.pnpm/wildcard@2.0.1/node_modules/wildcard/index.js": function(module) {
1569
- "use strict";
1570
- var REGEXP_PARTS = /(\*|\?)/g;
1571
- function WildcardMatcher(text, separator) {
1572
- this.text = text = text || '', this.hasWild = text.indexOf('*') >= 0, this.separator = separator, this.parts = text.split(separator).map(this.classifyPart.bind(this));
1573
- }
1574
- WildcardMatcher.prototype.match = function(input) {
1575
- var ii, testParts, matches = !0, parts = this.parts, partsCount = parts.length;
1576
- if ('string' == typeof input || input instanceof String) if (this.hasWild || this.text == input) {
1577
- for(ii = 0, testParts = (input || '').split(this.separator); matches && ii < partsCount; ii++)if ('*' === parts[ii]) continue;
1578
- else matches = ii < testParts.length && (parts[ii] instanceof RegExp ? parts[ii].test(testParts[ii]) : parts[ii] === testParts[ii]);
1579
- matches = matches && testParts;
1580
- } else matches = !1;
1581
- else if ('function' == typeof input.splice) for(matches = [], ii = input.length; ii--;)this.match(input[ii]) && (matches[matches.length] = input[ii]);
1582
- else if ('object' == typeof input) for(var key in matches = {}, input)this.match(key) && (matches[key] = input[key]);
1583
- return matches;
1584
- }, WildcardMatcher.prototype.classifyPart = function(part) {
1585
- if ('*' === part) ;
1586
- else if (part.indexOf('*') >= 0 || part.indexOf('?') >= 0) return new RegExp(part.replace(REGEXP_PARTS, '\.$1'));
1587
- return part;
1588
- }, module.exports = function(text, test, separator) {
1589
- var matcher = new WildcardMatcher(text, separator || /[\/\.]/);
1590
- return void 0 !== test ? matcher.match(test) : matcher;
1591
- };
1592
- },
1593
904
  async_hooks: function(module) {
1594
905
  "use strict";
1595
906
  module.exports = require("async_hooks");
@@ -1657,7 +968,7 @@ function __webpack_require__(moduleId) {
1657
968
  var module = __webpack_module_cache__[moduleId] = {
1658
969
  exports: {}
1659
970
  };
1660
- return __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__), module.exports;
971
+ return __webpack_modules__[moduleId](module, module.exports, __webpack_require__), module.exports;
1661
972
  }
1662
973
  __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
1663
974
  var getter = module && module.__esModule ? ()=>module.default : ()=>module;
@@ -1748,7 +1059,7 @@ for(var __webpack_i__ in (()=>{
1748
1059
  var external_node_module_ = __webpack_require__("node:module");
1749
1060
  let rspack_rspack = (0, external_node_module_.createRequire)(__rslib_import_meta_url__)('@rspack/core');
1750
1061
  var external_node_path_ = __webpack_require__("node:path"), external_node_path_default = __webpack_require__.n(external_node_path_), external_node_url_ = __webpack_require__("node:url");
1751
- let constants_filename = (0, external_node_url_.fileURLToPath)(__rslib_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 = [
1062
+ let constants_filename = (0, external_node_url_.fileURLToPath)(__rslib_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 = [
1752
1063
  'chrome >= 87',
1753
1064
  'edge >= 88',
1754
1065
  'firefox >= 78',
@@ -3542,7 +2853,7 @@ ${section.body}` : section.body).join("\n\n"));
3542
2853
  'resolve.conditionNames',
3543
2854
  'resolve.mainFields',
3544
2855
  'provider'
3545
- ]), merge = (x, y, path = '')=>{
2856
+ ]), mergeConfig_merge = (x, y, path = '')=>{
3546
2857
  if (((key)=>{
3547
2858
  if (key.startsWith('environments.')) {
3548
2859
  let realKey = key.split('.').slice(2).join('.');
@@ -3575,7 +2886,7 @@ ${section.body}` : section.body).join("\n\n"));
3575
2886
  ...Object.keys(y)
3576
2887
  ])){
3577
2888
  let childPath = path ? `${path}.${key}` : key;
3578
- merged[key] = merge(x[key], y[key], childPath);
2889
+ merged[key] = mergeConfig_merge(x[key], y[key], childPath);
3579
2890
  }
3580
2891
  return merged;
3581
2892
  }, normalizeConfigStructure = (config)=>{
@@ -3595,7 +2906,7 @@ ${section.body}` : section.body).join("\n\n"));
3595
2906
  ]), normalizedConfig.dev = dev), normalizedConfig;
3596
2907
  }, mergeRsbuildConfig = (...originalConfigs)=>{
3597
2908
  let configs = originalConfigs.filter((config)=>void 0 !== config).map(normalizeConfigStructure);
3598
- return 2 === configs.length ? merge(configs[0], configs[1]) : 1 === configs.length ? configs[0] : 0 === configs.length ? {} : configs.reduce((result, config)=>merge(result, config), {});
2909
+ 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), {});
3599
2910
  }, defaultConfig_require = (0, external_node_module_.createRequire)(__rslib_import_meta_url__), defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/, createDefaultConfig = ()=>({
3600
2911
  dev: {
3601
2912
  hmr: !0,
@@ -4230,7 +3541,7 @@ ${section.body}` : section.body).join("\n\n"));
4230
3541
  async function createContext(options, userConfig) {
4231
3542
  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';
4232
3543
  return {
4233
- version: "1.6.10",
3544
+ version: "1.6.11",
4234
3545
  rootPath,
4235
3546
  distPath: '',
4236
3547
  cachePath,
@@ -4395,7 +3706,6 @@ ${section.body}` : section.body).join("\n\n"));
4395
3706
  mergeFn
4396
3707
  }), initial) : config ?? initial;
4397
3708
  }
4398
- var webpack_merge_dist = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
4399
3709
  async function modifyBundlerChain(context, utils) {
4400
3710
  logger.debug('applying modifyBundlerChain hook');
4401
3711
  let bundlerChain = new src_class(), [modifiedBundlerChain] = await context.hooks.modifyBundlerChain.callChain({
@@ -4520,7 +3830,10 @@ ${section.body}` : section.body).join("\n\n"));
4520
3830
  function getConfigUtils(getCurrentConfig, chainUtils) {
4521
3831
  return {
4522
3832
  ...chainUtils,
4523
- mergeConfig: webpack_merge_dist.merge,
3833
+ mergeConfig: (...args)=>{
3834
+ let { merge } = requireCompiledPackage('webpack-merge');
3835
+ return merge(...args);
3836
+ },
4524
3837
  addRules (rules) {
4525
3838
  let config = getCurrentConfig(), ruleArr = helpers_castArray(rules);
4526
3839
  config.module || (config.module = {}), config.module.rules || (config.module.rules = []), config.module.rules.unshift(...ruleArr);
@@ -6556,8 +5869,8 @@ ${section.body}` : section.body).join("\n\n"));
6556
5869
  ...config.dev.client
6557
5870
  };
6558
5871
  '<port>' === clientConfig.port && (clientConfig.port = resolvedPort);
6559
- let hmrEntry = `import { init } from '@rsbuild/core/client/hmr';
6560
- ${config.dev.client.overlay ? "import '@rsbuild/core/client/overlay';" : ''}
5872
+ let hmrEntry = `import { init } from '${toPosixPath((0, external_node_path_.join)(CLIENT_PATH, 'hmr'))}';
5873
+ ${config.dev.client.overlay ? `import '${toPosixPath((0, external_node_path_.join)(CLIENT_PATH, 'overlay'))}';` : ''}
6561
5874
 
6562
5875
  init({
6563
5876
  token: '${token}',
@@ -6590,27 +5903,34 @@ init({
6590
5903
  let { target } = compiler.options;
6591
5904
  return !!target && (Array.isArray(target) ? target.includes('node') : 'node' === target);
6592
5905
  })(compiler)) return;
6593
- let errorsCount = null;
5906
+ let errorsCount = null, warningsCount = null;
6594
5907
  compiler.hooks.invalid.tap('rsbuild-dev-server', (fileName)=>{
6595
- errorsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && socketServer.sockWrite({
5908
+ errorsCount = null, warningsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && socketServer.sockWrite({
6596
5909
  type: 'static-changed'
6597
5910
  }, token);
6598
5911
  }), compiler.hooks.done.tap('rsbuild-dev-server', (stats)=>{
6599
- let { errors } = stats.compilation;
6600
- if (errors.length === errorsCount) return;
6601
- let isRecalled = null !== errorsCount;
6602
- if (errorsCount = errors.length, isRecalled) {
6603
- let tsErrors = errors.filter(isTsError);
6604
- if (!tsErrors.length) return;
6605
- let { stats: statsJson } = context.buildState, statsErrors = tsErrors.map((item)=>pick(item, [
6606
- 'message',
6607
- 'file'
6608
- ]));
6609
- statsJson && (statsJson.errors = statsJson.errors ? [
6610
- ...statsJson.errors,
6611
- ...statsErrors
6612
- ] : statsErrors), socketServer.sendError(statsErrors, token);
6613
- return;
5912
+ let { errors, warnings } = stats.compilation;
5913
+ if (errors.length === errorsCount && warnings.length === warningsCount) return;
5914
+ let isRecalled = null !== errorsCount || null !== warningsCount;
5915
+ if (errorsCount = errors.length, warningsCount = warnings.length, isRecalled) {
5916
+ let tsErrors = errors.filter(isTsError), tsWarnings = warnings.filter(isTsError);
5917
+ if (!tsErrors.length && !tsWarnings.length) return;
5918
+ let { stats: statsJson } = context.buildState, handleTsIssues = (issues, type, sendFn)=>{
5919
+ let statsIssues = issues.map((item)=>pick(item, [
5920
+ 'message',
5921
+ 'file'
5922
+ ]));
5923
+ statsJson && (statsJson[type] = statsJson[type] ? [
5924
+ ...statsJson[type],
5925
+ ...statsIssues
5926
+ ] : statsIssues), sendFn(statsIssues, token);
5927
+ };
5928
+ if (tsErrors.length > 0) return void handleTsIssues(tsErrors, 'errors', (issues, token)=>{
5929
+ socketServer.sendError(issues, token);
5930
+ });
5931
+ if (tsWarnings.length > 0) return void handleTsIssues(tsWarnings, 'warnings', (issues, token)=>{
5932
+ socketServer.sendWarning(issues, token);
5933
+ });
6614
5934
  }
6615
5935
  });
6616
5936
  })({
@@ -7054,6 +6374,15 @@ init({
7054
6374
  }
7055
6375
  }, token);
7056
6376
  }
6377
+ sendWarning(warnings, token) {
6378
+ let formattedWarnings = warnings.map((item)=>formatStatsError(item));
6379
+ this.sockWrite({
6380
+ type: 'warnings',
6381
+ data: {
6382
+ text: formattedWarnings
6383
+ }
6384
+ }, token);
6385
+ }
7057
6386
  sockWrite(message, token) {
7058
6387
  let messageStr = JSON.stringify(message), sendToSockets = (sockets)=>{
7059
6388
  for (let socket of sockets)this.send(socket, messageStr);
@@ -7131,18 +6460,7 @@ init({
7131
6460
  data: stats.hash
7132
6461
  }, token);
7133
6462
  }
7134
- if (errors.length > 0) return void this.sendError(errors, token);
7135
- if (warnings.length > 0) {
7136
- let warningMessages = warnings.map((item)=>formatStatsError(item));
7137
- this.sockWrite({
7138
- type: 'warnings',
7139
- data: {
7140
- text: warningMessages
7141
- }
7142
- }, token);
7143
- return;
7144
- }
7145
- this.sockWrite({
6463
+ errors.length > 0 ? this.sendError(errors, token) : warnings.length > 0 ? this.sendWarning(warnings, token) : this.sockWrite({
7146
6464
  type: 'ok'
7147
6465
  }, token);
7148
6466
  }
@@ -7246,35 +6564,34 @@ init({
7246
6564
  };
7247
6565
  }
7248
6566
  let ENCODING_REGEX = /\bgzip\b/, CONTENT_TYPE_REGEX = /text|javascript|\/json|xml/i, gzipMiddleware_gzipMiddleware = ({ filter, level = external_node_zlib_default().constants.Z_BEST_SPEED } = {})=>function gzipMiddleware(req, res, next) {
7249
- let gzip, writeHeadStatus;
6567
+ let gzip, writeHeadStatus, writeHeadMessage;
7250
6568
  if (filter && !filter(req, res)) return void next();
7251
6569
  let accept = req.headers['accept-encoding'], encoding = 'string' == typeof accept && ENCODING_REGEX.test(accept);
7252
6570
  if ('HEAD' === req.method || !encoding) return void next();
7253
6571
  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 = ()=>{
7254
- if (!started) {
7255
- if (started = !0, ((res)=>{
7256
- if (res.getHeader('Content-Encoding')) return !1;
7257
- let contentType = String(res.getHeader('Content-Type'));
7258
- if (contentType && !CONTENT_TYPE_REGEX.test(contentType)) return !1;
7259
- let size = res.getHeader('Content-Length');
7260
- return void 0 === size || Number(size) > 1024;
7261
- })(res)) for (let listener of (res.setHeader('Content-Encoding', 'gzip'), res.removeHeader('Content-Length'), (gzip = external_node_zlib_default().createGzip({
7262
- level
7263
- })).on('data', (chunk)=>{
7264
- write(chunk) || gzip.pause();
7265
- }), on('drain', ()=>gzip.resume()), gzip.on('end', ()=>{
7266
- end();
7267
- }), listeners))gzip.on.apply(gzip, listener);
7268
- else for (let listener of listeners)on.apply(res, listener);
7269
- writeHead(writeHeadStatus ?? res.statusCode);
7270
- }
6572
+ if (started) return;
6573
+ if (started = !0, ((res)=>{
6574
+ if (res.getHeader('Content-Encoding')) return !1;
6575
+ let contentType = String(res.getHeader('Content-Type'));
6576
+ if (contentType && !CONTENT_TYPE_REGEX.test(contentType)) return !1;
6577
+ let size = res.getHeader('Content-Length');
6578
+ return void 0 === size || Number(size) > 1024;
6579
+ })(res)) for (let listener of (res.setHeader('Content-Encoding', 'gzip'), res.removeHeader('Content-Length'), (gzip = external_node_zlib_default().createGzip({
6580
+ level
6581
+ })).on('data', (chunk)=>{
6582
+ write(chunk) || gzip.pause();
6583
+ }), on('drain', ()=>gzip.resume()), gzip.on('end', ()=>{
6584
+ end();
6585
+ }), listeners))gzip.on.apply(gzip, listener);
6586
+ else for (let listener of listeners)on.apply(res, listener);
6587
+ let statusCode = writeHeadStatus ?? res.statusCode;
6588
+ void 0 !== writeHeadMessage ? writeHead(statusCode, writeHeadMessage) : writeHead(statusCode);
7271
6589
  };
7272
6590
  res.writeHead = (status, reason, headers)=>{
7273
- if ('string' == typeof reason) {
7274
- if (headers) for (let [key, value] of Object.entries(headers))res.setHeader(key, value);
7275
- res.statusMessage = reason;
7276
- } else if (reason) for (let [key, value] of Object.entries(reason))void 0 !== value && res.setHeader(key, value);
7277
- return writeHeadStatus = status, res;
6591
+ writeHeadStatus = status, 'string' == typeof reason && (writeHeadMessage = reason);
6592
+ let resolvedHeaders = 'string' == typeof reason ? headers : reason;
6593
+ if (resolvedHeaders) for (let [key, value] of Object.entries(resolvedHeaders))res.setHeader(key, value);
6594
+ return res;
7278
6595
  }, 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([
7279
6596
  type,
7280
6597
  listener
@@ -9865,7 +9182,7 @@ try {
9865
9182
  };
9866
9183
  function setupCommands() {
9867
9184
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9868
- 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)', {
9185
+ cli.version("1.6.11"), 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)', {
9869
9186
  default: 'auto'
9870
9187
  }).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', {
9871
9188
  type: [
@@ -9934,7 +9251,7 @@ try {
9934
9251
  }
9935
9252
  function showGreeting() {
9936
9253
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9937
- logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.10\n`);
9254
+ logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.11\n`);
9938
9255
  }
9939
9256
  function setupLogLevel() {
9940
9257
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9955,7 +9272,7 @@ try {
9955
9272
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
9956
9273
  }
9957
9274
  }
9958
- let src_version = "1.6.10";
9275
+ let src_version = "1.6.11";
9959
9276
  })(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defaultAllowedOrigins = __webpack_exports__.defaultAllowedOrigins, exports.defineConfig = __webpack_exports__.defineConfig, exports.ensureAssetPrefix = __webpack_exports__.ensureAssetPrefix, exports.loadConfig = __webpack_exports__.loadConfig, exports.loadEnv = __webpack_exports__.loadEnv, exports.logger = __webpack_exports__.logger, exports.mergeRsbuildConfig = __webpack_exports__.mergeRsbuildConfig, exports.rspack = __webpack_exports__.rspack, exports.runCLI = __webpack_exports__.runCLI, exports.version = __webpack_exports__.version, __webpack_exports__)-1 === [
9960
9277
  "PLUGIN_CSS_NAME",
9961
9278
  "PLUGIN_SWC_NAME",