@rsbuild/core 1.6.9 → 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/compiled/memfs/index.js +123 -121
- package/compiled/memfs/package.json +1 -1
- package/compiled/rslog/index.js +12 -9
- package/compiled/rslog/package.json +1 -1
- package/compiled/webpack-merge/index.d.ts +31 -0
- package/compiled/webpack-merge/index.js +1200 -0
- package/compiled/webpack-merge/license +20 -0
- package/compiled/webpack-merge/package.json +1 -0
- package/dist/0~open.js +1 -1
- package/dist/{506.js → 131.js} +130 -791
- package/dist/131.js.LICENSE.txt +26 -0
- package/dist/136.mjs +42 -0
- package/dist/client/hmr.js +172 -173
- package/dist/index.cjs +106 -780
- package/dist/index.cjs.LICENSE.txt +0 -21
- package/dist/index.js +1 -1
- package/dist/rslib-runtime.js +1 -1
- package/dist/transformLoader.mjs +1 -36
- package/dist/transformRawLoader.mjs +3 -36
- package/dist-types/client/hmr.d.ts +9 -0
- package/dist-types/constants.d.ts +1 -0
- package/dist-types/helpers/vendors.d.ts +1 -0
- package/dist-types/server/assets-middleware/index.d.ts +8 -0
- package/dist-types/server/socketServer.d.ts +4 -0
- package/package.json +4 -4
- package/dist/476.mjs +0 -8
- package/dist/506.js.LICENSE.txt +0 -47
package/dist/{506.js → 131.js}
RENAMED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
/*! For license information please see
|
|
2
|
-
|
|
3
|
-
let
|
|
4
|
-
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
1
|
+
/*! For license information please see 131.js.LICENSE.txt */
|
|
2
|
+
"use strict";
|
|
3
|
+
let swcHelpersPath, pluginHelper_htmlPlugin, cssExtractPlugin;
|
|
4
|
+
let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
5
|
+
import * as __rspack_external_async_hooks from "async_hooks";
|
|
6
|
+
import * as __rspack_external_fs from "fs";
|
|
7
|
+
import * as __rspack_external_node_path_c5b9b54f from "node:path";
|
|
8
|
+
import * as __rspack_external_os from "os";
|
|
9
|
+
import * as __rspack_external_path from "path";
|
|
10
|
+
import * as __rspack_external_url from "url";
|
|
10
11
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
11
12
|
import { EventEmitter } from "events";
|
|
12
13
|
import node_fs, { existsSync } from "node:fs";
|
|
@@ -16,34 +17,6 @@ import { isPromise, isRegExp } from "node:util/types";
|
|
|
16
17
|
import { promisify as external_node_util_promisify } from "node:util";
|
|
17
18
|
import node_zlib from "node:zlib";
|
|
18
19
|
__webpack_require__.add({
|
|
19
|
-
"../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
20
|
-
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");
|
|
21
|
-
function cloneDeep(val, instanceClone) {
|
|
22
|
-
switch(typeOf(val)){
|
|
23
|
-
case 'object':
|
|
24
|
-
return cloneObjectDeep(val, instanceClone);
|
|
25
|
-
case 'array':
|
|
26
|
-
return cloneArrayDeep(val, instanceClone);
|
|
27
|
-
default:
|
|
28
|
-
return clone(val);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function cloneObjectDeep(val, instanceClone) {
|
|
32
|
-
if ('function' == typeof instanceClone) return instanceClone(val);
|
|
33
|
-
if (instanceClone || isPlainObject(val)) {
|
|
34
|
-
let res = new val.constructor();
|
|
35
|
-
for(let key in val)res[key] = cloneDeep(val[key], instanceClone);
|
|
36
|
-
return res;
|
|
37
|
-
}
|
|
38
|
-
return val;
|
|
39
|
-
}
|
|
40
|
-
function cloneArrayDeep(val, instanceClone) {
|
|
41
|
-
let res = new val.constructor(val.length);
|
|
42
|
-
for(let i = 0; i < val.length; i++)res[i] = cloneDeep(val[i], instanceClone);
|
|
43
|
-
return res;
|
|
44
|
-
}
|
|
45
|
-
module.exports = cloneDeep;
|
|
46
|
-
},
|
|
47
20
|
"../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js": function(module) {
|
|
48
21
|
var isMergeableObject = function isMergeableObject(value) {
|
|
49
22
|
return isNonNullObject(value) && !isSpecial(value);
|
|
@@ -178,71 +151,6 @@ __webpack_require__.add({
|
|
|
178
151
|
return thunk.cancel = cleanup, thunk;
|
|
179
152
|
};
|
|
180
153
|
},
|
|
181
|
-
"../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js": function(module) {
|
|
182
|
-
function isBuffer(obj) {
|
|
183
|
-
return obj && obj.constructor && 'function' == typeof obj.constructor.isBuffer && obj.constructor.isBuffer(obj);
|
|
184
|
-
}
|
|
185
|
-
function keyIdentity(key) {
|
|
186
|
-
return key;
|
|
187
|
-
}
|
|
188
|
-
function flatten(target, opts) {
|
|
189
|
-
let delimiter = (opts = opts || {}).delimiter || '.', maxDepth = opts.maxDepth, transformKey = opts.transformKey || keyIdentity, output = {};
|
|
190
|
-
function step(object, prev, currentDepth) {
|
|
191
|
-
currentDepth = currentDepth || 1, Object.keys(object).forEach(function(key) {
|
|
192
|
-
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);
|
|
193
|
-
if (!isarray && !isbuffer && ('[object Object]' === type || '[object Array]' === type) && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) return step(value, newKey, currentDepth + 1);
|
|
194
|
-
output[newKey] = value;
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
return step(target), output;
|
|
198
|
-
}
|
|
199
|
-
function unflatten(target, opts) {
|
|
200
|
-
let delimiter = (opts = opts || {}).delimiter || '.', overwrite = opts.overwrite || !1, transformKey = opts.transformKey || keyIdentity, result = {};
|
|
201
|
-
if (isBuffer(target) || '[object Object]' !== Object.prototype.toString.call(target)) return target;
|
|
202
|
-
function getkey(key) {
|
|
203
|
-
let parsedKey = Number(key);
|
|
204
|
-
return isNaN(parsedKey) || -1 !== key.indexOf('.') || opts.object ? key : parsedKey;
|
|
205
|
-
}
|
|
206
|
-
function addKeys(keyPrefix, recipient, target) {
|
|
207
|
-
return Object.keys(target).reduce(function(result, key) {
|
|
208
|
-
return result[keyPrefix + delimiter + key] = target[key], result;
|
|
209
|
-
}, recipient);
|
|
210
|
-
}
|
|
211
|
-
function isEmpty(val) {
|
|
212
|
-
let type = Object.prototype.toString.call(val);
|
|
213
|
-
return !val || ('[object Array]' === type ? !val.length : '[object Object]' === type ? !Object.keys(val).length : void 0);
|
|
214
|
-
}
|
|
215
|
-
return Object.keys(target = Object.keys(target).reduce(function(result, key) {
|
|
216
|
-
let type = Object.prototype.toString.call(target[key]);
|
|
217
|
-
return '[object Object]' !== type && '[object Array]' !== type || isEmpty(target[key]) ? (result[key] = target[key], result) : addKeys(key, result, flatten(target[key], opts));
|
|
218
|
-
}, {})).forEach(function(key) {
|
|
219
|
-
let split = key.split(delimiter).map(transformKey), key1 = getkey(split.shift()), key2 = getkey(split[0]), recipient = result;
|
|
220
|
-
for(; void 0 !== key2;){
|
|
221
|
-
if ('__proto__' === key1) return;
|
|
222
|
-
let type = Object.prototype.toString.call(recipient[key1]), isobject = '[object Object]' === type || '[object Array]' === type;
|
|
223
|
-
if (!overwrite && !isobject && void 0 !== recipient[key1]) return;
|
|
224
|
-
(!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]));
|
|
225
|
-
}
|
|
226
|
-
recipient[key1] = unflatten(target[key], opts);
|
|
227
|
-
}), result;
|
|
228
|
-
}
|
|
229
|
-
module.exports = flatten, flatten.flatten = flatten, flatten.unflatten = unflatten;
|
|
230
|
-
},
|
|
231
|
-
"../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
232
|
-
var isObject = __webpack_require__("../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js");
|
|
233
|
-
function isObjectObject(o) {
|
|
234
|
-
return !0 === isObject(o) && '[object Object]' === Object.prototype.toString.call(o);
|
|
235
|
-
}
|
|
236
|
-
module.exports = function isPlainObject(o) {
|
|
237
|
-
var ctor, prot;
|
|
238
|
-
return !1 !== isObjectObject(o) && 'function' == typeof (ctor = o.constructor) && !1 !== isObjectObject(prot = ctor.prototype) && !1 !== prot.hasOwnProperty('isPrototypeOf');
|
|
239
|
-
};
|
|
240
|
-
},
|
|
241
|
-
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js": function(module) {
|
|
242
|
-
module.exports = function isObject(val) {
|
|
243
|
-
return null != val && 'object' == typeof val && !1 === Array.isArray(val);
|
|
244
|
-
};
|
|
245
|
-
},
|
|
246
154
|
"../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js": function(__unused_webpack_module, exports) {
|
|
247
155
|
Object.defineProperty(exports, "__esModule", {
|
|
248
156
|
value: !0
|
|
@@ -537,103 +445,6 @@ __webpack_require__.add({
|
|
|
537
445
|
};
|
|
538
446
|
exports.toString = (value, space, next, key)=>null === value ? "null" : PRIMITIVE_TYPES[typeof value](value, space, next, key);
|
|
539
447
|
},
|
|
540
|
-
"../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js": function(module) {
|
|
541
|
-
var toString = Object.prototype.toString;
|
|
542
|
-
function ctorName(val) {
|
|
543
|
-
return 'function' == typeof val.constructor ? val.constructor.name : null;
|
|
544
|
-
}
|
|
545
|
-
function isArray(val) {
|
|
546
|
-
return Array.isArray ? Array.isArray(val) : val instanceof Array;
|
|
547
|
-
}
|
|
548
|
-
function isError(val) {
|
|
549
|
-
return val instanceof Error || 'string' == typeof val.message && val.constructor && 'number' == typeof val.constructor.stackTraceLimit;
|
|
550
|
-
}
|
|
551
|
-
function isDate(val) {
|
|
552
|
-
return val instanceof Date || 'function' == typeof val.toDateString && 'function' == typeof val.getDate && 'function' == typeof val.setDate;
|
|
553
|
-
}
|
|
554
|
-
function isRegexp(val) {
|
|
555
|
-
return val instanceof RegExp || 'string' == typeof val.flags && 'boolean' == typeof val.ignoreCase && 'boolean' == typeof val.multiline && 'boolean' == typeof val.global;
|
|
556
|
-
}
|
|
557
|
-
function isGeneratorFn(name, val) {
|
|
558
|
-
return 'GeneratorFunction' === ctorName(name);
|
|
559
|
-
}
|
|
560
|
-
function isGeneratorObj(val) {
|
|
561
|
-
return 'function' == typeof val.throw && 'function' == typeof val.return && 'function' == typeof val.next;
|
|
562
|
-
}
|
|
563
|
-
function isArguments(val) {
|
|
564
|
-
try {
|
|
565
|
-
if ('number' == typeof val.length && 'function' == typeof val.callee) return !0;
|
|
566
|
-
} catch (err) {
|
|
567
|
-
if (-1 !== err.message.indexOf('callee')) return !0;
|
|
568
|
-
}
|
|
569
|
-
return !1;
|
|
570
|
-
}
|
|
571
|
-
function isBuffer(val) {
|
|
572
|
-
return !!val.constructor && 'function' == typeof val.constructor.isBuffer && val.constructor.isBuffer(val);
|
|
573
|
-
}
|
|
574
|
-
module.exports = function kindOf(val) {
|
|
575
|
-
if (void 0 === val) return 'undefined';
|
|
576
|
-
if (null === val) return 'null';
|
|
577
|
-
var type = typeof val;
|
|
578
|
-
if ('boolean' === type) return 'boolean';
|
|
579
|
-
if ('string' === type) return 'string';
|
|
580
|
-
if ('number' === type) return 'number';
|
|
581
|
-
if ('symbol' === type) return 'symbol';
|
|
582
|
-
if ('function' === type) return isGeneratorFn(val) ? 'generatorfunction' : 'function';
|
|
583
|
-
if (isArray(val)) return 'array';
|
|
584
|
-
if (isBuffer(val)) return 'buffer';
|
|
585
|
-
if (isArguments(val)) return 'arguments';
|
|
586
|
-
if (isDate(val)) return 'date';
|
|
587
|
-
if (isError(val)) return 'error';
|
|
588
|
-
if (isRegexp(val)) return 'regexp';
|
|
589
|
-
switch(ctorName(val)){
|
|
590
|
-
case 'Symbol':
|
|
591
|
-
return 'symbol';
|
|
592
|
-
case 'Promise':
|
|
593
|
-
return 'promise';
|
|
594
|
-
case 'WeakMap':
|
|
595
|
-
return 'weakmap';
|
|
596
|
-
case 'WeakSet':
|
|
597
|
-
return 'weakset';
|
|
598
|
-
case 'Map':
|
|
599
|
-
return 'map';
|
|
600
|
-
case 'Set':
|
|
601
|
-
return 'set';
|
|
602
|
-
case 'Int8Array':
|
|
603
|
-
return 'int8array';
|
|
604
|
-
case 'Uint8Array':
|
|
605
|
-
return 'uint8array';
|
|
606
|
-
case 'Uint8ClampedArray':
|
|
607
|
-
return 'uint8clampedarray';
|
|
608
|
-
case 'Int16Array':
|
|
609
|
-
return 'int16array';
|
|
610
|
-
case 'Uint16Array':
|
|
611
|
-
return 'uint16array';
|
|
612
|
-
case 'Int32Array':
|
|
613
|
-
return 'int32array';
|
|
614
|
-
case 'Uint32Array':
|
|
615
|
-
return 'uint32array';
|
|
616
|
-
case 'Float32Array':
|
|
617
|
-
return 'float32array';
|
|
618
|
-
case 'Float64Array':
|
|
619
|
-
return 'float64array';
|
|
620
|
-
}
|
|
621
|
-
if (isGeneratorObj(val)) return 'generator';
|
|
622
|
-
switch(type = toString.call(val)){
|
|
623
|
-
case '[object Object]':
|
|
624
|
-
return 'object';
|
|
625
|
-
case '[object Map Iterator]':
|
|
626
|
-
return 'mapiterator';
|
|
627
|
-
case '[object Set Iterator]':
|
|
628
|
-
return 'setiterator';
|
|
629
|
-
case '[object String Iterator]':
|
|
630
|
-
return 'stringiterator';
|
|
631
|
-
case '[object Array Iterator]':
|
|
632
|
-
return 'arrayiterator';
|
|
633
|
-
}
|
|
634
|
-
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
|
|
635
|
-
};
|
|
636
|
-
},
|
|
637
448
|
"../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
638
449
|
let path = __webpack_require__("path"), fs = __webpack_require__("fs"), os = __webpack_require__("os"), url = __webpack_require__("url"), fsReadFileAsync = fs.promises.readFile;
|
|
639
450
|
function getDefaultSearchPlaces(name, sync) {
|
|
@@ -663,9 +474,9 @@ __webpack_require__.add({
|
|
|
663
474
|
return path.dirname(p) || path.sep;
|
|
664
475
|
}
|
|
665
476
|
let jsonLoader = (_, content)=>JSON.parse(content), defaultLoadersSync = Object.freeze({
|
|
666
|
-
'.js':
|
|
667
|
-
'.json':
|
|
668
|
-
'.cjs':
|
|
477
|
+
'.js': __rspack_createRequire_require,
|
|
478
|
+
'.json': __rspack_createRequire_require,
|
|
479
|
+
'.cjs': __rspack_createRequire_require,
|
|
669
480
|
noExt: jsonLoader
|
|
670
481
|
});
|
|
671
482
|
module.exports.defaultLoadersSync = defaultLoadersSync;
|
|
@@ -675,7 +486,7 @@ __webpack_require__.add({
|
|
|
675
486
|
return (await import(fileUrl)).default;
|
|
676
487
|
} catch (e) {
|
|
677
488
|
try {
|
|
678
|
-
return
|
|
489
|
+
return __rspack_createRequire_require(id);
|
|
679
490
|
} catch (requireE) {
|
|
680
491
|
if ('ERR_REQUIRE_ESM' === requireE.code || requireE instanceof SyntaxError && requireE.toString().includes('Cannot use import statement outside a module')) throw e;
|
|
681
492
|
throw requireE;
|
|
@@ -1098,517 +909,29 @@ __webpack_require__.add({
|
|
|
1098
909
|
throw Error(`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${importError.map((error)=>error.message).join('\n')}`);
|
|
1099
910
|
};
|
|
1100
911
|
},
|
|
1101
|
-
"../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1102
|
-
let valueOf = Symbol.prototype.valueOf, typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js");
|
|
1103
|
-
function cloneRegExp(val) {
|
|
1104
|
-
let flags = void 0 !== val.flags ? val.flags : /\w+$/.exec(val) || void 0, re = new val.constructor(val.source, flags);
|
|
1105
|
-
return re.lastIndex = val.lastIndex, re;
|
|
1106
|
-
}
|
|
1107
|
-
function cloneArrayBuffer(val) {
|
|
1108
|
-
let res = new val.constructor(val.byteLength);
|
|
1109
|
-
return new Uint8Array(res).set(new Uint8Array(val)), res;
|
|
1110
|
-
}
|
|
1111
|
-
function cloneTypedArray(val, deep) {
|
|
1112
|
-
return new val.constructor(val.buffer, val.byteOffset, val.length);
|
|
1113
|
-
}
|
|
1114
|
-
function cloneBuffer(val) {
|
|
1115
|
-
let len = val.length, buf = Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : Buffer.from(len);
|
|
1116
|
-
return val.copy(buf), buf;
|
|
1117
|
-
}
|
|
1118
|
-
function cloneSymbol(val) {
|
|
1119
|
-
return valueOf ? Object(valueOf.call(val)) : {};
|
|
1120
|
-
}
|
|
1121
|
-
module.exports = function clone(val, deep) {
|
|
1122
|
-
switch(typeOf(val)){
|
|
1123
|
-
case 'array':
|
|
1124
|
-
return val.slice();
|
|
1125
|
-
case 'object':
|
|
1126
|
-
return Object.assign({}, val);
|
|
1127
|
-
case 'date':
|
|
1128
|
-
return new val.constructor(Number(val));
|
|
1129
|
-
case 'map':
|
|
1130
|
-
return new Map(val);
|
|
1131
|
-
case 'set':
|
|
1132
|
-
return new Set(val);
|
|
1133
|
-
case 'buffer':
|
|
1134
|
-
return cloneBuffer(val);
|
|
1135
|
-
case 'symbol':
|
|
1136
|
-
return cloneSymbol(val);
|
|
1137
|
-
case 'arraybuffer':
|
|
1138
|
-
return cloneArrayBuffer(val);
|
|
1139
|
-
case 'float32array':
|
|
1140
|
-
case 'float64array':
|
|
1141
|
-
case 'int16array':
|
|
1142
|
-
case 'int32array':
|
|
1143
|
-
case 'int8array':
|
|
1144
|
-
case 'uint16array':
|
|
1145
|
-
case 'uint32array':
|
|
1146
|
-
case 'uint8clampedarray':
|
|
1147
|
-
case 'uint8array':
|
|
1148
|
-
return cloneTypedArray(val);
|
|
1149
|
-
case 'regexp':
|
|
1150
|
-
return cloneRegExp(val);
|
|
1151
|
-
case 'error':
|
|
1152
|
-
return Object.create(val);
|
|
1153
|
-
default:
|
|
1154
|
-
return val;
|
|
1155
|
-
}
|
|
1156
|
-
};
|
|
1157
|
-
},
|
|
1158
|
-
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1159
|
-
var __read = this && this.__read || function(o, n) {
|
|
1160
|
-
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
1161
|
-
if (!m) return o;
|
|
1162
|
-
var r, e, i = m.call(o), ar = [];
|
|
1163
|
-
try {
|
|
1164
|
-
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
1165
|
-
} catch (error) {
|
|
1166
|
-
e = {
|
|
1167
|
-
error: error
|
|
1168
|
-
};
|
|
1169
|
-
} finally{
|
|
1170
|
-
try {
|
|
1171
|
-
r && !r.done && (m = i.return) && m.call(i);
|
|
1172
|
-
} finally{
|
|
1173
|
-
if (e) throw e.error;
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
return ar;
|
|
1177
|
-
}, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
|
|
1178
|
-
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]);
|
|
1179
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1180
|
-
}, __importDefault = this && this.__importDefault || function(mod) {
|
|
1181
|
-
return mod && mod.__esModule ? mod : {
|
|
1182
|
-
default: mod
|
|
1183
|
-
};
|
|
1184
|
-
};
|
|
1185
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1186
|
-
value: !0
|
|
1187
|
-
}), exports.unique = exports.mergeWithRules = exports.mergeWithCustomize = exports.default = exports.merge = exports.CustomizeRule = exports.customizeObject = exports.customizeArray = void 0;
|
|
1188
|
-
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"));
|
|
1189
|
-
exports.unique = __importDefault(__webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js")).default;
|
|
1190
|
-
var types_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/types.js");
|
|
1191
|
-
Object.defineProperty(exports, "CustomizeRule", {
|
|
1192
|
-
enumerable: !0,
|
|
1193
|
-
get: function() {
|
|
1194
|
-
return types_1.CustomizeRule;
|
|
1195
|
-
}
|
|
1196
|
-
});
|
|
1197
|
-
var utils_1 = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js");
|
|
1198
|
-
function merge(firstConfiguration) {
|
|
1199
|
-
for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
|
|
1200
|
-
return mergeWithCustomize({}).apply(void 0, __spreadArray([
|
|
1201
|
-
firstConfiguration
|
|
1202
|
-
], __read(configurations), !1));
|
|
1203
|
-
}
|
|
1204
|
-
function mergeWithCustomize(options) {
|
|
1205
|
-
return function mergeWithOptions(firstConfiguration) {
|
|
1206
|
-
for(var configurations = [], _i = 1; _i < arguments.length; _i++)configurations[_i - 1] = arguments[_i];
|
|
1207
|
-
if ((0, utils_1.isUndefined)(firstConfiguration) || configurations.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
|
|
1208
|
-
if (firstConfiguration.then) throw TypeError("Promises are not supported");
|
|
1209
|
-
if (!firstConfiguration) return {};
|
|
1210
|
-
if (0 === configurations.length) {
|
|
1211
|
-
if (Array.isArray(firstConfiguration)) {
|
|
1212
|
-
if (0 === firstConfiguration.length) return {};
|
|
1213
|
-
if (firstConfiguration.some(utils_1.isUndefined)) throw TypeError("Merging undefined is not supported");
|
|
1214
|
-
if (firstConfiguration[0].then) throw TypeError("Promises are not supported");
|
|
1215
|
-
return (0, merge_with_1.default)(firstConfiguration, (0, join_arrays_1.default)(options));
|
|
1216
|
-
}
|
|
1217
|
-
return firstConfiguration;
|
|
1218
|
-
}
|
|
1219
|
-
return (0, merge_with_1.default)([
|
|
1220
|
-
firstConfiguration
|
|
1221
|
-
].concat(configurations), (0, join_arrays_1.default)(options));
|
|
1222
|
-
};
|
|
1223
|
-
}
|
|
1224
|
-
exports.merge = merge, exports.default = merge, exports.mergeWithCustomize = mergeWithCustomize, exports.customizeArray = function customizeArray(rules) {
|
|
1225
|
-
return function(a, b, key) {
|
|
1226
|
-
var matchedRule = Object.keys(rules).find(function(rule) {
|
|
1227
|
-
return (0, wildcard_1.default)(rule, key);
|
|
1228
|
-
}) || "";
|
|
1229
|
-
if (matchedRule) switch(rules[matchedRule]){
|
|
1230
|
-
case types_1.CustomizeRule.Prepend:
|
|
1231
|
-
return __spreadArray(__spreadArray([], __read(b), !1), __read(a), !1);
|
|
1232
|
-
case types_1.CustomizeRule.Replace:
|
|
1233
|
-
return b;
|
|
1234
|
-
case types_1.CustomizeRule.Append:
|
|
1235
|
-
default:
|
|
1236
|
-
return __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
|
|
1237
|
-
}
|
|
1238
|
-
};
|
|
1239
|
-
}, exports.mergeWithRules = function mergeWithRules(rules) {
|
|
1240
|
-
return mergeWithCustomize({
|
|
1241
|
-
customizeArray: function(a, b, key) {
|
|
1242
|
-
var currentRule = rules;
|
|
1243
|
-
return (key.split(".").forEach(function(k) {
|
|
1244
|
-
currentRule && (currentRule = currentRule[k]);
|
|
1245
|
-
}), (0, utils_1.isPlainObject)(currentRule)) ? mergeWithRule({
|
|
1246
|
-
currentRule: currentRule,
|
|
1247
|
-
a: a,
|
|
1248
|
-
b: b
|
|
1249
|
-
}) : "string" == typeof currentRule ? mergeIndividualRule({
|
|
1250
|
-
currentRule: currentRule,
|
|
1251
|
-
a: a,
|
|
1252
|
-
b: b
|
|
1253
|
-
}) : void 0;
|
|
1254
|
-
}
|
|
1255
|
-
});
|
|
1256
|
-
};
|
|
1257
|
-
var isArray = Array.isArray;
|
|
1258
|
-
function mergeWithRule(_a) {
|
|
1259
|
-
var currentRule = _a.currentRule, a = _a.a, b = _a.b;
|
|
1260
|
-
if (!isArray(a)) return a;
|
|
1261
|
-
var bAllMatches = [];
|
|
1262
|
-
return a.map(function(ao) {
|
|
1263
|
-
if (!(0, utils_1.isPlainObject)(currentRule)) return ao;
|
|
1264
|
-
var ret = {}, rulesToMatch = [], operations = {};
|
|
1265
|
-
Object.entries(currentRule).forEach(function(_a) {
|
|
1266
|
-
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
1267
|
-
v === types_1.CustomizeRule.Match ? rulesToMatch.push(k) : operations[k] = v;
|
|
1268
|
-
});
|
|
1269
|
-
var bMatches = b.filter(function(o) {
|
|
1270
|
-
var matches = rulesToMatch.every(function(rule) {
|
|
1271
|
-
return (0, utils_1.isSameCondition)(ao[rule], o[rule]);
|
|
1272
|
-
});
|
|
1273
|
-
return matches && bAllMatches.push(o), matches;
|
|
1274
|
-
});
|
|
1275
|
-
return (0, utils_1.isPlainObject)(ao) ? (Object.entries(ao).forEach(function(_a) {
|
|
1276
|
-
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
1277
|
-
switch(currentRule[k]){
|
|
1278
|
-
case types_1.CustomizeRule.Match:
|
|
1279
|
-
ret[k] = v, Object.entries(currentRule).forEach(function(_a) {
|
|
1280
|
-
var _b = __read(_a, 2), k = _b[0];
|
|
1281
|
-
if (_b[1] === types_1.CustomizeRule.Replace && bMatches.length > 0) {
|
|
1282
|
-
var val = last(bMatches)[k];
|
|
1283
|
-
void 0 !== val && (ret[k] = val);
|
|
1284
|
-
}
|
|
1285
|
-
});
|
|
1286
|
-
break;
|
|
1287
|
-
case types_1.CustomizeRule.Append:
|
|
1288
|
-
if (!bMatches.length) {
|
|
1289
|
-
ret[k] = v;
|
|
1290
|
-
break;
|
|
1291
|
-
}
|
|
1292
|
-
var appendValue = last(bMatches)[k];
|
|
1293
|
-
if (!isArray(v) || !isArray(appendValue)) throw TypeError("Trying to append non-arrays");
|
|
1294
|
-
ret[k] = v.concat(appendValue);
|
|
1295
|
-
break;
|
|
1296
|
-
case types_1.CustomizeRule.Merge:
|
|
1297
|
-
if (!bMatches.length) {
|
|
1298
|
-
ret[k] = v;
|
|
1299
|
-
break;
|
|
1300
|
-
}
|
|
1301
|
-
var lastValue = last(bMatches)[k];
|
|
1302
|
-
if (!(0, utils_1.isPlainObject)(v) || !(0, utils_1.isPlainObject)(lastValue)) throw TypeError("Trying to merge non-objects");
|
|
1303
|
-
ret[k] = merge(v, lastValue);
|
|
1304
|
-
break;
|
|
1305
|
-
case types_1.CustomizeRule.Prepend:
|
|
1306
|
-
if (!bMatches.length) {
|
|
1307
|
-
ret[k] = v;
|
|
1308
|
-
break;
|
|
1309
|
-
}
|
|
1310
|
-
var prependValue = last(bMatches)[k];
|
|
1311
|
-
if (!isArray(v) || !isArray(prependValue)) throw TypeError("Trying to prepend non-arrays");
|
|
1312
|
-
ret[k] = prependValue.concat(v);
|
|
1313
|
-
break;
|
|
1314
|
-
case types_1.CustomizeRule.Replace:
|
|
1315
|
-
ret[k] = bMatches.length > 0 ? last(bMatches)[k] : v;
|
|
1316
|
-
break;
|
|
1317
|
-
default:
|
|
1318
|
-
var currentRule_1 = operations[k], b_1 = bMatches.map(function(o) {
|
|
1319
|
-
return o[k];
|
|
1320
|
-
}).reduce(function(acc, val) {
|
|
1321
|
-
return isArray(acc) && isArray(val) ? __spreadArray(__spreadArray([], __read(acc), !1), __read(val), !1) : acc;
|
|
1322
|
-
}, []);
|
|
1323
|
-
ret[k] = mergeWithRule({
|
|
1324
|
-
currentRule: currentRule_1,
|
|
1325
|
-
a: v,
|
|
1326
|
-
b: b_1
|
|
1327
|
-
});
|
|
1328
|
-
}
|
|
1329
|
-
}), ret) : ao;
|
|
1330
|
-
}).concat(b.filter(function(o) {
|
|
1331
|
-
return !bAllMatches.includes(o);
|
|
1332
|
-
}));
|
|
1333
|
-
}
|
|
1334
|
-
function mergeIndividualRule(_a) {
|
|
1335
|
-
var currentRule = _a.currentRule, a = _a.a, b = _a.b;
|
|
1336
|
-
switch(currentRule){
|
|
1337
|
-
case types_1.CustomizeRule.Append:
|
|
1338
|
-
return a.concat(b);
|
|
1339
|
-
case types_1.CustomizeRule.Prepend:
|
|
1340
|
-
return b.concat(a);
|
|
1341
|
-
case types_1.CustomizeRule.Replace:
|
|
1342
|
-
return b;
|
|
1343
|
-
}
|
|
1344
|
-
return a;
|
|
1345
|
-
}
|
|
1346
|
-
function last(arr) {
|
|
1347
|
-
return arr[arr.length - 1];
|
|
1348
|
-
}
|
|
1349
|
-
exports.customizeObject = function customizeObject(rules) {
|
|
1350
|
-
return function(a, b, key) {
|
|
1351
|
-
switch(rules[key]){
|
|
1352
|
-
case types_1.CustomizeRule.Prepend:
|
|
1353
|
-
return (0, merge_with_1.default)([
|
|
1354
|
-
b,
|
|
1355
|
-
a
|
|
1356
|
-
], (0, join_arrays_1.default)());
|
|
1357
|
-
case types_1.CustomizeRule.Replace:
|
|
1358
|
-
return b;
|
|
1359
|
-
case types_1.CustomizeRule.Append:
|
|
1360
|
-
return (0, merge_with_1.default)([
|
|
1361
|
-
a,
|
|
1362
|
-
b
|
|
1363
|
-
], (0, join_arrays_1.default)());
|
|
1364
|
-
}
|
|
1365
|
-
};
|
|
1366
|
-
};
|
|
1367
|
-
},
|
|
1368
|
-
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/join-arrays.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1369
|
-
var __read = this && this.__read || function(o, n) {
|
|
1370
|
-
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
1371
|
-
if (!m) return o;
|
|
1372
|
-
var r, e, i = m.call(o), ar = [];
|
|
1373
|
-
try {
|
|
1374
|
-
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
1375
|
-
} catch (error) {
|
|
1376
|
-
e = {
|
|
1377
|
-
error: error
|
|
1378
|
-
};
|
|
1379
|
-
} finally{
|
|
1380
|
-
try {
|
|
1381
|
-
r && !r.done && (m = i.return) && m.call(i);
|
|
1382
|
-
} finally{
|
|
1383
|
-
if (e) throw e.error;
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
return ar;
|
|
1387
|
-
}, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
|
|
1388
|
-
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]);
|
|
1389
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1390
|
-
}, __importDefault = this && this.__importDefault || function(mod) {
|
|
1391
|
-
return mod && mod.__esModule ? mod : {
|
|
1392
|
-
default: mod
|
|
1393
|
-
};
|
|
1394
|
-
};
|
|
1395
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1396
|
-
value: !0
|
|
1397
|
-
});
|
|
1398
|
-
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;
|
|
1399
|
-
function joinArrays(_a) {
|
|
1400
|
-
var _b = void 0 === _a ? {} : _a, customizeArray = _b.customizeArray, customizeObject = _b.customizeObject, key = _b.key;
|
|
1401
|
-
return function _joinArrays(a, b, k) {
|
|
1402
|
-
var newKey = key ? "".concat(key, ".").concat(k) : k;
|
|
1403
|
-
if ((0, utils_1.isFunction)(a) && (0, utils_1.isFunction)(b)) return function() {
|
|
1404
|
-
for(var args = [], _i = 0; _i < arguments.length; _i++)args[_i] = arguments[_i];
|
|
1405
|
-
return _joinArrays(a.apply(void 0, __spreadArray([], __read(args), !1)), b.apply(void 0, __spreadArray([], __read(args), !1)), k);
|
|
1406
|
-
};
|
|
1407
|
-
if (isArray(a) && isArray(b)) {
|
|
1408
|
-
var customResult = customizeArray && customizeArray(a, b, newKey);
|
|
1409
|
-
return customResult || __spreadArray(__spreadArray([], __read(a), !1), __read(b), !1);
|
|
1410
|
-
}
|
|
1411
|
-
if ((0, utils_1.isRegex)(b)) return b;
|
|
1412
|
-
if ((0, utils_1.isPlainObject)(a) && (0, utils_1.isPlainObject)(b)) {
|
|
1413
|
-
var customResult = customizeObject && customizeObject(a, b, newKey);
|
|
1414
|
-
return customResult || (0, merge_with_1.default)([
|
|
1415
|
-
a,
|
|
1416
|
-
b
|
|
1417
|
-
], joinArrays({
|
|
1418
|
-
customizeArray: customizeArray,
|
|
1419
|
-
customizeObject: customizeObject,
|
|
1420
|
-
key: newKey
|
|
1421
|
-
}));
|
|
1422
|
-
}
|
|
1423
|
-
return (0, utils_1.isPlainObject)(b) ? (0, clone_deep_1.default)(b) : isArray(b) ? __spreadArray([], __read(b), !1) : b;
|
|
1424
|
-
};
|
|
1425
|
-
}
|
|
1426
|
-
exports.default = joinArrays;
|
|
1427
|
-
},
|
|
1428
|
-
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/merge-with.js": function(__unused_webpack_module, exports) {
|
|
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(exports, "__esModule", {
|
|
1456
|
-
value: !0
|
|
1457
|
-
}), exports.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, exports) {
|
|
1465
|
-
var CustomizeRule, CustomizeRule1;
|
|
1466
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1467
|
-
value: !0
|
|
1468
|
-
}), exports.CustomizeRule = void 0, (CustomizeRule1 = CustomizeRule || (exports.CustomizeRule = CustomizeRule = {})).Match = "match", CustomizeRule1.Merge = "merge", CustomizeRule1.Append = "append", CustomizeRule1.Prepend = "prepend", CustomizeRule1.Replace = "replace";
|
|
1469
|
-
},
|
|
1470
|
-
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/unique.js": function(__unused_webpack_module, exports) {
|
|
1471
|
-
var __read = this && this.__read || function(o, n) {
|
|
1472
|
-
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
1473
|
-
if (!m) return o;
|
|
1474
|
-
var r, e, i = m.call(o), ar = [];
|
|
1475
|
-
try {
|
|
1476
|
-
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
1477
|
-
} catch (error) {
|
|
1478
|
-
e = {
|
|
1479
|
-
error: error
|
|
1480
|
-
};
|
|
1481
|
-
} finally{
|
|
1482
|
-
try {
|
|
1483
|
-
r && !r.done && (m = i.return) && m.call(i);
|
|
1484
|
-
} finally{
|
|
1485
|
-
if (e) throw e.error;
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
return ar;
|
|
1489
|
-
}, __spreadArray = this && this.__spreadArray || function(to, from, pack) {
|
|
1490
|
-
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]);
|
|
1491
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1492
|
-
};
|
|
1493
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1494
|
-
value: !0
|
|
1495
|
-
}), exports.default = function mergeUnique(key, uniques, getter) {
|
|
1496
|
-
var uniquesSet = new Set(uniques);
|
|
1497
|
-
return function(a, b, k) {
|
|
1498
|
-
return k === key && Array.from(__spreadArray(__spreadArray([], __read(a), !1), __read(b), !1).map(function(it) {
|
|
1499
|
-
return {
|
|
1500
|
-
key: getter(it),
|
|
1501
|
-
value: it
|
|
1502
|
-
};
|
|
1503
|
-
}).map(function(_a) {
|
|
1504
|
-
var key = _a.key, value = _a.value;
|
|
1505
|
-
return {
|
|
1506
|
-
key: uniquesSet.has(key) ? key : value,
|
|
1507
|
-
value: value
|
|
1508
|
-
};
|
|
1509
|
-
}).reduce(function(m, _a) {
|
|
1510
|
-
var key = _a.key, value = _a.value;
|
|
1511
|
-
return m.delete(key), m.set(key, value);
|
|
1512
|
-
}, new Map()).values());
|
|
1513
|
-
};
|
|
1514
|
-
};
|
|
1515
|
-
},
|
|
1516
|
-
"../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/utils.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1517
|
-
var __read = this && this.__read || function(o, n) {
|
|
1518
|
-
var m = "function" == typeof Symbol && o[Symbol.iterator];
|
|
1519
|
-
if (!m) return o;
|
|
1520
|
-
var r, e, i = m.call(o), ar = [];
|
|
1521
|
-
try {
|
|
1522
|
-
for(; (void 0 === n || n-- > 0) && !(r = i.next()).done;)ar.push(r.value);
|
|
1523
|
-
} catch (error) {
|
|
1524
|
-
e = {
|
|
1525
|
-
error: error
|
|
1526
|
-
};
|
|
1527
|
-
} finally{
|
|
1528
|
-
try {
|
|
1529
|
-
r && !r.done && (m = i.return) && m.call(i);
|
|
1530
|
-
} finally{
|
|
1531
|
-
if (e) throw e.error;
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
return ar;
|
|
1535
|
-
};
|
|
1536
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1537
|
-
value: !0
|
|
1538
|
-
}), exports.isSameCondition = exports.isUndefined = exports.isPlainObject = exports.isFunction = exports.isRegex = void 0;
|
|
1539
|
-
var flat_1 = __webpack_require__("../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js");
|
|
1540
|
-
function isRegex(o) {
|
|
1541
|
-
return o instanceof RegExp;
|
|
1542
|
-
}
|
|
1543
|
-
function isFunction(functionToCheck) {
|
|
1544
|
-
return functionToCheck && "[object Function]" === ({}).toString.call(functionToCheck);
|
|
1545
|
-
}
|
|
1546
|
-
exports.isRegex = isRegex, exports.isFunction = isFunction, exports.isPlainObject = function isPlainObject(a) {
|
|
1547
|
-
return !(null === a || Array.isArray(a)) && "object" == typeof a;
|
|
1548
|
-
}, exports.isUndefined = function isUndefined(a) {
|
|
1549
|
-
return void 0 === a;
|
|
1550
|
-
}, exports.isSameCondition = function isSameCondition(a, b) {
|
|
1551
|
-
if (!a || !b) return a === b;
|
|
1552
|
-
if ("string" == typeof a || "string" == typeof b || isRegex(a) || isRegex(b) || isFunction(a) || isFunction(b)) return a.toString() === b.toString();
|
|
1553
|
-
var _a, _b, entriesA = Object.entries((0, flat_1.flatten)(a)), entriesB = Object.entries((0, flat_1.flatten)(b));
|
|
1554
|
-
if (entriesA.length !== entriesB.length) return !1;
|
|
1555
|
-
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, "[]");
|
|
1556
|
-
function cmp(_a, _b) {
|
|
1557
|
-
var _c = __read(_a, 2), k1 = _c[0], v1 = _c[1], _d = __read(_b, 2), k2 = _d[0], v2 = _d[1];
|
|
1558
|
-
return k1 < k2 ? -1 : k1 > k2 ? 1 : v1 < v2 ? -1 : +(v1 > v2);
|
|
1559
|
-
}
|
|
1560
|
-
if (entriesA.sort(cmp), entriesB.sort(cmp), entriesA.length !== entriesB.length) return !1;
|
|
1561
|
-
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;
|
|
1562
|
-
return !0;
|
|
1563
|
-
};
|
|
1564
|
-
},
|
|
1565
|
-
"../../node_modules/.pnpm/wildcard@2.0.1/node_modules/wildcard/index.js": function(module) {
|
|
1566
|
-
var REGEXP_PARTS = /(\*|\?)/g;
|
|
1567
|
-
function WildcardMatcher(text, separator) {
|
|
1568
|
-
this.text = text = text || '', this.hasWild = text.indexOf('*') >= 0, this.separator = separator, this.parts = text.split(separator).map(this.classifyPart.bind(this));
|
|
1569
|
-
}
|
|
1570
|
-
WildcardMatcher.prototype.match = function(input) {
|
|
1571
|
-
var ii, testParts, matches = !0, parts = this.parts, partsCount = parts.length;
|
|
1572
|
-
if ('string' == typeof input || input instanceof String) if (this.hasWild || this.text == input) {
|
|
1573
|
-
for(ii = 0, testParts = (input || '').split(this.separator); matches && ii < partsCount; ii++)if ('*' === parts[ii]) continue;
|
|
1574
|
-
else matches = ii < testParts.length && (parts[ii] instanceof RegExp ? parts[ii].test(testParts[ii]) : parts[ii] === testParts[ii]);
|
|
1575
|
-
matches = matches && testParts;
|
|
1576
|
-
} else matches = !1;
|
|
1577
|
-
else if ('function' == typeof input.splice) for(matches = [], ii = input.length; ii--;)this.match(input[ii]) && (matches[matches.length] = input[ii]);
|
|
1578
|
-
else if ('object' == typeof input) for(var key in matches = {}, input)this.match(key) && (matches[key] = input[key]);
|
|
1579
|
-
return matches;
|
|
1580
|
-
}, WildcardMatcher.prototype.classifyPart = function(part) {
|
|
1581
|
-
if ('*' === part) ;
|
|
1582
|
-
else if (part.indexOf('*') >= 0 || part.indexOf('?') >= 0) return new RegExp(part.replace(REGEXP_PARTS, '\.$1'));
|
|
1583
|
-
return part;
|
|
1584
|
-
}, module.exports = function(text, test, separator) {
|
|
1585
|
-
var matcher = new WildcardMatcher(text, separator || /[\/\.]/);
|
|
1586
|
-
return void 0 !== test ? matcher.match(test) : matcher;
|
|
1587
|
-
};
|
|
1588
|
-
},
|
|
1589
912
|
async_hooks: function(module) {
|
|
1590
|
-
module.exports =
|
|
913
|
+
module.exports = __rspack_external_async_hooks;
|
|
1591
914
|
},
|
|
1592
915
|
fs: function(module) {
|
|
1593
|
-
module.exports =
|
|
916
|
+
module.exports = __rspack_external_fs;
|
|
1594
917
|
},
|
|
1595
918
|
"node:module": function(module) {
|
|
1596
|
-
module.exports =
|
|
919
|
+
module.exports = __rspack_external_node_module_ab9f2194;
|
|
1597
920
|
},
|
|
1598
921
|
"node:path": function(module) {
|
|
1599
|
-
module.exports =
|
|
922
|
+
module.exports = __rspack_external_node_path_c5b9b54f;
|
|
1600
923
|
},
|
|
1601
924
|
"node:url": function(module) {
|
|
1602
|
-
module.exports =
|
|
925
|
+
module.exports = __rspack_external_node_url_e96de089;
|
|
1603
926
|
},
|
|
1604
927
|
os: function(module) {
|
|
1605
|
-
module.exports =
|
|
928
|
+
module.exports = __rspack_external_os;
|
|
1606
929
|
},
|
|
1607
930
|
path: function(module) {
|
|
1608
|
-
module.exports =
|
|
931
|
+
module.exports = __rspack_external_path;
|
|
1609
932
|
},
|
|
1610
933
|
url: function(module) {
|
|
1611
|
-
module.exports =
|
|
934
|
+
module.exports = __rspack_external_url;
|
|
1612
935
|
}
|
|
1613
936
|
});
|
|
1614
937
|
var superClass, superClass1, provider_helpers_namespaceObject = {};
|
|
@@ -1628,7 +951,7 @@ __webpack_require__.r(provider_helpers_namespaceObject), __webpack_require__.d(p
|
|
|
1628
951
|
setCssExtractPlugin: ()=>setCssExtractPlugin,
|
|
1629
952
|
setHTMLPlugin: ()=>setHTMLPlugin
|
|
1630
953
|
});
|
|
1631
|
-
let external_node_module_ = __webpack_require__("node:module"), rspack_rspack = (0, external_node_module_.createRequire)(import.meta.url)('@rspack/core'), external_node_path_ = __webpack_require__("node:path"), external_node_url_ = __webpack_require__("node:url"), constants_filename = (0, external_node_url_.fileURLToPath)(import.meta.url), constants_dirname = (0, external_node_path_.dirname)(constants_filename), isDeno = 'undefined' != typeof Deno, isWindows = 'win32' === process.platform, ROOT_DIST_DIR = 'dist', LOADER_PATH = (0, external_node_path_.join)(constants_dirname), STATIC_PATH = (0, external_node_path_.join)(constants_dirname, '../static'), COMPILED_PATH = (0, external_node_path_.join)(constants_dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', DEFAULT_DEV_HOST = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_WEB_BROWSERSLIST = [
|
|
954
|
+
let external_node_module_ = __webpack_require__("node:module"), rspack_rspack = (0, external_node_module_.createRequire)(import.meta.url)('@rspack/core'), external_node_path_ = __webpack_require__("node:path"), external_node_url_ = __webpack_require__("node:url"), constants_filename = (0, external_node_url_.fileURLToPath)(import.meta.url), constants_dirname = (0, external_node_path_.dirname)(constants_filename), isDeno = 'undefined' != typeof Deno, isWindows = 'win32' === process.platform, ROOT_DIST_DIR = 'dist', LOADER_PATH = (0, external_node_path_.join)(constants_dirname), STATIC_PATH = (0, external_node_path_.join)(constants_dirname, '../static'), CLIENT_PATH = (0, external_node_path_.join)(constants_dirname, 'client'), COMPILED_PATH = (0, external_node_path_.join)(constants_dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', DEFAULT_DEV_HOST = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_WEB_BROWSERSLIST = [
|
|
1632
955
|
'chrome >= 87',
|
|
1633
956
|
'edge >= 88',
|
|
1634
957
|
'firefox >= 78',
|
|
@@ -2775,7 +2098,7 @@ function partition(array, predicate) {
|
|
|
2775
2098
|
falsy
|
|
2776
2099
|
];
|
|
2777
2100
|
}
|
|
2778
|
-
let upperFirst = (str)=>str ? str.charAt(0).toUpperCase() + str.slice(1) : '', createVirtualModule = (content)=>`data:text/javascript,${content}`;
|
|
2101
|
+
let upperFirst = (str)=>str ? str.charAt(0).toUpperCase() + str.slice(1) : '', createVirtualModule = (content)=>`data:text/javascript,${encodeURIComponent(content)}`;
|
|
2779
2102
|
function isWebTarget(target) {
|
|
2780
2103
|
let targets = helpers_castArray(target);
|
|
2781
2104
|
return targets.includes('web') || targets.includes('web-worker');
|
|
@@ -3421,7 +2744,7 @@ let OVERRIDE_PATHS = new Set([
|
|
|
3421
2744
|
'resolve.conditionNames',
|
|
3422
2745
|
'resolve.mainFields',
|
|
3423
2746
|
'provider'
|
|
3424
|
-
]),
|
|
2747
|
+
]), mergeConfig_merge = (x, y, path = '')=>{
|
|
3425
2748
|
if (((key)=>{
|
|
3426
2749
|
if (key.startsWith('environments.')) {
|
|
3427
2750
|
let realKey = key.split('.').slice(2).join('.');
|
|
@@ -3454,7 +2777,7 @@ let OVERRIDE_PATHS = new Set([
|
|
|
3454
2777
|
...Object.keys(y)
|
|
3455
2778
|
])){
|
|
3456
2779
|
let childPath = path ? `${path}.${key}` : key;
|
|
3457
|
-
merged[key] =
|
|
2780
|
+
merged[key] = mergeConfig_merge(x[key], y[key], childPath);
|
|
3458
2781
|
}
|
|
3459
2782
|
return merged;
|
|
3460
2783
|
}, normalizeConfigStructure = (config)=>{
|
|
@@ -3474,7 +2797,7 @@ let OVERRIDE_PATHS = new Set([
|
|
|
3474
2797
|
]), normalizedConfig.dev = dev), normalizedConfig;
|
|
3475
2798
|
}, mergeRsbuildConfig = (...originalConfigs)=>{
|
|
3476
2799
|
let configs = originalConfigs.filter((config)=>void 0 !== config).map(normalizeConfigStructure);
|
|
3477
|
-
return 2 === configs.length ?
|
|
2800
|
+
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), {});
|
|
3478
2801
|
}, defaultConfig_require = (0, external_node_module_.createRequire)(import.meta.url), defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/, createDefaultConfig = ()=>({
|
|
3479
2802
|
dev: {
|
|
3480
2803
|
hmr: !0,
|
|
@@ -4083,7 +3406,7 @@ function createPublicContext(context) {
|
|
|
4083
3406
|
async function createContext(options, userConfig) {
|
|
4084
3407
|
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';
|
|
4085
3408
|
return {
|
|
4086
|
-
version: "1.6.
|
|
3409
|
+
version: "1.6.11",
|
|
4087
3410
|
rootPath,
|
|
4088
3411
|
distPath: '',
|
|
4089
3412
|
cachePath,
|
|
@@ -4342,7 +3665,7 @@ let configChain_CHAIN_ID = {
|
|
|
4342
3665
|
plugin && (pluginHelper_htmlPlugin = plugin);
|
|
4343
3666
|
}, pluginHelper_getHTMLPlugin = (config)=>config?.html.implementation === 'native' ? rspack_rspack.HtmlRspackPlugin : (pluginHelper_htmlPlugin || (pluginHelper_htmlPlugin = requireCompiledPackage('html-rspack-plugin')), pluginHelper_htmlPlugin), setCssExtractPlugin = (plugin)=>{
|
|
4344
3667
|
cssExtractPlugin = plugin;
|
|
4345
|
-
}
|
|
3668
|
+
};
|
|
4346
3669
|
async function modifyRspackConfig(context, rspackConfig, chainUtils) {
|
|
4347
3670
|
logger.debug('applying modifyRspackConfig hook');
|
|
4348
3671
|
let currentConfig = rspackConfig, utils = getConfigUtils(()=>currentConfig, chainUtils);
|
|
@@ -4369,7 +3692,10 @@ async function modifyRspackConfig(context, rspackConfig, chainUtils) {
|
|
|
4369
3692
|
function getConfigUtils(getCurrentConfig, chainUtils) {
|
|
4370
3693
|
return {
|
|
4371
3694
|
...chainUtils,
|
|
4372
|
-
mergeConfig:
|
|
3695
|
+
mergeConfig: (...args)=>{
|
|
3696
|
+
let { merge } = requireCompiledPackage('webpack-merge');
|
|
3697
|
+
return merge(...args);
|
|
3698
|
+
},
|
|
4373
3699
|
addRules (rules) {
|
|
4374
3700
|
let config = getCurrentConfig(), ruleArr = helpers_castArray(rules);
|
|
4375
3701
|
config.module || (config.module = {}), config.module.rules || (config.module.rules = []), config.module.rules.unshift(...ruleArr);
|
|
@@ -4566,11 +3892,12 @@ async function initConfigs({ context, pluginManager, rsbuildOptions }) {
|
|
|
4566
3892
|
let normalizedConfig = await initRsbuildConfig({
|
|
4567
3893
|
context,
|
|
4568
3894
|
pluginManager
|
|
4569
|
-
}), rspackConfigs =
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
3895
|
+
}), rspackConfigs = [];
|
|
3896
|
+
for (let [environmentName, config] of Object.entries(normalizedConfig.environments))rspackConfigs.push(await generateRspackConfig({
|
|
3897
|
+
target: config.output.target,
|
|
3898
|
+
context,
|
|
3899
|
+
environmentName
|
|
3900
|
+
}));
|
|
4574
3901
|
if (isDebug()) {
|
|
4575
3902
|
let inspect = async ()=>{
|
|
4576
3903
|
await inspectConfig_inspectConfig({
|
|
@@ -4618,9 +3945,9 @@ function printBuildLog(compiler, context, lazyModules) {
|
|
|
4618
3945
|
}
|
|
4619
3946
|
let removedFiles = compiler.removedFiles ? Array.from(compiler.removedFiles) : null;
|
|
4620
3947
|
if (removedFiles?.length) {
|
|
3948
|
+
if (removedFiles.every((item)=>item.includes('virtual'))) return void logger.start(`building ${color.dim('virtual modules')}`);
|
|
4621
3949
|
let fileInfo = formatFileList(removedFiles, context.rootPath);
|
|
4622
|
-
logger.start(`building ${color.dim(`removed ${fileInfo}`)}`);
|
|
4623
|
-
return;
|
|
3950
|
+
return void logger.start(`building ${color.dim(`removed ${fileInfo}`)}`);
|
|
4624
3951
|
}
|
|
4625
3952
|
logger.start('build started...');
|
|
4626
3953
|
}
|
|
@@ -6405,30 +5732,29 @@ function setupWriteToDisk(compilers, writeToDisk) {
|
|
|
6405
5732
|
}), compiler.__hasRsbuildAssetEmittedCallback = !0);
|
|
6406
5733
|
});
|
|
6407
5734
|
}
|
|
6408
|
-
let noop = ()=>{},
|
|
6409
|
-
function getClientPaths(devConfig) {
|
|
6410
|
-
let clientPaths = [];
|
|
6411
|
-
return (devConfig.hmr || devConfig.liveReload) && (hmrClientPath || (hmrClientPath = assets_middleware_require.resolve('@rsbuild/core/client/hmr')), clientPaths.push(hmrClientPath), devConfig.client?.overlay && (overlayClientPath || (overlayClientPath = assets_middleware_require.resolve('@rsbuild/core/client/overlay')), clientPaths.push(overlayClientPath))), clientPaths;
|
|
6412
|
-
}
|
|
6413
|
-
let isTsError = (error)=>'message' in error && error.stack?.includes('ts-checker-rspack-plugin');
|
|
5735
|
+
let noop = ()=>{}, isTsError = (error)=>'message' in error && error.stack?.includes('ts-checker-rspack-plugin');
|
|
6414
5736
|
function applyHMREntry({ config, compiler, token, resolvedHost, resolvedPort }) {
|
|
6415
5737
|
if (!((compiler)=>{
|
|
6416
5738
|
let { target } = compiler.options;
|
|
6417
5739
|
return !!target && (Array.isArray(target) ? target.includes('web') : 'web' === target);
|
|
6418
|
-
})(compiler)) return;
|
|
6419
|
-
let clientPaths = getClientPaths(config.dev);
|
|
6420
|
-
if (!clientPaths.length) return;
|
|
5740
|
+
})(compiler) || !config.dev.hmr && !config.dev.liveReload) return;
|
|
6421
5741
|
let clientConfig = {
|
|
6422
5742
|
...config.dev.client
|
|
6423
5743
|
};
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
5744
|
+
'<port>' === clientConfig.port && (clientConfig.port = resolvedPort);
|
|
5745
|
+
let hmrEntry = `import { init } from '${toPosixPath((0, external_node_path_.join)(CLIENT_PATH, 'hmr'))}';
|
|
5746
|
+
${config.dev.client.overlay ? `import '${toPosixPath((0, external_node_path_.join)(CLIENT_PATH, 'overlay'))}';` : ''}
|
|
5747
|
+
|
|
5748
|
+
init({
|
|
5749
|
+
token: '${token}',
|
|
5750
|
+
config: ${JSON.stringify(clientConfig)},
|
|
5751
|
+
serverHost: ${JSON.stringify(resolvedHost)},
|
|
5752
|
+
serverPort: ${resolvedPort},
|
|
5753
|
+
liveReload: ${config.dev.liveReload},
|
|
5754
|
+
browserLogs: ${!!config.dev.browserLogs}
|
|
5755
|
+
});
|
|
5756
|
+
`;
|
|
5757
|
+
new compiler.webpack.EntryPlugin(compiler.context, createVirtualModule(hmrEntry), {
|
|
6432
5758
|
name: void 0
|
|
6433
5759
|
}).apply(compiler);
|
|
6434
5760
|
}
|
|
@@ -6450,27 +5776,34 @@ let assets_middleware_assetsMiddleware = async ({ config, compiler, context, soc
|
|
|
6450
5776
|
let { target } = compiler.options;
|
|
6451
5777
|
return !!target && (Array.isArray(target) ? target.includes('node') : 'node' === target);
|
|
6452
5778
|
})(compiler)) return;
|
|
6453
|
-
let errorsCount = null;
|
|
5779
|
+
let errorsCount = null, warningsCount = null;
|
|
6454
5780
|
compiler.hooks.invalid.tap('rsbuild-dev-server', (fileName)=>{
|
|
6455
|
-
errorsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && socketServer.sockWrite({
|
|
5781
|
+
errorsCount = null, warningsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && socketServer.sockWrite({
|
|
6456
5782
|
type: 'static-changed'
|
|
6457
5783
|
}, token);
|
|
6458
5784
|
}), compiler.hooks.done.tap('rsbuild-dev-server', (stats)=>{
|
|
6459
|
-
let { errors } = stats.compilation;
|
|
6460
|
-
if (errors.length === errorsCount) return;
|
|
6461
|
-
let isRecalled = null !== errorsCount;
|
|
6462
|
-
if (errorsCount = errors.length, isRecalled) {
|
|
6463
|
-
let tsErrors = errors.filter(isTsError);
|
|
6464
|
-
if (!tsErrors.length) return;
|
|
6465
|
-
let { stats: statsJson } = context.buildState,
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
5785
|
+
let { errors, warnings } = stats.compilation;
|
|
5786
|
+
if (errors.length === errorsCount && warnings.length === warningsCount) return;
|
|
5787
|
+
let isRecalled = null !== errorsCount || null !== warningsCount;
|
|
5788
|
+
if (errorsCount = errors.length, warningsCount = warnings.length, isRecalled) {
|
|
5789
|
+
let tsErrors = errors.filter(isTsError), tsWarnings = warnings.filter(isTsError);
|
|
5790
|
+
if (!tsErrors.length && !tsWarnings.length) return;
|
|
5791
|
+
let { stats: statsJson } = context.buildState, handleTsIssues = (issues, type, sendFn)=>{
|
|
5792
|
+
let statsIssues = issues.map((item)=>pick(item, [
|
|
5793
|
+
'message',
|
|
5794
|
+
'file'
|
|
5795
|
+
]));
|
|
5796
|
+
statsJson && (statsJson[type] = statsJson[type] ? [
|
|
5797
|
+
...statsJson[type],
|
|
5798
|
+
...statsIssues
|
|
5799
|
+
] : statsIssues), sendFn(statsIssues, token);
|
|
5800
|
+
};
|
|
5801
|
+
if (tsErrors.length > 0) return void handleTsIssues(tsErrors, 'errors', (issues, token)=>{
|
|
5802
|
+
socketServer.sendError(issues, token);
|
|
5803
|
+
});
|
|
5804
|
+
if (tsWarnings.length > 0) return void handleTsIssues(tsWarnings, 'warnings', (issues, token)=>{
|
|
5805
|
+
socketServer.sendWarning(issues, token);
|
|
5806
|
+
});
|
|
6474
5807
|
}
|
|
6475
5808
|
});
|
|
6476
5809
|
})({
|
|
@@ -6700,13 +6033,18 @@ function ansiHTML(text) {
|
|
|
6700
6033
|
return ansiCodes.length > 0 && (ret += Array(ansiCodes.length + 1).join('</span>')), ret;
|
|
6701
6034
|
}
|
|
6702
6035
|
function convertLinksInHtml(text, root) {
|
|
6703
|
-
let
|
|
6036
|
+
let PATH_RE = /(?:\.\.?[/\\]|(file:\/\/\/)?[a-zA-Z]:\\|(file:\/\/)?\/)[^:]*:\d+:\d+/g, URL_RE = /(https?:\/\/(?:[\w-]+\.)+[a-z0-9](?:[\w-.~:/?#[\]@!$&'*+,;=])*)/gi, NODE_INTERNAL_RE = /node:internal[/\\]/, FILE_URI_WINDOWS_RE = /^file:\/\/\/([A-Za-z]:)/, FILE_URI_UNIX_RE = /^file:\/\//;
|
|
6704
6037
|
return text.split('\n').map((line)=>{
|
|
6705
|
-
|
|
6706
|
-
|
|
6038
|
+
if (NODE_INTERNAL_RE.test(line)) return line;
|
|
6039
|
+
let replacedLine = line.replace(PATH_RE, (file)=>{
|
|
6040
|
+
let hasClosingSpan = (file = ((file)=>{
|
|
6041
|
+
if (!file.startsWith('file://')) return file;
|
|
6042
|
+
let windows = file.replace(FILE_URI_WINDOWS_RE, '$1');
|
|
6043
|
+
return windows !== file ? windows : file.replace(FILE_URI_UNIX_RE, '');
|
|
6044
|
+
})(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 ? toRelativePath(root, filePath) : filePath;
|
|
6707
6045
|
return `<a class="file-link" data-file="${absolutePath}">${relativePath}</a>${hasClosingSpan ? '</span>' : ''}`;
|
|
6708
6046
|
});
|
|
6709
|
-
return replacedLine.replace(
|
|
6047
|
+
return replacedLine.replace(URL_RE, (url)=>`<a class="url-link" href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`);
|
|
6710
6048
|
}).join('\n');
|
|
6711
6049
|
}
|
|
6712
6050
|
function genOverlayHTML(errors, root) {
|
|
@@ -6755,7 +6093,8 @@ function genOverlayHTML(errors, root) {
|
|
|
6755
6093
|
margin: 0;
|
|
6756
6094
|
font-size: 14px;
|
|
6757
6095
|
font-family: inherit;
|
|
6758
|
-
|
|
6096
|
+
white-space: pre-wrap;
|
|
6097
|
+
word-break: break-all;
|
|
6759
6098
|
scrollbar-width: none;
|
|
6760
6099
|
}
|
|
6761
6100
|
.content::-webkit-scrollbar {
|
|
@@ -6907,6 +6246,15 @@ class SocketServer {
|
|
|
6907
6246
|
}
|
|
6908
6247
|
}, token);
|
|
6909
6248
|
}
|
|
6249
|
+
sendWarning(warnings, token) {
|
|
6250
|
+
let formattedWarnings = warnings.map((item)=>formatStatsError(item));
|
|
6251
|
+
this.sockWrite({
|
|
6252
|
+
type: 'warnings',
|
|
6253
|
+
data: {
|
|
6254
|
+
text: formattedWarnings
|
|
6255
|
+
}
|
|
6256
|
+
}, token);
|
|
6257
|
+
}
|
|
6910
6258
|
sockWrite(message, token) {
|
|
6911
6259
|
let messageStr = JSON.stringify(message), sendToSockets = (sockets)=>{
|
|
6912
6260
|
for (let socket of sockets)this.send(socket, messageStr);
|
|
@@ -6984,18 +6332,7 @@ class SocketServer {
|
|
|
6984
6332
|
data: stats.hash
|
|
6985
6333
|
}, token);
|
|
6986
6334
|
}
|
|
6987
|
-
|
|
6988
|
-
if (warnings.length > 0) {
|
|
6989
|
-
let warningMessages = warnings.map((item)=>formatStatsError(item));
|
|
6990
|
-
this.sockWrite({
|
|
6991
|
-
type: 'warnings',
|
|
6992
|
-
data: {
|
|
6993
|
-
text: warningMessages
|
|
6994
|
-
}
|
|
6995
|
-
}, token);
|
|
6996
|
-
return;
|
|
6997
|
-
}
|
|
6998
|
-
this.sockWrite({
|
|
6335
|
+
errors.length > 0 ? this.sendError(errors, token) : warnings.length > 0 ? this.sendWarning(warnings, token) : this.sockWrite({
|
|
6999
6336
|
type: 'ok'
|
|
7000
6337
|
}, token);
|
|
7001
6338
|
}
|
|
@@ -7099,32 +6436,34 @@ async function setupCliShortcuts({ help = !0, openPage, closeServer, printUrls,
|
|
|
7099
6436
|
};
|
|
7100
6437
|
}
|
|
7101
6438
|
let ENCODING_REGEX = /\bgzip\b/, CONTENT_TYPE_REGEX = /text|javascript|\/json|xml/i, gzipMiddleware_gzipMiddleware = ({ filter, level = node_zlib.constants.Z_BEST_SPEED } = {})=>function gzipMiddleware(req, res, next) {
|
|
7102
|
-
let gzip, writeHeadStatus;
|
|
6439
|
+
let gzip, writeHeadStatus, writeHeadMessage;
|
|
7103
6440
|
if (filter && !filter(req, res)) return void next();
|
|
7104
6441
|
let accept = req.headers['accept-encoding'], encoding = 'string' == typeof accept && ENCODING_REGEX.test(accept);
|
|
7105
6442
|
if ('HEAD' === req.method || !encoding) return void next();
|
|
7106
6443
|
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 = ()=>{
|
|
7107
|
-
if (
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
6444
|
+
if (started) return;
|
|
6445
|
+
if (started = !0, ((res)=>{
|
|
6446
|
+
if (res.getHeader('Content-Encoding')) return !1;
|
|
6447
|
+
let contentType = String(res.getHeader('Content-Type'));
|
|
6448
|
+
if (contentType && !CONTENT_TYPE_REGEX.test(contentType)) return !1;
|
|
6449
|
+
let size = res.getHeader('Content-Length');
|
|
6450
|
+
return void 0 === size || Number(size) > 1024;
|
|
6451
|
+
})(res)) for (let listener of (res.setHeader('Content-Encoding', 'gzip'), res.removeHeader('Content-Length'), (gzip = node_zlib.createGzip({
|
|
6452
|
+
level
|
|
6453
|
+
})).on('data', (chunk)=>{
|
|
6454
|
+
write(chunk) || gzip.pause();
|
|
6455
|
+
}), on('drain', ()=>gzip.resume()), gzip.on('end', ()=>{
|
|
6456
|
+
end();
|
|
6457
|
+
}), listeners))gzip.on.apply(gzip, listener);
|
|
6458
|
+
else for (let listener of listeners)on.apply(res, listener);
|
|
6459
|
+
let statusCode = writeHeadStatus ?? res.statusCode;
|
|
6460
|
+
void 0 !== writeHeadMessage ? writeHead(statusCode, writeHeadMessage) : writeHead(statusCode);
|
|
7124
6461
|
};
|
|
7125
6462
|
res.writeHead = (status, reason, headers)=>{
|
|
7126
|
-
|
|
7127
|
-
|
|
6463
|
+
writeHeadStatus = status, 'string' == typeof reason && (writeHeadMessage = reason);
|
|
6464
|
+
let resolvedHeaders = 'string' == typeof reason ? headers : reason;
|
|
6465
|
+
if (resolvedHeaders) for (let [key, value] of Object.entries(resolvedHeaders))res.setHeader(key, value);
|
|
6466
|
+
return res;
|
|
7128
6467
|
}, 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([
|
|
7129
6468
|
type,
|
|
7130
6469
|
listener
|
|
@@ -9708,7 +9047,7 @@ let applyServerOptions = (command)=>{
|
|
|
9708
9047
|
};
|
|
9709
9048
|
function setupCommands() {
|
|
9710
9049
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
9711
|
-
cli.version("1.6.
|
|
9050
|
+
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)', {
|
|
9712
9051
|
default: 'auto'
|
|
9713
9052
|
}).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', {
|
|
9714
9053
|
type: [
|
|
@@ -9777,7 +9116,7 @@ function initNodeEnv() {
|
|
|
9777
9116
|
}
|
|
9778
9117
|
function showGreeting() {
|
|
9779
9118
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
9780
|
-
logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.
|
|
9119
|
+
logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.11\n`);
|
|
9781
9120
|
}
|
|
9782
9121
|
function setupLogLevel() {
|
|
9783
9122
|
let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
|
|
@@ -9798,9 +9137,9 @@ function runCLI() {
|
|
|
9798
9137
|
logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
|
|
9799
9138
|
}
|
|
9800
9139
|
}
|
|
9801
|
-
let src_version = "1.6.
|
|
9802
|
-
import * as
|
|
9803
|
-
import { createRequire as
|
|
9804
|
-
import * as
|
|
9140
|
+
let src_version = "1.6.11";
|
|
9141
|
+
import * as __rspack_external_node_module_ab9f2194 from "node:module";
|
|
9142
|
+
import { createRequire as __rspack_createRequire } from "node:module";
|
|
9143
|
+
import * as __rspack_external_node_url_e96de089 from "node:url";
|
|
9805
9144
|
import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
9806
9145
|
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, logger, mergeRsbuildConfig, node_fs, node_os, node_process, rspack_rspack as rspack, runCLI, src_version as version };
|