@rsbuild/core 2.0.0-beta.5 → 2.0.0-beta.7

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.
Files changed (50) hide show
  1. package/compiled/chokidar/index.d.ts +197 -29
  2. package/compiled/chokidar/package.json +1 -1
  3. package/compiled/connect/index.d.ts +90 -0
  4. package/compiled/connect/license +25 -0
  5. package/compiled/connect/package.json +1 -0
  6. package/compiled/cors/index.d.ts +56 -0
  7. package/compiled/cors/license +22 -0
  8. package/compiled/cors/package.json +1 -0
  9. package/compiled/css-loader/index.js +2 -2
  10. package/compiled/html-rspack-plugin/index.js +14 -14
  11. package/compiled/postcss/index.js +1 -1
  12. package/compiled/postcss/lib/at-rule.d.ts +1 -1
  13. package/compiled/postcss/lib/comment.d.ts +1 -1
  14. package/compiled/postcss/lib/container.d.ts +1 -1
  15. package/compiled/postcss/lib/css-syntax-error.d.ts +1 -1
  16. package/compiled/postcss/lib/declaration.d.ts +1 -1
  17. package/compiled/postcss/lib/document.d.ts +1 -1
  18. package/compiled/postcss/lib/input.d.ts +1 -1
  19. package/compiled/postcss/lib/lazy-result.d.ts +1 -1
  20. package/compiled/postcss/lib/no-work-result.d.ts +1 -1
  21. package/compiled/postcss/lib/node.d.ts +1 -1
  22. package/compiled/postcss/lib/previous-map.d.ts +1 -1
  23. package/compiled/postcss/lib/processor.d.ts +1 -1
  24. package/compiled/postcss/lib/result.d.ts +1 -1
  25. package/compiled/postcss/lib/root.d.ts +1 -1
  26. package/compiled/postcss/lib/rule.d.ts +1 -1
  27. package/compiled/postcss/lib/stringifier.d.ts +1 -1
  28. package/compiled/postcss/lib/warning.d.ts +1 -1
  29. package/compiled/postcss/package.json +1 -1
  30. package/compiled/postcss-loader/index.js +6 -6
  31. package/compiled/rspack-chain/package.json +1 -1
  32. package/compiled/rspack-chain/types/index.d.ts +0 -2
  33. package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
  34. package/compiled/rspack-manifest-plugin/license +21 -0
  35. package/compiled/rspack-manifest-plugin/package.json +1 -0
  36. package/compiled/style-loader/index.js +37 -94
  37. package/compiled/style-loader/package.json +1 -1
  38. package/dist/131.js +869 -713
  39. package/dist/client/hmr.js +1 -1
  40. package/dist/connect.js +5 -1
  41. package/dist/launch-editor-middleware.js +11 -10
  42. package/dist/manifest-plugin.js +5 -5
  43. package/dist/memfs.js +45 -45
  44. package/dist/open.js +3 -4
  45. package/dist/tinyglobby.js +100 -55
  46. package/dist-types/server/socketServer.d.ts +2 -0
  47. package/dist-types/types/config.d.ts +10 -15
  48. package/dist-types/types/thirdParty.d.ts +14 -5
  49. package/package.json +9 -9
  50. package/compiled/chokidar/handler.d.ts +0 -90
package/dist/131.js CHANGED
@@ -1,10 +1,9 @@
1
1
  /*! For license information please see 131.js.LICENSE.txt */
2
- let flagForceColor, swcHelpersPath, pluginHelper_htmlPlugin, cssExtractPlugin;
2
+ let flagForceColor, runtimeProcessArgs, runtimeInfo, swcHelpersPath, pluginHelper_htmlPlugin, cssExtractPlugin;
3
3
  import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
4
4
  import { createRequire as __rspack_createRequire } from "node:module";
5
5
  let __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
6
6
  import * as __rspack_external_async_hooks from "async_hooks";
7
- import * as __rspack_external_events from "events";
8
7
  import * as __rspack_external_fs from "fs";
9
8
  import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
10
9
  import * as __rspack_external_node_module_ab9f2194 from "node:module";
@@ -156,300 +155,6 @@ __webpack_require__.add({
156
155
  return thunk.cancel = cleanup, thunk;
157
156
  };
158
157
  },
159
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js" (__unused_rspack_module, exports) {
160
- Object.defineProperty(exports, "__esModule", {
161
- value: !0
162
- }), exports.arrayToString = void 0, exports.arrayToString = (array, space, next)=>{
163
- let values = array.map(function(value, index) {
164
- let result = next(value, index);
165
- return void 0 === result ? String(result) : space + result.split("\n").join(`\n${space}`);
166
- }).join(space ? ",\n" : ","), eol = space && values ? "\n" : "";
167
- return `[${eol}${values}${eol}]`;
168
- };
169
- },
170
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js" (__unused_rspack_module, exports, __webpack_require__) {
171
- Object.defineProperty(exports, "__esModule", {
172
- value: !0
173
- }), exports.FunctionParser = exports.dedentFunction = exports.functionToString = exports.USED_METHOD_KEY = void 0;
174
- let quote_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), METHOD_NAMES_ARE_QUOTED = '"' === ({
175
- " " () {}
176
- })[" "].toString().charAt(0), FUNCTION_PREFIXES = {
177
- Function: "function ",
178
- GeneratorFunction: "function* ",
179
- AsyncFunction: "async function ",
180
- AsyncGeneratorFunction: "async function* "
181
- }, METHOD_PREFIXES = {
182
- Function: "",
183
- GeneratorFunction: "*",
184
- AsyncFunction: "async ",
185
- AsyncGeneratorFunction: "async *"
186
- }, TOKENS_PRECEDING_REGEXPS = new Set("case delete else in instanceof new return throw typeof void , ; : + - ! ~ & | ^ * / % < > ? =".split(" "));
187
- function dedentFunction(fnString) {
188
- let found;
189
- for (let line of fnString.split("\n").slice(1)){
190
- let m = /^[\s\t]+/.exec(line);
191
- if (!m) return fnString;
192
- let [str] = m;
193
- void 0 === found ? found = str : str.length < found.length && (found = str);
194
- }
195
- return found ? fnString.split(`\n${found}`).join("\n") : fnString;
196
- }
197
- exports.USED_METHOD_KEY = new WeakSet(), exports.functionToString = (fn, space, next, key)=>{
198
- let name = "string" == typeof key ? key : void 0;
199
- return void 0 !== name && exports.USED_METHOD_KEY.add(fn), new FunctionParser(fn, space, next, name).stringify();
200
- }, exports.dedentFunction = dedentFunction;
201
- class FunctionParser {
202
- constructor(fn, indent, next, key){
203
- this.fn = fn, this.indent = indent, this.next = next, this.key = key, this.pos = 0, this.hadKeyword = !1, this.fnString = Function.prototype.toString.call(fn), this.fnType = fn.constructor.name, this.keyQuote = void 0 === key ? "" : quote_1.quoteKey(key, next), this.keyPrefix = void 0 === key ? "" : `${this.keyQuote}:${indent ? " " : ""}`, this.isMethodCandidate = void 0 !== key && ("" === this.fn.name || this.fn.name === key);
204
- }
205
- stringify() {
206
- let value = this.tryParse();
207
- return value ? dedentFunction(value) : `${this.keyPrefix}void ${this.next(this.fnString)}`;
208
- }
209
- getPrefix() {
210
- return this.isMethodCandidate && !this.hadKeyword ? METHOD_PREFIXES[this.fnType] + this.keyQuote : this.keyPrefix + FUNCTION_PREFIXES[this.fnType];
211
- }
212
- tryParse() {
213
- if ("}" !== this.fnString[this.fnString.length - 1]) return this.keyPrefix + this.fnString;
214
- if (this.fn.name) {
215
- let result = this.tryStrippingName();
216
- if (result) return result;
217
- }
218
- let prevPos = this.pos;
219
- if ("class" === this.consumeSyntax()) return this.fnString;
220
- if (this.pos = prevPos, this.tryParsePrefixTokens()) {
221
- let result = this.tryStrippingName();
222
- if (result) return result;
223
- let offset = this.pos;
224
- switch(this.consumeSyntax("WORD_LIKE")){
225
- case "WORD_LIKE":
226
- this.isMethodCandidate && !this.hadKeyword && (offset = this.pos);
227
- case "()":
228
- if ("=>" === this.fnString.substr(this.pos, 2)) return this.keyPrefix + this.fnString;
229
- this.pos = offset;
230
- case '"':
231
- case "'":
232
- case "[]":
233
- return this.getPrefix() + this.fnString.substr(this.pos);
234
- }
235
- }
236
- }
237
- tryStrippingName() {
238
- if (METHOD_NAMES_ARE_QUOTED) return;
239
- let start = this.pos, prefix = this.fnString.substr(this.pos, this.fn.name.length);
240
- if (prefix === this.fn.name && (this.pos += prefix.length, "()" === this.consumeSyntax() && "{}" === this.consumeSyntax() && this.pos === this.fnString.length)) return (this.isMethodCandidate || !quote_1.isValidVariableName(prefix)) && (start += prefix.length), this.getPrefix() + this.fnString.substr(start);
241
- this.pos = start;
242
- }
243
- tryParsePrefixTokens() {
244
- let posPrev = this.pos;
245
- switch(this.hadKeyword = !1, this.fnType){
246
- case "AsyncFunction":
247
- if ("async" !== this.consumeSyntax()) return !1;
248
- posPrev = this.pos;
249
- case "Function":
250
- return "function" === this.consumeSyntax() ? this.hadKeyword = !0 : this.pos = posPrev, !0;
251
- case "AsyncGeneratorFunction":
252
- if ("async" !== this.consumeSyntax()) return !1;
253
- case "GeneratorFunction":
254
- let token = this.consumeSyntax();
255
- return "function" === token && (token = this.consumeSyntax(), this.hadKeyword = !0), "*" === token;
256
- }
257
- }
258
- consumeSyntax(wordLikeToken) {
259
- let m = this.consumeMatch(/^(?:([A-Za-z_0-9$\xA0-\uFFFF]+)|=>|\+\+|\-\-|.)/);
260
- if (!m) return;
261
- let [token, match] = m;
262
- if (this.consumeWhitespace(), match) return wordLikeToken || match;
263
- switch(token){
264
- case "(":
265
- return this.consumeSyntaxUntil("(", ")");
266
- case "[":
267
- return this.consumeSyntaxUntil("[", "]");
268
- case "{":
269
- return this.consumeSyntaxUntil("{", "}");
270
- case "`":
271
- return this.consumeTemplate();
272
- case '"':
273
- return this.consumeRegExp(/^(?:[^\\"]|\\.)*"/, '"');
274
- case "'":
275
- return this.consumeRegExp(/^(?:[^\\']|\\.)*'/, "'");
276
- }
277
- return token;
278
- }
279
- consumeSyntaxUntil(startToken, endToken) {
280
- let isRegExpAllowed = !0;
281
- for(;;){
282
- let token = this.consumeSyntax();
283
- if (token === endToken) return startToken + endToken;
284
- if (!token || ")" === token || "]" === token || "}" === token) return;
285
- "/" === token && isRegExpAllowed && this.consumeMatch(/^(?:\\.|[^\\\/\n[]|\[(?:\\.|[^\]])*\])+\/[a-z]*/) ? (isRegExpAllowed = !1, this.consumeWhitespace()) : isRegExpAllowed = TOKENS_PRECEDING_REGEXPS.has(token);
286
- }
287
- }
288
- consumeMatch(re) {
289
- let m = re.exec(this.fnString.substr(this.pos));
290
- return m && (this.pos += m[0].length), m;
291
- }
292
- consumeRegExp(re, token) {
293
- let m = re.exec(this.fnString.substr(this.pos));
294
- if (m) return this.pos += m[0].length, this.consumeWhitespace(), token;
295
- }
296
- consumeTemplate() {
297
- for(;;){
298
- if (this.consumeMatch(/^(?:[^`$\\]|\\.|\$(?!{))*/), "`" === this.fnString[this.pos]) return this.pos++, this.consumeWhitespace(), "`";
299
- if (!("${" === this.fnString.substr(this.pos, 2) && (this.pos += 2, this.consumeWhitespace(), this.consumeSyntaxUntil("{", "}")))) return;
300
- }
301
- }
302
- consumeWhitespace() {
303
- this.consumeMatch(/^(?:\s|\/\/.*|\/\*[^]*?\*\/)*/);
304
- }
305
- }
306
- exports.FunctionParser = FunctionParser;
307
- },
308
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
309
- exports.stringify = void 0;
310
- let stringify_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js"), quote_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), ROOT_SENTINEL = Symbol("root");
311
- function replacerToString(replacer) {
312
- return replacer ? (value, space, next, key)=>replacer(value, space, (value)=>stringify_1.toString(value, space, next, key), key) : stringify_1.toString;
313
- }
314
- exports.stringify = function stringify(value, replacer, indent, options = {}) {
315
- let space = "string" == typeof indent ? indent : " ".repeat(indent || 0), path = [], stack = new Set(), tracking = new Map(), unpack = new Map(), valueCount = 0, { maxDepth = 100, references = !1, skipUndefinedProperties = !1, maxValues = 100000 } = options, valueToString = replacerToString(replacer), onNext = (value, key)=>{
316
- if (++valueCount > maxValues || skipUndefinedProperties && void 0 === value || path.length > maxDepth) return;
317
- if (void 0 === key) return valueToString(value, space, onNext, key);
318
- path.push(key);
319
- let result = builder(value, key === ROOT_SENTINEL ? void 0 : key);
320
- return path.pop(), result;
321
- }, builder = references ? (value, key)=>{
322
- if (null !== value && ("object" == typeof value || "function" == typeof value || "symbol" == typeof value)) {
323
- if (tracking.has(value)) return unpack.set(path.slice(1), tracking.get(value)), valueToString(void 0, space, onNext, key);
324
- tracking.set(value, path.slice(1));
325
- }
326
- return valueToString(value, space, onNext, key);
327
- } : (value, key)=>{
328
- if (stack.has(value)) return;
329
- stack.add(value);
330
- let result = valueToString(value, space, onNext, key);
331
- return stack.delete(value), result;
332
- }, result = onNext(value, ROOT_SENTINEL);
333
- if (unpack.size) {
334
- let sp = space ? " " : "", eol = space ? "\n" : "", wrapper = `var x${sp}=${sp}${result};${eol}`;
335
- for (let [key, value] of unpack.entries()){
336
- let keyPath = quote_1.stringifyPath(key, onNext), valuePath = quote_1.stringifyPath(value, onNext);
337
- wrapper += `x${keyPath}${sp}=${sp}x${valuePath};${eol}`;
338
- }
339
- return `(function${sp}()${sp}{${eol}${wrapper}return x;${eol}}())`;
340
- }
341
- return result;
342
- };
343
- },
344
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js" (__unused_rspack_module, exports, __webpack_require__) {
345
- Object.defineProperty(exports, "__esModule", {
346
- value: !0
347
- }), exports.objectToString = void 0;
348
- let quote_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), function_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js"), array_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js");
349
- exports.objectToString = (value, space, next, key)=>{
350
- if ("function" == typeof Buffer && Buffer.isBuffer(value)) return `Buffer.from(${next(value.toString("base64"))}, 'base64')`;
351
- if ("object" == typeof global && value === global) return globalToString(value, space, next, key);
352
- let toString = OBJECT_TYPES[Object.prototype.toString.call(value)];
353
- return toString ? toString(value, space, next, key) : void 0;
354
- };
355
- let globalToString = (value, space, next)=>`Function(${next("return this")})()`, OBJECT_TYPES = {
356
- "[object Array]": array_1.arrayToString,
357
- "[object Object]": (obj, indent, next, key)=>{
358
- let eol = indent ? "\n" : "", space = indent ? " " : "", values = Object.keys(obj).reduce(function(values, key) {
359
- let fn = obj[key], result = next(fn, key);
360
- if (void 0 === result) return values;
361
- let value = result.split("\n").join(`\n${indent}`);
362
- return function_1.USED_METHOD_KEY.has(fn) ? values.push(`${indent}${value}`) : values.push(`${indent}${quote_1.quoteKey(key, next)}:${space}${value}`), values;
363
- }, []).join(`,${eol}`);
364
- return "" === values ? "{}" : `{${eol}${values}${eol}}`;
365
- },
366
- "[object Error]": (error, space, next)=>`new Error(${next(error.message)})`,
367
- "[object Date]": (date)=>`new Date(${date.getTime()})`,
368
- "[object String]": (str, space, next)=>`new String(${next(str.toString())})`,
369
- "[object Number]": (num)=>`new Number(${num})`,
370
- "[object Boolean]": (bool)=>`new Boolean(${bool})`,
371
- "[object Set]": (set, space, next)=>`new Set(${next(Array.from(set))})`,
372
- "[object Map]": (map, space, next)=>`new Map(${next(Array.from(map))})`,
373
- "[object RegExp]": String,
374
- "[object global]": globalToString,
375
- "[object Window]": globalToString
376
- };
377
- },
378
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js" (__unused_rspack_module, exports) {
379
- Object.defineProperty(exports, "__esModule", {
380
- value: !0
381
- }), exports.stringifyPath = exports.quoteKey = exports.isValidVariableName = exports.IS_VALID_IDENTIFIER = exports.quoteString = void 0;
382
- let ESCAPABLE = /[\\\'\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, META_CHARS = new Map([
383
- [
384
- "\b",
385
- "\\b"
386
- ],
387
- [
388
- "\t",
389
- "\\t"
390
- ],
391
- [
392
- "\n",
393
- "\\n"
394
- ],
395
- [
396
- "\f",
397
- "\\f"
398
- ],
399
- [
400
- "\r",
401
- "\\r"
402
- ],
403
- [
404
- "'",
405
- "\\'"
406
- ],
407
- [
408
- '"',
409
- '\\"'
410
- ],
411
- [
412
- "\\",
413
- "\\\\"
414
- ]
415
- ]);
416
- function escapeChar(char) {
417
- return META_CHARS.get(char) || `\\u${`0000${char.charCodeAt(0).toString(16)}`.slice(-4)}`;
418
- }
419
- exports.quoteString = function quoteString(str) {
420
- return `'${str.replace(ESCAPABLE, escapeChar)}'`;
421
- };
422
- let RESERVED_WORDS = new Set("break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "));
423
- function isValidVariableName(name) {
424
- return "string" == typeof name && !RESERVED_WORDS.has(name) && exports.IS_VALID_IDENTIFIER.test(name);
425
- }
426
- exports.IS_VALID_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/, exports.isValidVariableName = isValidVariableName, exports.quoteKey = function quoteKey(key, next) {
427
- return isValidVariableName(key) ? key : next(key);
428
- }, exports.stringifyPath = function stringifyPath(path, next) {
429
- let result = "";
430
- for (let key of path)isValidVariableName(key) ? result += `.${key}` : result += `[${next(key)}]`;
431
- return result;
432
- };
433
- },
434
- "../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js" (__unused_rspack_module, exports, __webpack_require__) {
435
- Object.defineProperty(exports, "__esModule", {
436
- value: !0
437
- }), exports.toString = void 0;
438
- let quote_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), object_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js"), function_1 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js"), PRIMITIVE_TYPES = {
439
- string: quote_1.quoteString,
440
- number: (value)=>Object.is(value, -0) ? "-0" : String(value),
441
- boolean: String,
442
- symbol: (value, space, next)=>{
443
- let key = Symbol.keyFor(value);
444
- return void 0 !== key ? `Symbol.for(${next(key)})` : `Symbol(${next(value.description)})`;
445
- },
446
- bigint: (value, space, next)=>`BigInt(${next(String(value))})`,
447
- undefined: String,
448
- object: object_1.objectToString,
449
- function: function_1.functionToString
450
- };
451
- exports.toString = (value, space, next, key)=>null === value ? "null" : PRIMITIVE_TYPES[typeof value](value, space, next, key);
452
- },
453
158
  "../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
454
159
  let path = __webpack_require__("path"), fs = __webpack_require__("fs"), os = __webpack_require__("os"), url = __webpack_require__("url"), fsReadFileAsync = fs.promises.readFile;
455
160
  function getDefaultSearchPlaces(name, sync) {
@@ -771,8 +476,8 @@ __webpack_require__.add({
771
476
  return (asyncHooks.AsyncResource && (res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')), res && res.runInAsyncScope) ? res.runInAsyncScope.bind(res, fn, null) : fn;
772
477
  }
773
478
  },
774
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
775
- let yaml, { resolve } = __webpack_require__("node:path"), config = __webpack_require__("../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js"), loadOptions = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/options.js"), loadPlugins = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js"), req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
479
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
480
+ let yaml, { resolve } = __webpack_require__("node:path"), config = __webpack_require__("../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js"), loadOptions = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/options.js"), loadPlugins = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js"), req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
776
481
  async function processResult(ctx, result) {
777
482
  let obj, file = result.filepath || '', projectConfig = ((obj = result.config) && obj.__esModule ? obj : {
778
483
  default: obj
@@ -845,8 +550,8 @@ __webpack_require__.add({
845
550
  });
846
551
  };
847
552
  },
848
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/options.js" (module, __unused_rspack_exports, __webpack_require__) {
849
- let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
553
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/options.js" (module, __unused_rspack_exports, __webpack_require__) {
554
+ let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
850
555
  module.exports = async function options(config, file) {
851
556
  if (config.parser && 'string' == typeof config.parser) try {
852
557
  config.parser = await req(config.parser, file);
@@ -866,8 +571,8 @@ __webpack_require__.add({
866
571
  return config;
867
572
  };
868
573
  },
869
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js" (module, __unused_rspack_exports, __webpack_require__) {
870
- let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
574
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js" (module, __unused_rspack_exports, __webpack_require__) {
575
+ let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
871
576
  async function load(plugin, options, file) {
872
577
  try {
873
578
  if (null == options || 0 === Object.keys(options).length) return await req(plugin, file);
@@ -883,7 +588,7 @@ __webpack_require__.add({
883
588
  }), list;
884
589
  };
885
590
  },
886
- "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/req.js" (module, __unused_rspack_exports, __webpack_require__) {
591
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/req.js" (module, __unused_rspack_exports, __webpack_require__) {
887
592
  let tsx, jiti;
888
593
  var __filename = __rspack_fileURLToPath(import.meta.url);
889
594
  let { createRequire } = __webpack_require__("node:module"), { pathToFileURL } = __webpack_require__("node:url"), TS_EXT_RE = /\.[mc]?ts$/, importError = [];
@@ -917,9 +622,6 @@ __webpack_require__.add({
917
622
  async_hooks (module) {
918
623
  module.exports = __rspack_external_async_hooks;
919
624
  },
920
- events (module) {
921
- module.exports = __rspack_external_events;
922
- },
923
625
  fs (module) {
924
626
  module.exports = __rspack_external_fs;
925
627
  },
@@ -1144,27 +846,19 @@ function getTime() {
1144
846
  let now = new Date(), hours = String(now.getHours()).padStart(2, '0'), minutes = String(now.getMinutes()).padStart(2, '0'), seconds = String(now.getSeconds()).padStart(2, '0');
1145
847
  return `${hours}:${minutes}:${seconds}`;
1146
848
  }
1147
- isDebug() && (src_logger.level = 'verbose'), src_logger.override({
1148
- debug: (message, ...args)=>{
1149
- if ('verbose' !== src_logger.level) return;
1150
- let time = color.gray(getTime());
1151
- console.log(` ${color.magenta('rsbuild')} ${time} ${message}`, ...args);
1152
- }
1153
- });
1154
- let external_events_ = __webpack_require__("events");
1155
849
  function toArr(any) {
1156
850
  return null == any ? [] : Array.isArray(any) ? any : [
1157
851
  any
1158
852
  ];
1159
853
  }
1160
854
  function toVal(out, key, val, opts) {
1161
- var x, old = out[key], nxt = ~opts.string.indexOf(key) ? null == val || !0 === val ? '' : String(val) : 'boolean' == typeof val ? val : ~opts.boolean.indexOf(key) ? 'false' !== val && ('true' === val || (out._.push(0 * (x = +val) == 0 ? x : val), !!val)) : 0 * (x = +val) == 0 ? x : val;
855
+ var x, old = out[key], nxt = ~opts.string.indexOf(key) ? null == val || !0 === val ? "" : String(val) : "boolean" == typeof val ? val : ~opts.boolean.indexOf(key) ? "false" !== val && ("true" === val || (out._.push(0 * (x = +val) == 0 ? x : val), !!val)) : 0 * (x = +val) == 0 ? x : val;
1162
856
  out[key] = null == old ? nxt : Array.isArray(old) ? old.concat(nxt) : [
1163
857
  old,
1164
858
  nxt
1165
859
  ];
1166
860
  }
1167
- function mri2(args, opts) {
861
+ function lib_default(args, opts) {
1168
862
  opts = opts || {};
1169
863
  var k, arr, arg, name, val, out = {
1170
864
  _: []
@@ -1178,21 +872,21 @@ function mri2(args, opts) {
1178
872
  }
1179
873
  let keys = strict ? Object.keys(opts.alias) : [];
1180
874
  for(i = 0; i < len; i++){
1181
- if ('--' === (arg = args[i])) {
875
+ if ("--" === (arg = args[i])) {
1182
876
  out._ = out._.concat(args.slice(++i));
1183
877
  break;
1184
878
  }
1185
879
  for(j = 0; j < arg.length && 45 === arg.charCodeAt(j); j++);
1186
880
  if (0 === j) out._.push(arg);
1187
- else if ('no-' === arg.substring(j, j + 3)) {
881
+ else if ("no-" === arg.substring(j, j + 3)) {
1188
882
  if (name = arg.substring(j + 3), strict && !~keys.indexOf(name)) return opts.unknown(arg);
1189
883
  out[name] = !1;
1190
884
  } else {
1191
885
  for(idx = j + 1; idx < arg.length && 61 !== arg.charCodeAt(idx); idx++);
1192
- for(name = arg.substring(j, idx), val = arg.substring(++idx) || i + 1 === len || 45 === ('' + args[i + 1]).charCodeAt(0) || args[++i], arr = 2 === j ? [
886
+ for(name = arg.substring(j, idx), val = arg.substring(++idx) || i + 1 === len || 45 === ("" + args[i + 1]).charCodeAt(0) || args[++i], arr = 2 === j ? [
1193
887
  name
1194
888
  ] : name, idx = 0; idx < arr.length; idx++){
1195
- if (name = arr[idx], strict && !~keys.indexOf(name)) return opts.unknown('-'.repeat(j) + name);
889
+ if (name = arr[idx], strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
1196
890
  toVal(out, name, idx + 1 < arr.length || val, opts);
1197
891
  }
1198
892
  }
@@ -1201,44 +895,117 @@ function mri2(args, opts) {
1201
895
  if (alibi) for(k in out)for(arr = opts.alias[k] || []; arr.length > 0;)out[arr.shift()] = out[k];
1202
896
  return out;
1203
897
  }
1204
- let removeBrackets = (v)=>v.replace(/[<[].+/, "").trim(), findLongest = (arr)=>arr.sort((a, b)=>a.length > b.length ? -1 : 1)[0], padRight = (str, length)=>str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`, setDotProp = (obj, keys, val)=>{
1205
- let x, i = 0, length = keys.length, t = obj;
1206
- for(; i < length; ++i)x = t[keys[i]], t = t[keys[i]] = i === length - 1 ? val : null != x ? x : ~keys[i + 1].indexOf(".") || !(+keys[i + 1] > -1) ? {} : [];
1207
- }, setByType = (obj, transforms)=>{
898
+ function removeBrackets(v) {
899
+ return v.replace(/[<[].+/, "").trim();
900
+ }
901
+ function findAllBrackets(v) {
902
+ let angledMatch, squareMatch, ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g, SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g, res = [], parse = (match)=>{
903
+ let variadic = !1, value = match[1];
904
+ return value.startsWith("...") && (value = value.slice(3), variadic = !0), {
905
+ required: match[0].startsWith("<"),
906
+ value,
907
+ variadic
908
+ };
909
+ };
910
+ for(; angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v);)res.push(parse(angledMatch));
911
+ for(; squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v);)res.push(parse(squareMatch));
912
+ return res;
913
+ }
914
+ function getMriOptions(options) {
915
+ let result = {
916
+ alias: {},
917
+ boolean: []
918
+ };
919
+ for (let [index, option] of options.entries())option.names.length > 1 && (result.alias[option.names[0]] = option.names.slice(1)), option.isBoolean && (option.negated && options.some((o, i)=>i !== index && o.names.some((name)=>option.names.includes(name)) && "boolean" == typeof o.required) || result.boolean.push(option.names[0]));
920
+ return result;
921
+ }
922
+ function findLongest(arr) {
923
+ return arr.sort((a, b)=>a.length > b.length ? -1 : 1)[0];
924
+ }
925
+ function padRight(str, length) {
926
+ return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
927
+ }
928
+ function camelcase(input) {
929
+ return input.replaceAll(/([a-z])-([a-z])/g, (_, p1, p2)=>p1 + p2.toUpperCase());
930
+ }
931
+ function setDotProp(obj, keys, val) {
932
+ let current = obj;
933
+ for(let i = 0; i < keys.length; i++){
934
+ let key = keys[i];
935
+ if (i === keys.length - 1) {
936
+ current[key] = val;
937
+ return;
938
+ }
939
+ if (null == current[key]) {
940
+ let nextKeyIsArrayIndex = +keys[i + 1] > -1;
941
+ current[key] = nextKeyIsArrayIndex ? [] : {};
942
+ }
943
+ current = current[key];
944
+ }
945
+ }
946
+ function setByType(obj, transforms) {
1208
947
  for (let key of Object.keys(transforms)){
1209
948
  let transform = transforms[key];
1210
- transform.shouldTransform && (obj[key] = Array.prototype.concat.call([], obj[key]), "function" == typeof transform.transformFunction && (obj[key] = obj[key].map(transform.transformFunction)));
949
+ transform.shouldTransform && (obj[key] = [
950
+ obj[key]
951
+ ].flat(), "function" == typeof transform.transformFunction && (obj[key] = obj[key].map(transform.transformFunction)));
952
+ }
953
+ }
954
+ function getFileName(input) {
955
+ let m = /([^\\/]+)$/.exec(input);
956
+ return m ? m[1] : "";
957
+ }
958
+ function camelcaseOptionName(name) {
959
+ return name.split(".").map((v, i)=>0 === i ? camelcase(v) : v).join(".");
960
+ }
961
+ isDebug() && (src_logger.level = 'verbose'), src_logger.override({
962
+ debug: (message, ...args)=>{
963
+ if ('verbose' !== src_logger.level) return;
964
+ let time = color.gray(getTime());
965
+ console.log(` ${color.magenta('rsbuild')} ${time} ${message}`, ...args);
1211
966
  }
1212
- }, camelcaseOptionName = (name)=>name.split(".").map((v, i)=>0 === i ? v.replace(/([a-z])-([a-z])/g, (_, p1, p2)=>p1 + p2.toUpperCase()) : v).join(".");
1213
- class CACError extends Error {
967
+ });
968
+ var superClass, superClass1, CACError = class extends Error {
1214
969
  constructor(message){
1215
- super(message), this.name = this.constructor.name, "function" == typeof Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = Error(message).stack;
970
+ super(message), this.name = "CACError", "function" != typeof Error.captureStackTrace && (this.stack = Error(message).stack);
1216
971
  }
1217
- }
1218
- class Option {
972
+ }, Option = class {
973
+ rawName;
974
+ description;
975
+ name;
976
+ names;
977
+ isBoolean;
978
+ required;
979
+ config;
980
+ negated;
1219
981
  constructor(rawName, description, config){
1220
- this.rawName = rawName, this.description = description, this.config = Object.assign({}, config), rawName = rawName.replace(/\.\*/g, ""), this.negated = !1, this.names = removeBrackets(rawName).split(",").map((v)=>{
982
+ this.rawName = rawName, this.description = description, this.config = Object.assign({}, config), rawName = rawName.replaceAll(".*", ""), this.negated = !1, this.names = removeBrackets(rawName).split(",").map((v)=>{
1221
983
  let name = v.trim().replace(/^-{1,2}/, "");
1222
984
  return name.startsWith("no-") && (this.negated = !0, name = name.replace(/^no-/, "")), camelcaseOptionName(name);
1223
- }).sort((a, b)=>a.length > b.length ? 1 : -1), this.name = this.names[this.names.length - 1], this.negated && null == this.config.default && (this.config.default = !0), rawName.includes("<") ? this.required = !0 : rawName.includes("[") ? this.required = !1 : this.isBoolean = !0;
985
+ }).sort((a, b)=>a.length > b.length ? 1 : -1), this.name = this.names.at(-1), this.negated && null == this.config.default && (this.config.default = !0), rawName.includes("<") ? this.required = !0 : rawName.includes("[") ? this.required = !1 : this.isBoolean = !0;
1224
986
  }
1225
- }
1226
- let processArgs = process.argv, platformInfo = `${process.platform}-${process.arch} node-${process.version}`;
1227
- class Command {
987
+ };
988
+ if ("u" > typeof process) {
989
+ let runtimeName;
990
+ runtimeName = "u" > typeof Deno && "string" == typeof Deno.version?.deno ? "deno" : "u" > typeof Bun && "string" == typeof Bun.version ? "bun" : "node", runtimeInfo = `${process.platform}-${process.arch} ${runtimeName}-${process.version}`, runtimeProcessArgs = process.argv;
991
+ } else runtimeInfo = "u" < typeof navigator ? "unknown" : `${navigator.platform} ${navigator.userAgent}`;
992
+ var Command = class {
993
+ rawName;
994
+ description;
995
+ config;
996
+ cli;
997
+ options;
998
+ aliasNames;
999
+ name;
1000
+ args;
1001
+ commandAction;
1002
+ usageText;
1003
+ versionNumber;
1004
+ examples;
1005
+ helpCallback;
1006
+ globalCommand;
1228
1007
  constructor(rawName, description, config = {}, cli){
1229
- this.rawName = rawName, this.description = description, this.config = config, this.cli = cli, this.options = [], this.aliasNames = [], this.name = removeBrackets(rawName), this.args = ((v)=>{
1230
- let angledMatch, squareMatch, ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g, SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g, res = [], parse = (match)=>{
1231
- let variadic = !1, value = match[1];
1232
- return value.startsWith("...") && (value = value.slice(3), variadic = !0), {
1233
- required: match[0].startsWith("<"),
1234
- value,
1235
- variadic
1236
- };
1237
- };
1238
- for(; angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v);)res.push(parse(angledMatch));
1239
- for(; squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v);)res.push(parse(squareMatch));
1240
- return res;
1241
- })(rawName), this.examples = [];
1008
+ this.rawName = rawName, this.description = description, this.config = config, this.cli = cli, this.options = [], this.aliasNames = [], this.name = removeBrackets(rawName), this.args = findAllBrackets(rawName), this.examples = [];
1242
1009
  }
1243
1010
  usage(text) {
1244
1011
  return this.usageText = text, this;
@@ -1291,221 +1058,612 @@ class Command {
1291
1058
  sections.push({
1292
1059
  title: "Commands",
1293
1060
  body: commands.map((command)=>` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`).join("\n")
1294
- }), sections.push({
1061
+ }, {
1295
1062
  title: "For more info, run any command with the `--help` flag",
1296
1063
  body: commands.map((command)=>` $ ${name}${"" === command.name ? "" : ` ${command.name}`} --help`).join("\n")
1297
1064
  });
1298
1065
  }
1299
- let options = this.isGlobalCommand ? globalOptions : [
1300
- ...this.options,
1301
- ...globalOptions || []
1302
- ];
1303
- if (this.isGlobalCommand || this.isDefaultCommand || (options = options.filter((option)=>"version" !== option.name)), options.length > 0) {
1304
- let longestOptionName = findLongest(options.map((option)=>option.rawName));
1305
- sections.push({
1306
- title: "Options",
1307
- body: options.map((option)=>` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${void 0 === option.config.default ? "" : `(default: ${option.config.default})`}`).join("\n")
1066
+ let options = this.isGlobalCommand ? globalOptions : [
1067
+ ...this.options,
1068
+ ...globalOptions || []
1069
+ ];
1070
+ if (this.isGlobalCommand || this.isDefaultCommand || (options = options.filter((option)=>"version" !== option.name)), options.length > 0) {
1071
+ let longestOptionName = findLongest(options.map((option)=>option.rawName));
1072
+ sections.push({
1073
+ title: "Options",
1074
+ body: options.map((option)=>` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${void 0 === option.config.default ? "" : `(default: ${option.config.default})`}`).join("\n")
1075
+ });
1076
+ }
1077
+ this.examples.length > 0 && sections.push({
1078
+ title: "Examples",
1079
+ body: this.examples.map((example)=>"function" == typeof example ? example(name) : example).join("\n")
1080
+ }), helpCallback && (sections = helpCallback(sections) || sections), console.info(sections.map((section)=>section.title ? `${section.title}:\n${section.body}` : section.body).join("\n\n"));
1081
+ }
1082
+ outputVersion() {
1083
+ let { name } = this.cli, { versionNumber } = this.cli.globalCommand;
1084
+ versionNumber && console.info(`${name}/${versionNumber} ${runtimeInfo}`);
1085
+ }
1086
+ checkRequiredArgs() {
1087
+ let minimalArgsCount = this.args.filter((arg)=>arg.required).length;
1088
+ if (this.cli.args.length < minimalArgsCount) throw new CACError(`missing required args for command \`${this.rawName}\``);
1089
+ }
1090
+ checkUnknownOptions() {
1091
+ let { options, globalCommand } = this.cli;
1092
+ if (!this.config.allowUnknownOptions) {
1093
+ for (let name of Object.keys(options))if ("--" !== name && !this.hasOption(name) && !globalCommand.hasOption(name)) throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
1094
+ }
1095
+ }
1096
+ checkOptionValue() {
1097
+ let { options: parsedOptions, globalCommand } = this.cli, options = [
1098
+ ...globalCommand.options,
1099
+ ...this.options
1100
+ ];
1101
+ for (let option of options){
1102
+ let value = parsedOptions[option.name.split(".")[0]];
1103
+ if (option.required) {
1104
+ let hasNegated = options.some((o)=>o.negated && o.names.includes(option.name));
1105
+ if (!0 === value || !1 === value && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
1106
+ }
1107
+ }
1108
+ }
1109
+ checkUnusedArgs() {
1110
+ let maximumArgsCount = this.args.some((arg)=>arg.variadic) ? 1 / 0 : this.args.length;
1111
+ if (maximumArgsCount < this.cli.args.length) throw new CACError(`Unused args: ${this.cli.args.slice(maximumArgsCount).map((arg)=>`\`${arg}\``).join(", ")}`);
1112
+ }
1113
+ }, GlobalCommand = class extends Command {
1114
+ constructor(cli){
1115
+ super("@@global@@", "", {}, cli);
1116
+ }
1117
+ }, CAC = class extends EventTarget {
1118
+ name;
1119
+ commands;
1120
+ globalCommand;
1121
+ matchedCommand;
1122
+ matchedCommandName;
1123
+ rawArgs;
1124
+ args;
1125
+ options;
1126
+ showHelpOnExit;
1127
+ showVersionOnExit;
1128
+ constructor(name = ""){
1129
+ super(), this.name = name, this.commands = [], this.rawArgs = [], this.args = [], this.options = {}, this.globalCommand = new GlobalCommand(this), this.globalCommand.usage("<command> [options]");
1130
+ }
1131
+ usage(text) {
1132
+ return this.globalCommand.usage(text), this;
1133
+ }
1134
+ command(rawName, description, config) {
1135
+ let command = new Command(rawName, description || "", config, this);
1136
+ return command.globalCommand = this.globalCommand, this.commands.push(command), command;
1137
+ }
1138
+ option(rawName, description, config) {
1139
+ return this.globalCommand.option(rawName, description, config), this;
1140
+ }
1141
+ help(callback) {
1142
+ return this.globalCommand.option("-h, --help", "Display this message"), this.globalCommand.helpCallback = callback, this.showHelpOnExit = !0, this;
1143
+ }
1144
+ version(version, customFlags = "-v, --version") {
1145
+ return this.globalCommand.version(version, customFlags), this.showVersionOnExit = !0, this;
1146
+ }
1147
+ example(example) {
1148
+ return this.globalCommand.example(example), this;
1149
+ }
1150
+ outputHelp() {
1151
+ this.matchedCommand ? this.matchedCommand.outputHelp() : this.globalCommand.outputHelp();
1152
+ }
1153
+ outputVersion() {
1154
+ this.globalCommand.outputVersion();
1155
+ }
1156
+ setParsedInfo({ args, options }, matchedCommand, matchedCommandName) {
1157
+ return this.args = args, this.options = options, matchedCommand && (this.matchedCommand = matchedCommand), matchedCommandName && (this.matchedCommandName = matchedCommandName), this;
1158
+ }
1159
+ unsetMatchedCommand() {
1160
+ this.matchedCommand = void 0, this.matchedCommandName = void 0;
1161
+ }
1162
+ parse(argv, { run = !0 } = {}) {
1163
+ if (!argv) {
1164
+ if (!runtimeProcessArgs) throw Error("No argv provided and runtime process argv is not available.");
1165
+ argv = runtimeProcessArgs;
1166
+ }
1167
+ this.rawArgs = argv, this.name || (this.name = argv[1] ? getFileName(argv[1]) : "cli");
1168
+ let shouldParse = !0;
1169
+ for (let command of this.commands){
1170
+ let parsed = this.mri(argv.slice(2), command), commandName = parsed.args[0];
1171
+ if (command.isMatched(commandName)) {
1172
+ shouldParse = !1;
1173
+ let parsedInfo = {
1174
+ ...parsed,
1175
+ args: parsed.args.slice(1)
1176
+ };
1177
+ this.setParsedInfo(parsedInfo, command, commandName), this.dispatchEvent(new CustomEvent(`command:${commandName}`, {
1178
+ detail: command
1179
+ }));
1180
+ }
1181
+ }
1182
+ if (shouldParse) {
1183
+ for (let command of this.commands)if (command.isDefaultCommand) {
1184
+ shouldParse = !1;
1185
+ let parsed = this.mri(argv.slice(2), command);
1186
+ this.setParsedInfo(parsed, command), this.dispatchEvent(new CustomEvent("command:!", {
1187
+ detail: command
1188
+ }));
1189
+ }
1190
+ }
1191
+ if (shouldParse) {
1192
+ let parsed = this.mri(argv.slice(2));
1193
+ this.setParsedInfo(parsed);
1194
+ }
1195
+ this.options.help && this.showHelpOnExit && (this.outputHelp(), run = !1, this.unsetMatchedCommand()), this.options.version && this.showVersionOnExit && null == this.matchedCommandName && (this.outputVersion(), run = !1, this.unsetMatchedCommand());
1196
+ let parsedArgv = {
1197
+ args: this.args,
1198
+ options: this.options
1199
+ };
1200
+ return run && this.runMatchedCommand(), !this.matchedCommand && this.args[0] && this.dispatchEvent(new CustomEvent("command:*", {
1201
+ detail: this.args[0]
1202
+ })), parsedArgv;
1203
+ }
1204
+ mri(argv, command) {
1205
+ let cliOptions = [
1206
+ ...this.globalCommand.options,
1207
+ ...command ? command.options : []
1208
+ ], mriOptions = getMriOptions(cliOptions), argsAfterDoubleDashes = [], doubleDashesIndex = argv.indexOf("--");
1209
+ -1 !== doubleDashesIndex && (argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1), argv = argv.slice(0, doubleDashesIndex));
1210
+ let parsed = lib_default(argv, mriOptions), args = (parsed = Object.keys(parsed).reduce((res, name)=>({
1211
+ ...res,
1212
+ [camelcaseOptionName(name)]: parsed[name]
1213
+ }), {
1214
+ _: []
1215
+ }))._, options = {
1216
+ "--": argsAfterDoubleDashes
1217
+ }, ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue, transforms = Object.create(null);
1218
+ for (let cliOption of cliOptions){
1219
+ if (!ignoreDefault && void 0 !== cliOption.config.default) for (let name of cliOption.names)options[name] = cliOption.config.default;
1220
+ Array.isArray(cliOption.config.type) && void 0 === transforms[cliOption.name] && (transforms[cliOption.name] = Object.create(null), transforms[cliOption.name].shouldTransform = !0, transforms[cliOption.name].transformFunction = cliOption.config.type[0]);
1221
+ }
1222
+ for (let key of Object.keys(parsed))"_" !== key && (setDotProp(options, key.split("."), parsed[key]), setByType(options, transforms));
1223
+ return {
1224
+ args,
1225
+ options
1226
+ };
1227
+ }
1228
+ runMatchedCommand() {
1229
+ let { args, options, matchedCommand: command } = this;
1230
+ if (!command || !command.commandAction) return;
1231
+ command.checkUnknownOptions(), command.checkOptionValue(), command.checkRequiredArgs(), command.checkUnusedArgs();
1232
+ let actionArgs = [];
1233
+ return command.args.forEach((arg, index)=>{
1234
+ arg.variadic ? actionArgs.push(args.slice(index)) : actionArgs.push(args[index]);
1235
+ }), actionArgs.push(options), command.commandAction.apply(this, actionArgs);
1236
+ }
1237
+ };
1238
+ let external_node_path_ = __webpack_require__("node:path"), isDeno = "u" > typeof Deno, isWindows = 'win32' === process.platform, ROOT_DIST_DIR = 'dist', dirname = import.meta.dirname, STATIC_PATH = (0, external_node_path_.join)(dirname, '../static'), CLIENT_PATH = (0, external_node_path_.join)(dirname, 'client'), COMPILED_PATH = (0, external_node_path_.join)(dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', LOCALHOST = 'localhost', ALL_INTERFACES_IPV4 = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_STACK_TRACE = 'summary', DEFAULT_WEB_BROWSERSLIST = [
1239
+ 'chrome >= 107',
1240
+ 'edge >= 107',
1241
+ 'firefox >= 104',
1242
+ 'safari >= 16'
1243
+ ], DEFAULT_BROWSERSLIST = {
1244
+ web: DEFAULT_WEB_BROWSERSLIST,
1245
+ 'web-worker': DEFAULT_WEB_BROWSERSLIST,
1246
+ node: [
1247
+ 'node >= 20'
1248
+ ]
1249
+ }, JS_REGEX = /\.(?:js|mjs|cjs|jsx)$/, SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, CSS_REGEX = /\.css$/, RAW_QUERY_REGEX = /[?&]raw(?:&|=|$)/, INLINE_QUERY_REGEX = /[?&]inline(?:&|=|$)/, NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/, PLUGIN_SWC_NAME = 'rsbuild:swc', PLUGIN_CSS_NAME = 'rsbuild:css', FONT_EXTENSIONS = [
1250
+ 'woff',
1251
+ 'woff2',
1252
+ 'eot',
1253
+ 'ttf',
1254
+ 'otf',
1255
+ 'ttc'
1256
+ ], IMAGE_EXTENSIONS = [
1257
+ 'png',
1258
+ 'jpg',
1259
+ 'jpeg',
1260
+ 'pjpeg',
1261
+ 'pjp',
1262
+ 'gif',
1263
+ 'bmp',
1264
+ 'webp',
1265
+ 'ico',
1266
+ 'apng',
1267
+ 'avif',
1268
+ 'tif',
1269
+ 'tiff',
1270
+ 'jfif',
1271
+ 'cur'
1272
+ ], VIDEO_EXTENSIONS = [
1273
+ 'mp4',
1274
+ 'webm',
1275
+ 'ogg',
1276
+ 'mov'
1277
+ ], AUDIO_EXTENSIONS = [
1278
+ 'mp3',
1279
+ 'wav',
1280
+ 'flac',
1281
+ 'aac',
1282
+ 'm4a',
1283
+ 'opus'
1284
+ ], LAZY_COMPILATION_IDENTIFIER = 'lazy-compilation-proxy';
1285
+ var __webpack_modules__ = {}, __webpack_module_cache__ = {};
1286
+ function __nested_rspack_require_65__(moduleId) {
1287
+ var cachedModule = __webpack_module_cache__[moduleId];
1288
+ if (void 0 !== cachedModule) return cachedModule.exports;
1289
+ var module = __webpack_module_cache__[moduleId] = {
1290
+ exports: {}
1291
+ };
1292
+ return __webpack_modules__[moduleId](module, module.exports, __nested_rspack_require_65__), module.exports;
1293
+ }
1294
+ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65__.add = function(modules) {
1295
+ Object.assign(__nested_rspack_require_65__.m, modules);
1296
+ }, __nested_rspack_require_65__.add({
1297
+ "./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js" (module) {
1298
+ var isMergeableObject = function(value) {
1299
+ return isNonNullObject(value) && !isSpecial(value);
1300
+ };
1301
+ function isNonNullObject(value) {
1302
+ return !!value && 'object' == typeof value;
1303
+ }
1304
+ function isSpecial(value) {
1305
+ var stringValue = Object.prototype.toString.call(value);
1306
+ return '[object RegExp]' === stringValue || '[object Date]' === stringValue || isReactElement(value);
1307
+ }
1308
+ var REACT_ELEMENT_TYPE = 'function' == typeof Symbol && Symbol.for ? Symbol.for('react.element') : 0xeac7;
1309
+ function isReactElement(value) {
1310
+ return value.$$typeof === REACT_ELEMENT_TYPE;
1311
+ }
1312
+ function emptyTarget(val) {
1313
+ return Array.isArray(val) ? [] : {};
1314
+ }
1315
+ function cloneUnlessOtherwiseSpecified(value, options) {
1316
+ return !1 !== options.clone && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
1317
+ }
1318
+ function defaultArrayMerge(target, source, options) {
1319
+ return target.concat(source).map(function(element) {
1320
+ return cloneUnlessOtherwiseSpecified(element, options);
1308
1321
  });
1309
1322
  }
1310
- this.examples.length > 0 && sections.push({
1311
- title: "Examples",
1312
- body: this.examples.map((example)=>"function" == typeof example ? example(name) : example).join("\n")
1313
- }), helpCallback && (sections = helpCallback(sections) || sections), console.log(sections.map((section)=>section.title ? `${section.title}:
1314
- ${section.body}` : section.body).join("\n\n"));
1315
- }
1316
- outputVersion() {
1317
- let { name } = this.cli, { versionNumber } = this.cli.globalCommand;
1318
- versionNumber && console.log(`${name}/${versionNumber} ${platformInfo}`);
1319
- }
1320
- checkRequiredArgs() {
1321
- let minimalArgsCount = this.args.filter((arg)=>arg.required).length;
1322
- if (this.cli.args.length < minimalArgsCount) throw new CACError(`missing required args for command \`${this.rawName}\``);
1323
- }
1324
- checkUnknownOptions() {
1325
- let { options, globalCommand } = this.cli;
1326
- if (!this.config.allowUnknownOptions) {
1327
- for (let name of Object.keys(options))if ("--" !== name && !this.hasOption(name) && !globalCommand.hasOption(name)) throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
1323
+ function getMergeFunction(key, options) {
1324
+ if (!options.customMerge) return deepmerge;
1325
+ var customMerge = options.customMerge(key);
1326
+ return 'function' == typeof customMerge ? customMerge : deepmerge;
1328
1327
  }
1329
- }
1330
- checkOptionValue() {
1331
- let { options: parsedOptions, globalCommand } = this.cli, options = [
1332
- ...globalCommand.options,
1333
- ...this.options
1334
- ];
1335
- for (let option of options){
1336
- let value = parsedOptions[option.name.split(".")[0]];
1337
- if (option.required) {
1338
- let hasNegated = options.some((o)=>o.negated && o.names.includes(option.name));
1339
- if (!0 === value || !1 === value && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
1328
+ function getEnumerableOwnPropertySymbols(target) {
1329
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
1330
+ return Object.propertyIsEnumerable.call(target, symbol);
1331
+ }) : [];
1332
+ }
1333
+ function getKeys(target) {
1334
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
1335
+ }
1336
+ function propertyIsOnObject(object, property) {
1337
+ try {
1338
+ return property in object;
1339
+ } catch (_) {
1340
+ return !1;
1340
1341
  }
1341
1342
  }
1342
- }
1343
- }
1344
- class GlobalCommand extends Command {
1345
- constructor(cli){
1346
- super("@@global@@", "", {}, cli);
1347
- }
1348
- }
1349
- var superClass, superClass1, __assign = Object.assign;
1350
- class CAC extends external_events_.EventEmitter {
1351
- constructor(name = ""){
1352
- super(), this.name = name, this.commands = [], this.rawArgs = [], this.args = [], this.options = {}, this.globalCommand = new GlobalCommand(this), this.globalCommand.usage("<command> [options]");
1353
- }
1354
- usage(text) {
1355
- return this.globalCommand.usage(text), this;
1356
- }
1357
- command(rawName, description, config) {
1358
- let command = new Command(rawName, description || "", config, this);
1359
- return command.globalCommand = this.globalCommand, this.commands.push(command), command;
1360
- }
1361
- option(rawName, description, config) {
1362
- return this.globalCommand.option(rawName, description, config), this;
1363
- }
1364
- help(callback) {
1365
- return this.globalCommand.option("-h, --help", "Display this message"), this.globalCommand.helpCallback = callback, this.showHelpOnExit = !0, this;
1366
- }
1367
- version(version, customFlags = "-v, --version") {
1368
- return this.globalCommand.version(version, customFlags), this.showVersionOnExit = !0, this;
1369
- }
1370
- example(example) {
1371
- return this.globalCommand.example(example), this;
1372
- }
1373
- outputHelp() {
1374
- this.matchedCommand ? this.matchedCommand.outputHelp() : this.globalCommand.outputHelp();
1375
- }
1376
- outputVersion() {
1377
- this.globalCommand.outputVersion();
1378
- }
1379
- setParsedInfo({ args, options }, matchedCommand, matchedCommandName) {
1380
- return this.args = args, this.options = options, matchedCommand && (this.matchedCommand = matchedCommand), matchedCommandName && (this.matchedCommandName = matchedCommandName), this;
1381
- }
1382
- unsetMatchedCommand() {
1383
- this.matchedCommand = void 0, this.matchedCommandName = void 0;
1384
- }
1385
- parse(argv = processArgs, { run = !0 } = {}) {
1386
- var input;
1387
- let m;
1388
- this.rawArgs = argv, this.name || (this.name = argv[1] ? (input = argv[1], (m = /([^\\\/]+)$/.exec(input)) ? m[1] : "") : "cli");
1389
- let shouldParse = !0;
1390
- for (let command of this.commands){
1391
- let parsed = this.mri(argv.slice(2), command), commandName = parsed.args[0];
1392
- if (command.isMatched(commandName)) {
1393
- shouldParse = !1;
1394
- let parsedInfo = __assign(__assign({}, parsed), {
1395
- args: parsed.args.slice(1)
1396
- });
1397
- this.setParsedInfo(parsedInfo, command, commandName), this.emit(`command:${commandName}`, command);
1343
+ function propertyIsUnsafe(target, key) {
1344
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
1345
+ }
1346
+ function mergeObject(target, source, options) {
1347
+ var destination = {};
1348
+ return options.isMergeableObject(target) && getKeys(target).forEach(function(key) {
1349
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
1350
+ }), getKeys(source).forEach(function(key) {
1351
+ propertyIsUnsafe(target, key) || (propertyIsOnObject(target, key) && options.isMergeableObject(source[key]) ? destination[key] = getMergeFunction(key, options)(target[key], source[key], options) : destination[key] = cloneUnlessOtherwiseSpecified(source[key], options));
1352
+ }), destination;
1353
+ }
1354
+ function deepmerge(target, source, options) {
1355
+ (options = options || {}).arrayMerge = options.arrayMerge || defaultArrayMerge, options.isMergeableObject = options.isMergeableObject || isMergeableObject, options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
1356
+ var sourceIsArray = Array.isArray(source);
1357
+ return sourceIsArray !== Array.isArray(target) ? cloneUnlessOtherwiseSpecified(source, options) : sourceIsArray ? options.arrayMerge(target, source, options) : mergeObject(target, source, options);
1358
+ }
1359
+ deepmerge.all = function(array, options) {
1360
+ if (!Array.isArray(array)) throw Error('first argument should be an array');
1361
+ return array.reduce(function(prev, next) {
1362
+ return deepmerge(prev, next, options);
1363
+ }, {});
1364
+ }, module.exports = deepmerge;
1365
+ },
1366
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js" (__unused_rspack_module, exports) {
1367
+ Object.defineProperty(exports, "__esModule", {
1368
+ value: !0
1369
+ }), exports.arrayToString = void 0, exports.arrayToString = (array, space, next)=>{
1370
+ let values = array.map(function(value, index) {
1371
+ let result = next(value, index);
1372
+ return void 0 === result ? String(result) : space + result.split("\n").join(`\n${space}`);
1373
+ }).join(space ? ",\n" : ","), eol = space && values ? "\n" : "";
1374
+ return `[${eol}${values}${eol}]`;
1375
+ };
1376
+ },
1377
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js" (__unused_rspack_module, exports, __webpack_require__) {
1378
+ Object.defineProperty(exports, "__esModule", {
1379
+ value: !0
1380
+ }), exports.FunctionParser = exports.dedentFunction = exports.functionToString = exports.USED_METHOD_KEY = void 0;
1381
+ let quote_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), METHOD_NAMES_ARE_QUOTED = '"' === ({
1382
+ " " () {}
1383
+ })[" "].toString().charAt(0), FUNCTION_PREFIXES = {
1384
+ Function: "function ",
1385
+ GeneratorFunction: "function* ",
1386
+ AsyncFunction: "async function ",
1387
+ AsyncGeneratorFunction: "async function* "
1388
+ }, METHOD_PREFIXES = {
1389
+ Function: "",
1390
+ GeneratorFunction: "*",
1391
+ AsyncFunction: "async ",
1392
+ AsyncGeneratorFunction: "async *"
1393
+ }, TOKENS_PRECEDING_REGEXPS = new Set("case delete else in instanceof new return throw typeof void , ; : + - ! ~ & | ^ * / % < > ? =".split(" "));
1394
+ function dedentFunction(fnString) {
1395
+ let found;
1396
+ for (let line of fnString.split("\n").slice(1)){
1397
+ let m = /^[\s\t]+/.exec(line);
1398
+ if (!m) return fnString;
1399
+ let [str] = m;
1400
+ void 0 === found ? found = str : str.length < found.length && (found = str);
1401
+ }
1402
+ return found ? fnString.split(`\n${found}`).join("\n") : fnString;
1403
+ }
1404
+ exports.USED_METHOD_KEY = new WeakSet(), exports.functionToString = (fn, space, next, key)=>{
1405
+ let name = "string" == typeof key ? key : void 0;
1406
+ return void 0 !== name && exports.USED_METHOD_KEY.add(fn), new FunctionParser(fn, space, next, name).stringify();
1407
+ }, exports.dedentFunction = dedentFunction;
1408
+ class FunctionParser {
1409
+ constructor(fn, indent, next, key){
1410
+ this.fn = fn, this.indent = indent, this.next = next, this.key = key, this.pos = 0, this.hadKeyword = !1, this.fnString = Function.prototype.toString.call(fn), this.fnType = fn.constructor.name, this.keyQuote = void 0 === key ? "" : quote_1.quoteKey(key, next), this.keyPrefix = void 0 === key ? "" : `${this.keyQuote}:${indent ? " " : ""}`, this.isMethodCandidate = void 0 !== key && ("" === this.fn.name || this.fn.name === key);
1411
+ }
1412
+ stringify() {
1413
+ let value = this.tryParse();
1414
+ return value ? dedentFunction(value) : `${this.keyPrefix}void ${this.next(this.fnString)}`;
1415
+ }
1416
+ getPrefix() {
1417
+ return this.isMethodCandidate && !this.hadKeyword ? METHOD_PREFIXES[this.fnType] + this.keyQuote : this.keyPrefix + FUNCTION_PREFIXES[this.fnType];
1418
+ }
1419
+ tryParse() {
1420
+ if ("}" !== this.fnString[this.fnString.length - 1]) return this.keyPrefix + this.fnString;
1421
+ if (this.fn.name) {
1422
+ let result = this.tryStrippingName();
1423
+ if (result) return result;
1424
+ }
1425
+ let prevPos = this.pos;
1426
+ if ("class" === this.consumeSyntax()) return this.fnString;
1427
+ if (this.pos = prevPos, this.tryParsePrefixTokens()) {
1428
+ let result = this.tryStrippingName();
1429
+ if (result) return result;
1430
+ let offset = this.pos;
1431
+ switch(this.consumeSyntax("WORD_LIKE")){
1432
+ case "WORD_LIKE":
1433
+ this.isMethodCandidate && !this.hadKeyword && (offset = this.pos);
1434
+ case "()":
1435
+ if ("=>" === this.fnString.substr(this.pos, 2)) return this.keyPrefix + this.fnString;
1436
+ this.pos = offset;
1437
+ case '"':
1438
+ case "'":
1439
+ case "[]":
1440
+ return this.getPrefix() + this.fnString.substr(this.pos);
1441
+ }
1442
+ }
1443
+ }
1444
+ tryStrippingName() {
1445
+ if (METHOD_NAMES_ARE_QUOTED) return;
1446
+ let start = this.pos, prefix = this.fnString.substr(this.pos, this.fn.name.length);
1447
+ if (prefix === this.fn.name && (this.pos += prefix.length, "()" === this.consumeSyntax() && "{}" === this.consumeSyntax() && this.pos === this.fnString.length)) return (this.isMethodCandidate || !quote_1.isValidVariableName(prefix)) && (start += prefix.length), this.getPrefix() + this.fnString.substr(start);
1448
+ this.pos = start;
1449
+ }
1450
+ tryParsePrefixTokens() {
1451
+ let posPrev = this.pos;
1452
+ switch(this.hadKeyword = !1, this.fnType){
1453
+ case "AsyncFunction":
1454
+ if ("async" !== this.consumeSyntax()) return !1;
1455
+ posPrev = this.pos;
1456
+ case "Function":
1457
+ return "function" === this.consumeSyntax() ? this.hadKeyword = !0 : this.pos = posPrev, !0;
1458
+ case "AsyncGeneratorFunction":
1459
+ if ("async" !== this.consumeSyntax()) return !1;
1460
+ case "GeneratorFunction":
1461
+ let token = this.consumeSyntax();
1462
+ return "function" === token && (token = this.consumeSyntax(), this.hadKeyword = !0), "*" === token;
1463
+ }
1464
+ }
1465
+ consumeSyntax(wordLikeToken) {
1466
+ let m = this.consumeMatch(/^(?:([A-Za-z_0-9$\xA0-\uFFFF]+)|=>|\+\+|\-\-|.)/);
1467
+ if (!m) return;
1468
+ let [token, match] = m;
1469
+ if (this.consumeWhitespace(), match) return wordLikeToken || match;
1470
+ switch(token){
1471
+ case "(":
1472
+ return this.consumeSyntaxUntil("(", ")");
1473
+ case "[":
1474
+ return this.consumeSyntaxUntil("[", "]");
1475
+ case "{":
1476
+ return this.consumeSyntaxUntil("{", "}");
1477
+ case "`":
1478
+ return this.consumeTemplate();
1479
+ case '"':
1480
+ return this.consumeRegExp(/^(?:[^\\"]|\\.)*"/, '"');
1481
+ case "'":
1482
+ return this.consumeRegExp(/^(?:[^\\']|\\.)*'/, "'");
1483
+ }
1484
+ return token;
1398
1485
  }
1399
- }
1400
- if (shouldParse) {
1401
- for (let command of this.commands)if ("" === command.name) {
1402
- shouldParse = !1;
1403
- let parsed = this.mri(argv.slice(2), command);
1404
- this.setParsedInfo(parsed, command), this.emit("command:!", command);
1486
+ consumeSyntaxUntil(startToken, endToken) {
1487
+ let isRegExpAllowed = !0;
1488
+ for(;;){
1489
+ let token = this.consumeSyntax();
1490
+ if (token === endToken) return startToken + endToken;
1491
+ if (!token || ")" === token || "]" === token || "}" === token) return;
1492
+ "/" === token && isRegExpAllowed && this.consumeMatch(/^(?:\\.|[^\\\/\n[]|\[(?:\\.|[^\]])*\])+\/[a-z]*/) ? (isRegExpAllowed = !1, this.consumeWhitespace()) : isRegExpAllowed = TOKENS_PRECEDING_REGEXPS.has(token);
1493
+ }
1494
+ }
1495
+ consumeMatch(re) {
1496
+ let m = re.exec(this.fnString.substr(this.pos));
1497
+ return m && (this.pos += m[0].length), m;
1498
+ }
1499
+ consumeRegExp(re, token) {
1500
+ let m = re.exec(this.fnString.substr(this.pos));
1501
+ if (m) return this.pos += m[0].length, this.consumeWhitespace(), token;
1502
+ }
1503
+ consumeTemplate() {
1504
+ for(;;){
1505
+ if (this.consumeMatch(/^(?:[^`$\\]|\\.|\$(?!{))*/), "`" === this.fnString[this.pos]) return this.pos++, this.consumeWhitespace(), "`";
1506
+ if (!("${" === this.fnString.substr(this.pos, 2) && (this.pos += 2, this.consumeWhitespace(), this.consumeSyntaxUntil("{", "}")))) return;
1507
+ }
1508
+ }
1509
+ consumeWhitespace() {
1510
+ this.consumeMatch(/^(?:\s|\/\/.*|\/\*[^]*?\*\/)*/);
1405
1511
  }
1406
1512
  }
1407
- if (shouldParse) {
1408
- let parsed = this.mri(argv.slice(2));
1409
- this.setParsedInfo(parsed);
1513
+ exports.FunctionParser = FunctionParser;
1514
+ },
1515
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
1516
+ exports.stringify = void 0;
1517
+ let stringify_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js"), quote_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), ROOT_SENTINEL = Symbol("root");
1518
+ function replacerToString(replacer) {
1519
+ return replacer ? (value, space, next, key)=>replacer(value, space, (value)=>stringify_1.toString(value, space, next, key), key) : stringify_1.toString;
1410
1520
  }
1411
- this.options.help && this.showHelpOnExit && (this.outputHelp(), run = !1, this.unsetMatchedCommand()), this.options.version && this.showVersionOnExit && null == this.matchedCommandName && (this.outputVersion(), run = !1, this.unsetMatchedCommand());
1412
- let parsedArgv = {
1413
- args: this.args,
1414
- options: this.options
1415
- };
1416
- return run && this.runMatchedCommand(), !this.matchedCommand && this.args[0] && this.emit("command:*"), parsedArgv;
1417
- }
1418
- mri(argv, command) {
1419
- let cliOptions = [
1420
- ...this.globalCommand.options,
1421
- ...command ? command.options : []
1422
- ], mriOptions = ((options)=>{
1423
- let result = {
1424
- alias: {},
1425
- boolean: []
1426
- };
1427
- for (let [index, option] of options.entries())option.names.length > 1 && (result.alias[option.names[0]] = option.names.slice(1)), option.isBoolean && (option.negated && options.some((o, i)=>i !== index && o.names.some((name)=>option.names.includes(name)) && "boolean" == typeof o.required) || result.boolean.push(option.names[0]));
1521
+ exports.stringify = function stringify(value, replacer, indent, options = {}) {
1522
+ let space = "string" == typeof indent ? indent : " ".repeat(indent || 0), path = [], stack = new Set(), tracking = new Map(), unpack = new Map(), valueCount = 0, { maxDepth = 100, references = !1, skipUndefinedProperties = !1, maxValues = 100000 } = options, valueToString = replacerToString(replacer), onNext = (value, key)=>{
1523
+ if (++valueCount > maxValues || skipUndefinedProperties && void 0 === value || path.length > maxDepth) return;
1524
+ if (void 0 === key) return valueToString(value, space, onNext, key);
1525
+ path.push(key);
1526
+ let result = builder(value, key === ROOT_SENTINEL ? void 0 : key);
1527
+ return path.pop(), result;
1528
+ }, builder = references ? (value, key)=>{
1529
+ if (null !== value && ("object" == typeof value || "function" == typeof value || "symbol" == typeof value)) {
1530
+ if (tracking.has(value)) return unpack.set(path.slice(1), tracking.get(value)), valueToString(void 0, space, onNext, key);
1531
+ tracking.set(value, path.slice(1));
1532
+ }
1533
+ return valueToString(value, space, onNext, key);
1534
+ } : (value, key)=>{
1535
+ if (stack.has(value)) return;
1536
+ stack.add(value);
1537
+ let result = valueToString(value, space, onNext, key);
1538
+ return stack.delete(value), result;
1539
+ }, result = onNext(value, ROOT_SENTINEL);
1540
+ if (unpack.size) {
1541
+ let sp = space ? " " : "", eol = space ? "\n" : "", wrapper = `var x${sp}=${sp}${result};${eol}`;
1542
+ for (let [key, value] of unpack.entries()){
1543
+ let keyPath = quote_1.stringifyPath(key, onNext), valuePath = quote_1.stringifyPath(value, onNext);
1544
+ wrapper += `x${keyPath}${sp}=${sp}x${valuePath};${eol}`;
1545
+ }
1546
+ return `(function${sp}()${sp}{${eol}${wrapper}return x;${eol}}())`;
1547
+ }
1428
1548
  return result;
1429
- })(cliOptions), argsAfterDoubleDashes = [], doubleDashesIndex = argv.indexOf("--");
1430
- doubleDashesIndex > -1 && (argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1), argv = argv.slice(0, doubleDashesIndex));
1431
- let parsed = mri2(argv, mriOptions), args = (parsed = Object.keys(parsed).reduce((res, name)=>__assign(__assign({}, res), {
1432
- [camelcaseOptionName(name)]: parsed[name]
1433
- }), {
1434
- _: []
1435
- }))._, options = {
1436
- "--": argsAfterDoubleDashes
1437
- }, ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue, transforms = Object.create(null);
1438
- for (let cliOption of cliOptions){
1439
- if (!ignoreDefault && void 0 !== cliOption.config.default) for (let name of cliOption.names)options[name] = cliOption.config.default;
1440
- Array.isArray(cliOption.config.type) && void 0 === transforms[cliOption.name] && (transforms[cliOption.name] = Object.create(null), transforms[cliOption.name].shouldTransform = !0, transforms[cliOption.name].transformFunction = cliOption.config.type[0]);
1549
+ };
1550
+ },
1551
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js" (__unused_rspack_module, exports, __webpack_require__) {
1552
+ Object.defineProperty(exports, "__esModule", {
1553
+ value: !0
1554
+ }), exports.objectToString = void 0;
1555
+ let quote_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), function_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js"), array_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js");
1556
+ exports.objectToString = (value, space, next, key)=>{
1557
+ if ("function" == typeof Buffer && Buffer.isBuffer(value)) return `Buffer.from(${next(value.toString("base64"))}, 'base64')`;
1558
+ if ("object" == typeof global && value === global) return globalToString(value, space, next, key);
1559
+ let toString = OBJECT_TYPES[Object.prototype.toString.call(value)];
1560
+ return toString ? toString(value, space, next, key) : void 0;
1561
+ };
1562
+ let globalToString = (value, space, next)=>`Function(${next("return this")})()`, OBJECT_TYPES = {
1563
+ "[object Array]": array_1.arrayToString,
1564
+ "[object Object]": (obj, indent, next, key)=>{
1565
+ let eol = indent ? "\n" : "", space = indent ? " " : "", values = Object.keys(obj).reduce(function(values, key) {
1566
+ let fn = obj[key], result = next(fn, key);
1567
+ if (void 0 === result) return values;
1568
+ let value = result.split("\n").join(`\n${indent}`);
1569
+ return function_1.USED_METHOD_KEY.has(fn) ? values.push(`${indent}${value}`) : values.push(`${indent}${quote_1.quoteKey(key, next)}:${space}${value}`), values;
1570
+ }, []).join(`,${eol}`);
1571
+ return "" === values ? "{}" : `{${eol}${values}${eol}}`;
1572
+ },
1573
+ "[object Error]": (error, space, next)=>`new Error(${next(error.message)})`,
1574
+ "[object Date]": (date)=>`new Date(${date.getTime()})`,
1575
+ "[object String]": (str, space, next)=>`new String(${next(str.toString())})`,
1576
+ "[object Number]": (num)=>`new Number(${num})`,
1577
+ "[object Boolean]": (bool)=>`new Boolean(${bool})`,
1578
+ "[object Set]": (set, space, next)=>`new Set(${next(Array.from(set))})`,
1579
+ "[object Map]": (map, space, next)=>`new Map(${next(Array.from(map))})`,
1580
+ "[object RegExp]": String,
1581
+ "[object global]": globalToString,
1582
+ "[object Window]": globalToString
1583
+ };
1584
+ },
1585
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js" (__unused_rspack_module, exports) {
1586
+ Object.defineProperty(exports, "__esModule", {
1587
+ value: !0
1588
+ }), exports.stringifyPath = exports.quoteKey = exports.isValidVariableName = exports.IS_VALID_IDENTIFIER = exports.quoteString = void 0;
1589
+ let ESCAPABLE = /[\\\'\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, META_CHARS = new Map([
1590
+ [
1591
+ "\b",
1592
+ "\\b"
1593
+ ],
1594
+ [
1595
+ "\t",
1596
+ "\\t"
1597
+ ],
1598
+ [
1599
+ "\n",
1600
+ "\\n"
1601
+ ],
1602
+ [
1603
+ "\f",
1604
+ "\\f"
1605
+ ],
1606
+ [
1607
+ "\r",
1608
+ "\\r"
1609
+ ],
1610
+ [
1611
+ "'",
1612
+ "\\'"
1613
+ ],
1614
+ [
1615
+ '"',
1616
+ '\\"'
1617
+ ],
1618
+ [
1619
+ "\\",
1620
+ "\\\\"
1621
+ ]
1622
+ ]);
1623
+ function escapeChar(char) {
1624
+ return META_CHARS.get(char) || `\\u${`0000${char.charCodeAt(0).toString(16)}`.slice(-4)}`;
1441
1625
  }
1442
- for (let key of Object.keys(parsed))"_" !== key && (setDotProp(options, key.split("."), parsed[key]), setByType(options, transforms));
1443
- return {
1444
- args,
1445
- options
1626
+ exports.quoteString = function quoteString(str) {
1627
+ return `'${str.replace(ESCAPABLE, escapeChar)}'`;
1446
1628
  };
1447
- }
1448
- runMatchedCommand() {
1449
- let { args, options, matchedCommand: command } = this;
1450
- if (!command || !command.commandAction) return;
1451
- command.checkUnknownOptions(), command.checkOptionValue(), command.checkRequiredArgs();
1452
- let actionArgs = [];
1453
- return command.args.forEach((arg, index)=>{
1454
- arg.variadic ? actionArgs.push(args.slice(index)) : actionArgs.push(args[index]);
1455
- }), actionArgs.push(options), command.commandAction.apply(this, actionArgs);
1456
- }
1457
- }
1458
- let external_node_path_ = __webpack_require__("node:path"), isDeno = "u" > typeof Deno, isWindows = 'win32' === process.platform, ROOT_DIST_DIR = 'dist', dirname = import.meta.dirname, STATIC_PATH = (0, external_node_path_.join)(dirname, '../static'), CLIENT_PATH = (0, external_node_path_.join)(dirname, 'client'), COMPILED_PATH = (0, external_node_path_.join)(dirname, '../compiled'), RSBUILD_OUTPUTS_PATH = '.rsbuild', LOCALHOST = 'localhost', ALL_INTERFACES_IPV4 = '0.0.0.0', DEFAULT_ASSET_PREFIX = '/', DEFAULT_STACK_TRACE = 'summary', DEFAULT_WEB_BROWSERSLIST = [
1459
- 'chrome >= 107',
1460
- 'edge >= 107',
1461
- 'firefox >= 104',
1462
- 'safari >= 16'
1463
- ], DEFAULT_BROWSERSLIST = {
1464
- web: DEFAULT_WEB_BROWSERSLIST,
1465
- 'web-worker': DEFAULT_WEB_BROWSERSLIST,
1466
- node: [
1467
- 'node >= 20'
1468
- ]
1469
- }, JS_REGEX = /\.(?:js|mjs|cjs|jsx)$/, SCRIPT_REGEX = /\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/, CSS_REGEX = /\.css$/, RAW_QUERY_REGEX = /[?&]raw(?:&|=|$)/, INLINE_QUERY_REGEX = /[?&]inline(?:&|=|$)/, NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/, PLUGIN_SWC_NAME = 'rsbuild:swc', PLUGIN_CSS_NAME = 'rsbuild:css', FONT_EXTENSIONS = [
1470
- 'woff',
1471
- 'woff2',
1472
- 'eot',
1473
- 'ttf',
1474
- 'otf',
1475
- 'ttc'
1476
- ], IMAGE_EXTENSIONS = [
1477
- 'png',
1478
- 'jpg',
1479
- 'jpeg',
1480
- 'pjpeg',
1481
- 'pjp',
1482
- 'gif',
1483
- 'bmp',
1484
- 'webp',
1485
- 'ico',
1486
- 'apng',
1487
- 'avif',
1488
- 'tif',
1489
- 'tiff',
1490
- 'jfif',
1491
- 'cur'
1492
- ], VIDEO_EXTENSIONS = [
1493
- 'mp4',
1494
- 'webm',
1495
- 'ogg',
1496
- 'mov'
1497
- ], AUDIO_EXTENSIONS = [
1498
- 'mp3',
1499
- 'wav',
1500
- 'flac',
1501
- 'aac',
1502
- 'm4a',
1503
- 'opus'
1504
- ], LAZY_COMPILATION_IDENTIFIER = 'lazy-compilation-proxy', cjs = __webpack_require__("../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
1505
- var cjs_default = __webpack_require__.n(cjs);
1506
- let dist_0 = __webpack_require__("../../node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js");
1629
+ let RESERVED_WORDS = new Set("break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "));
1630
+ function isValidVariableName(name) {
1631
+ return "string" == typeof name && !RESERVED_WORDS.has(name) && exports.IS_VALID_IDENTIFIER.test(name);
1632
+ }
1633
+ exports.IS_VALID_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/, exports.isValidVariableName = isValidVariableName, exports.quoteKey = function quoteKey(key, next) {
1634
+ return isValidVariableName(key) ? key : next(key);
1635
+ }, exports.stringifyPath = function stringifyPath(path, next) {
1636
+ let result = "";
1637
+ for (let key of path)isValidVariableName(key) ? result += `.${key}` : result += `[${next(key)}]`;
1638
+ return result;
1639
+ };
1640
+ },
1641
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js" (__unused_rspack_module, exports, __webpack_require__) {
1642
+ Object.defineProperty(exports, "__esModule", {
1643
+ value: !0
1644
+ }), exports.toString = void 0;
1645
+ let quote_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), object_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js"), function_1 = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js"), PRIMITIVE_TYPES = {
1646
+ string: quote_1.quoteString,
1647
+ number: (value)=>Object.is(value, -0) ? "-0" : String(value),
1648
+ boolean: String,
1649
+ symbol: (value, space, next)=>{
1650
+ let key = Symbol.keyFor(value);
1651
+ return void 0 !== key ? `Symbol.for(${next(key)})` : `Symbol(${next(value.description)})`;
1652
+ },
1653
+ bigint: (value, space, next)=>`BigInt(${next(String(value))})`,
1654
+ undefined: String,
1655
+ object: object_1.objectToString,
1656
+ function: function_1.functionToString
1657
+ };
1658
+ exports.toString = (value, space, next, key)=>null === value ? "null" : PRIMITIVE_TYPES[typeof value](value, space, next, key);
1659
+ }
1660
+ });
1661
+ let cjs = __nested_rspack_require_65__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
1507
1662
  function createMap(superClass) {
1508
1663
  return class extends superClass {
1664
+ constructor(...args){
1665
+ super(...args), this.store = new Map();
1666
+ }
1509
1667
  extend(methods) {
1510
1668
  return this.shorthands = methods, methods.forEach((method)=>{
1511
1669
  this[method] = (value)=>this.set(method, value);
@@ -1556,7 +1714,7 @@ function createMap(superClass) {
1556
1714
  return Object.keys(obj).forEach((key)=>{
1557
1715
  if (omit.includes(key)) return;
1558
1716
  let value = obj[key];
1559
- (Array.isArray(value) || 'object' == typeof value) && null !== value && this.has(key) ? this.set(key, cjs_default()(this.get(key), value)) : this.set(key, value);
1717
+ (Array.isArray(value) || 'object' == typeof value) && null !== value && this.has(key) ? this.set(key, cjs(this.get(key), value)) : this.set(key, value);
1560
1718
  }), this;
1561
1719
  }
1562
1720
  clean(obj) {
@@ -1568,34 +1726,34 @@ function createMap(superClass) {
1568
1726
  when(condition, whenTruthy = Function.prototype, whenFalsy = Function.prototype) {
1569
1727
  return condition ? whenTruthy(this) : whenFalsy(this), this;
1570
1728
  }
1571
- constructor(...args){
1572
- super(...args), this.store = new Map();
1573
- }
1574
1729
  };
1575
1730
  }
1576
1731
  function createChainable(superClass) {
1577
1732
  return class extends superClass {
1733
+ constructor(parent){
1734
+ super(), this.parent = parent;
1735
+ }
1578
1736
  batch(handler) {
1579
1737
  return handler(this), this;
1580
1738
  }
1581
1739
  end() {
1582
1740
  return this.parent;
1583
1741
  }
1584
- constructor(parent){
1585
- super(), this.parent = parent;
1586
- }
1587
1742
  };
1588
1743
  }
1589
1744
  let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superClass = createMap(createChainable(class extends Function {
1590
- classCall() {
1591
- throw Error('not implemented');
1592
- }
1593
1745
  constructor(){
1594
1746
  return super(), new Proxy(this, {
1595
1747
  apply: (target, thisArg, args)=>target.classCall(...args)
1596
1748
  });
1597
1749
  }
1750
+ classCall() {
1751
+ throw Error('not implemented');
1752
+ }
1598
1753
  })), class extends superClass {
1754
+ constructor(...args){
1755
+ super(...args), this.value = void 0, this.useMap = !0;
1756
+ }
1599
1757
  set(...args) {
1600
1758
  return this.useMap = !0, this.value = void 0, super.set(...args);
1601
1759
  }
@@ -1611,10 +1769,10 @@ let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superCla
1611
1769
  values() {
1612
1770
  return this.useMap ? super.values() : this.value;
1613
1771
  }
1772
+ }), ChainedSet = (superClass1 = createChainable(Object), class extends superClass1 {
1614
1773
  constructor(...args){
1615
- super(...args), this.value = void 0, this.useMap = !0;
1774
+ super(...args), this.store = new Set();
1616
1775
  }
1617
- }), ChainedSet = (superClass1 = createChainable(Object), class extends superClass1 {
1618
1776
  add(value) {
1619
1777
  return this.store.add(value), this;
1620
1778
  }
@@ -1647,9 +1805,6 @@ let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superCla
1647
1805
  when(condition, whenTruthy = Function.prototype, whenFalsy = Function.prototype) {
1648
1806
  return condition ? whenTruthy(this) : whenFalsy(this), this;
1649
1807
  }
1650
- constructor(...args){
1651
- super(...args), this.store = new Set();
1652
- }
1653
1808
  }), childMaps = [
1654
1809
  'alias',
1655
1810
  'fallback',
@@ -1667,8 +1822,20 @@ let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superCla
1667
1822
  'restrictions',
1668
1823
  'roots',
1669
1824
  'modules'
1670
- ];
1671
- class Resolve_class extends ChainedMap {
1825
+ ], Resolve = class extends ChainedMap {
1826
+ constructor(parent){
1827
+ super(parent), childMaps.forEach((key)=>{
1828
+ this[key] = new ChainedMap(this);
1829
+ }), childSets.forEach((key)=>{
1830
+ this[key] = new ChainedSet(this);
1831
+ }), this.extend([
1832
+ 'enforceExtension',
1833
+ 'symlinks',
1834
+ 'preferRelative',
1835
+ 'preferAbsolute',
1836
+ 'tsConfig'
1837
+ ]);
1838
+ }
1672
1839
  get(key) {
1673
1840
  return childMaps.includes(key) ? this[key].entries() : childSets.includes(key) ? this[key].values() : super.get(key);
1674
1841
  }
@@ -1692,21 +1859,10 @@ class Resolve_class extends ChainedMap {
1692
1859
  ...omissions
1693
1860
  ]);
1694
1861
  }
1862
+ }, ResolveLoader = class extends Resolve {
1695
1863
  constructor(parent){
1696
- super(parent), childMaps.forEach((key)=>{
1697
- this[key] = new ChainedMap(this);
1698
- }), childSets.forEach((key)=>{
1699
- this[key] = new ChainedSet(this);
1700
- }), this.extend([
1701
- 'enforceExtension',
1702
- 'symlinks',
1703
- 'preferRelative',
1704
- 'preferAbsolute',
1705
- 'tsConfig'
1706
- ]);
1864
+ super(parent), this.modules = new ChainedSet(this), this.moduleExtensions = new ChainedSet(this), this.packageMains = new ChainedSet(this);
1707
1865
  }
1708
- }
1709
- class ResolveLoader_class extends Resolve_class {
1710
1866
  toConfig() {
1711
1867
  return this.clean({
1712
1868
  modules: this.modules.values(),
@@ -1728,11 +1884,7 @@ class ResolveLoader_class extends Resolve_class {
1728
1884
  ...omissions
1729
1885
  ]);
1730
1886
  }
1731
- constructor(parent){
1732
- super(parent), this.modules = new ChainedSet(this), this.moduleExtensions = new ChainedSet(this), this.packageMains = new ChainedSet(this);
1733
- }
1734
- }
1735
- class Output_class extends ChainedMap {
1887
+ }, Output = class extends ChainedMap {
1736
1888
  constructor(parent){
1737
1889
  super(parent), this.extend([
1738
1890
  'assetModuleFilename',
@@ -1778,19 +1930,7 @@ class Output_class extends ChainedMap {
1778
1930
  'clean'
1779
1931
  ]);
1780
1932
  }
1781
- }
1782
- class DevServer_class extends ChainedMap {
1783
- toConfig() {
1784
- return this.clean({
1785
- allowedHosts: this.allowedHosts.values(),
1786
- ...this.entries() || {}
1787
- });
1788
- }
1789
- merge(obj, omit = []) {
1790
- return !omit.includes('allowedHosts') && 'allowedHosts' in obj && this.allowedHosts.merge(obj.allowedHosts), super.merge(obj, [
1791
- 'allowedHosts'
1792
- ]);
1793
- }
1933
+ }, DevServer = class extends ChainedMap {
1794
1934
  constructor(parent){
1795
1935
  super(parent), this.allowedHosts = new ChainedSet(this), this.extend([
1796
1936
  'after',
@@ -1845,8 +1985,18 @@ class DevServer_class extends ChainedMap {
1845
1985
  'writeToDisk'
1846
1986
  ]);
1847
1987
  }
1848
- }
1849
- let Orderable = (Class)=>class extends Class {
1988
+ toConfig() {
1989
+ return this.clean({
1990
+ allowedHosts: this.allowedHosts.values(),
1991
+ ...this.entries() || {}
1992
+ });
1993
+ }
1994
+ merge(obj, omit = []) {
1995
+ return !omit.includes('allowedHosts') && 'allowedHosts' in obj && this.allowedHosts.merge(obj.allowedHosts), super.merge(obj, [
1996
+ 'allowedHosts'
1997
+ ]);
1998
+ }
1999
+ }, Orderable = (Class)=>class extends Class {
1850
2000
  before(name) {
1851
2001
  if (this.__after) throw Error(`Unable to set .before(${JSON.stringify(name)}) with existing value for .after()`);
1852
2002
  return this.__before = name, this;
@@ -1863,6 +2013,11 @@ let Orderable = (Class)=>class extends Class {
1863
2013
  ]);
1864
2014
  }
1865
2015
  }, src_Plugin = Orderable(class extends ChainedMap {
2016
+ constructor(parent, name, type = 'plugin'){
2017
+ super(parent), this.name = name, this.type = type, this.extend([
2018
+ 'init'
2019
+ ]), this.init((Plugin, args = [])=>'function' == typeof Plugin ? new Plugin(...args) : Plugin);
2020
+ }
1866
2021
  use(plugin, args = []) {
1867
2022
  return this.set('plugin', plugin).set('args', args);
1868
2023
  }
@@ -1904,17 +2059,19 @@ let Orderable = (Class)=>class extends Class {
1904
2059
  }
1905
2060
  }), config;
1906
2061
  }
1907
- constructor(parent, name, type = 'plugin'){
1908
- super(parent), this.name = name, this.type = type, this.extend([
1909
- 'init'
1910
- ]), this.init((Plugin, args = [])=>'function' == typeof Plugin ? new Plugin(...args) : Plugin);
1911
- }
1912
2062
  }), Use = Orderable(class extends ChainedMap {
2063
+ constructor(parent, name){
2064
+ super(parent), this.name = name, this.extend([
2065
+ 'loader',
2066
+ 'options',
2067
+ 'parallel'
2068
+ ]);
2069
+ }
1913
2070
  tap(f) {
1914
2071
  return this.options(f(this.get('options'))), this;
1915
2072
  }
1916
2073
  merge(obj, omit = []) {
1917
- return !omit.includes('loader') && 'loader' in obj && this.loader(obj.loader), !omit.includes('options') && 'options' in obj && this.options(cjs_default()(this.store.get('options') || {}, obj.options)), super.merge(obj, [
2074
+ return !omit.includes('loader') && 'loader' in obj && this.loader(obj.loader), !omit.includes('options') && 'options' in obj && this.options(cjs(this.store.get('options') || {}, obj.options)), super.merge(obj, [
1918
2075
  ...omit,
1919
2076
  'loader',
1920
2077
  'options'
@@ -1934,13 +2091,6 @@ let Orderable = (Class)=>class extends Class {
1934
2091
  }
1935
2092
  }), config;
1936
2093
  }
1937
- constructor(parent, name){
1938
- super(parent), this.name = name, this.extend([
1939
- 'loader',
1940
- 'options',
1941
- 'parallel'
1942
- ]);
1943
- }
1944
2094
  });
1945
2095
  function toArray(arr) {
1946
2096
  return Array.isArray(arr) ? arr : [
@@ -1948,6 +2098,30 @@ function toArray(arr) {
1948
2098
  ];
1949
2099
  }
1950
2100
  let Rule = Orderable(class extends ChainedMap {
2101
+ constructor(parent, name, ruleType = 'rule'){
2102
+ super(parent), this.ruleName = name, this.names = [], this.ruleType = ruleType, this.ruleTypes = [];
2103
+ let rule = this;
2104
+ for(; rule instanceof Rule;)this.names.unshift(rule.ruleName), this.ruleTypes.unshift(rule.ruleType), rule = rule.parent;
2105
+ this.uses = new ChainedMap(this), this.include = new ChainedSet(this), this.exclude = new ChainedSet(this), this.rules = new ChainedMap(this), this.oneOfs = new ChainedMap(this), this.resolve = new Resolve(this), this.resolve.extend([
2106
+ 'fullySpecified'
2107
+ ]), this.extend([
2108
+ 'dependency',
2109
+ 'enforce',
2110
+ 'issuer',
2111
+ 'issuerLayer',
2112
+ 'layer',
2113
+ 'mimetype',
2114
+ 'parser',
2115
+ 'generator',
2116
+ 'resource',
2117
+ 'resourceFragment',
2118
+ 'resourceQuery',
2119
+ 'sideEffects',
2120
+ 'with',
2121
+ 'test',
2122
+ 'type'
2123
+ ]);
2124
+ }
1951
2125
  use(name) {
1952
2126
  return this.uses.getOrCompute(name, ()=>new Use(this, name));
1953
2127
  }
@@ -1993,32 +2167,12 @@ let Rule = Orderable(class extends ChainedMap {
1993
2167
  'test'
1994
2168
  ]);
1995
2169
  }
1996
- constructor(parent, name, ruleType = 'rule'){
1997
- super(parent), this.ruleName = name, this.names = [], this.ruleType = ruleType, this.ruleTypes = [];
1998
- let rule = this;
1999
- for(; rule instanceof Rule;)this.names.unshift(rule.ruleName), this.ruleTypes.unshift(rule.ruleType), rule = rule.parent;
2000
- this.uses = new ChainedMap(this), this.include = new ChainedSet(this), this.exclude = new ChainedSet(this), this.rules = new ChainedMap(this), this.oneOfs = new ChainedMap(this), this.resolve = new Resolve_class(this), this.resolve.extend([
2001
- 'fullySpecified'
2002
- ]), this.extend([
2003
- 'dependency',
2004
- 'enforce',
2005
- 'issuer',
2006
- 'issuerLayer',
2007
- 'layer',
2008
- 'mimetype',
2009
- 'parser',
2010
- 'generator',
2011
- 'resource',
2012
- 'resourceFragment',
2013
- 'resourceQuery',
2014
- 'sideEffects',
2015
- 'with',
2016
- 'test',
2017
- 'type'
2170
+ }), dist_Module = class extends ChainedMap {
2171
+ constructor(parent){
2172
+ super(parent), this.rules = new ChainedMap(this), this.defaultRules = new ChainedMap(this), this.generator = new ChainedMap(this), this.parser = new ChainedMap(this), this.extend([
2173
+ 'noParse'
2018
2174
  ]);
2019
2175
  }
2020
- });
2021
- class Module_class extends ChainedMap {
2022
2176
  defaultRule(name) {
2023
2177
  return this.defaultRules.getOrCompute(name, ()=>new Rule(this, name, 'defaultRule'));
2024
2178
  }
@@ -2039,30 +2193,7 @@ class Module_class extends ChainedMap {
2039
2193
  'defaultRule'
2040
2194
  ]);
2041
2195
  }
2042
- constructor(parent){
2043
- super(parent), this.rules = new ChainedMap(this), this.defaultRules = new ChainedMap(this), this.generator = new ChainedMap(this), this.parser = new ChainedMap(this), this.extend([
2044
- 'noParse',
2045
- 'unsafeCache'
2046
- ]);
2047
- }
2048
- }
2049
- class Optimization_class extends ChainedMap {
2050
- minimizer(name) {
2051
- if (Array.isArray(name)) throw Error("optimization.minimizer() no longer supports being passed an array. Either switch to the new syntax (https://github.com/neutrinojs/webpack-chain#config-optimization-minimizers-adding) or downgrade to webpack-chain 4. If using Vue this likely means a Vue plugin has not yet been updated to support Vue CLI 4+.");
2052
- return this.minimizers.getOrCompute(name, ()=>new src_Plugin(this, name, 'optimization.minimizer'));
2053
- }
2054
- toConfig() {
2055
- return this.clean(Object.assign(this.entries() || {}, {
2056
- splitChunks: this.splitChunks.entries(),
2057
- minimizer: this.minimizers.values().map((plugin)=>plugin.toConfig())
2058
- }));
2059
- }
2060
- merge(obj, omit = []) {
2061
- return !omit.includes('minimizer') && 'minimizer' in obj && Object.keys(obj.minimizer).forEach((name)=>this.minimizer(name).merge(obj.minimizer[name])), super.merge(obj, [
2062
- ...omit,
2063
- 'minimizer'
2064
- ]);
2065
- }
2196
+ }, Optimization = class extends ChainedMap {
2066
2197
  constructor(parent){
2067
2198
  super(parent), this.minimizers = new ChainedMap(this), this.splitChunks = new ChainedValueMap(this), this.extend([
2068
2199
  'minimize',
@@ -2085,8 +2216,23 @@ class Optimization_class extends ChainedMap {
2085
2216
  'avoidEntryIife'
2086
2217
  ]);
2087
2218
  }
2088
- }
2089
- class Performance_class extends ChainedValueMap {
2219
+ minimizer(name) {
2220
+ if (Array.isArray(name)) throw Error("optimization.minimizer() no longer supports being passed an array. Either switch to the new syntax (https://github.com/neutrinojs/webpack-chain#config-optimization-minimizers-adding) or downgrade to webpack-chain 4. If using Vue this likely means a Vue plugin has not yet been updated to support Vue CLI 4+.");
2221
+ return this.minimizers.getOrCompute(name, ()=>new src_Plugin(this, name, 'optimization.minimizer'));
2222
+ }
2223
+ toConfig() {
2224
+ return this.clean(Object.assign(this.entries() || {}, {
2225
+ splitChunks: this.splitChunks.entries(),
2226
+ minimizer: this.minimizers.values().map((plugin)=>plugin.toConfig())
2227
+ }));
2228
+ }
2229
+ merge(obj, omit = []) {
2230
+ return !omit.includes('minimizer') && 'minimizer' in obj && Object.keys(obj.minimizer).forEach((name)=>this.minimizer(name).merge(obj.minimizer[name])), super.merge(obj, [
2231
+ ...omit,
2232
+ 'minimizer'
2233
+ ]);
2234
+ }
2235
+ }, Performance = class extends ChainedValueMap {
2090
2236
  constructor(parent){
2091
2237
  super(parent), this.extend([
2092
2238
  'assetFilter',
@@ -2095,13 +2241,36 @@ class Performance_class extends ChainedValueMap {
2095
2241
  'maxEntrypointSize'
2096
2242
  ]);
2097
2243
  }
2098
- }
2099
- let castArray = (value)=>Array.isArray(value) ? value : [
2244
+ }, dist = __nested_rspack_require_65__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js"), castArray = (value)=>Array.isArray(value) ? value : [
2100
2245
  value
2101
- ];
2102
- class src_class extends ChainedMap {
2246
+ ], dist_src = class extends ChainedMap {
2247
+ constructor(){
2248
+ super(), this.entryPoints = new ChainedMap(this), this.output = new Output(this), this.module = new dist_Module(this), this.resolve = new Resolve(this), this.resolveLoader = new ResolveLoader(this), this.optimization = new Optimization(this), this.plugins = new ChainedMap(this), this.devServer = new DevServer(this), this.performance = new Performance(this), this.node = new ChainedValueMap(this), this.extend([
2249
+ 'context',
2250
+ 'mode',
2251
+ 'devtool',
2252
+ 'target',
2253
+ 'watch',
2254
+ 'watchOptions',
2255
+ 'externals',
2256
+ 'externalsType',
2257
+ 'externalsPresets',
2258
+ 'stats',
2259
+ 'experiments',
2260
+ 'amd',
2261
+ 'bail',
2262
+ 'cache',
2263
+ 'dependencies',
2264
+ 'ignoreWarnings',
2265
+ 'loader',
2266
+ 'name',
2267
+ 'infrastructureLogging',
2268
+ 'snapshot',
2269
+ 'lazyCompilation'
2270
+ ]);
2271
+ }
2103
2272
  static toString(config, { verbose = !1, configPrefix = 'config' } = {}) {
2104
- return (0, dist_0.stringify)(config, (value, indent, stringify)=>{
2273
+ return (0, dist.stringify)(config, (value, indent, stringify)=>{
2105
2274
  if (value && value.__pluginName) {
2106
2275
  let prefix = `/* ${configPrefix}.${value.__pluginType}('${value.__pluginName}') */\n`, constructorExpression = value.__pluginPath ? `(require(${stringify(value.__pluginPath)}))` : value.__pluginConstructorName;
2107
2276
  if (constructorExpression) {
@@ -2116,7 +2285,7 @@ class src_class extends ChainedMap {
2116
2285
  let ruleTypes = value.__ruleTypes;
2117
2286
  return `/* ${configPrefix}.module${value.__ruleNames.map((r, index)=>`.${ruleTypes ? ruleTypes[index] : 'rule'}('${r}')`).join('')}${value.__useName ? `.use('${value.__useName}')` : ""} */\n` + stringify(value);
2118
2287
  }
2119
- return value && value.__expression ? value.__expression : 'function' == typeof value && !verbose && value.toString().length > 100 ? "function () { /* omitted long function */ }" : stringify(value);
2288
+ return value && value.__expression ? value.__expression : 'function' == typeof value && !verbose && value.toString().length > 100 ? `function ${value.name || ''}() { /* omitted long function */ }` : stringify(value);
2120
2289
  }, 2);
2121
2290
  }
2122
2291
  entry(name) {
@@ -2182,38 +2351,13 @@ class src_class extends ChainedMap {
2182
2351
  'plugin'
2183
2352
  ]);
2184
2353
  }
2185
- constructor(){
2186
- super(), this.entryPoints = new ChainedMap(this), this.output = new Output_class(this), this.module = new Module_class(this), this.resolve = new Resolve_class(this), this.resolveLoader = new ResolveLoader_class(this), this.optimization = new Optimization_class(this), this.plugins = new ChainedMap(this), this.devServer = new DevServer_class(this), this.performance = new Performance_class(this), this.node = new ChainedValueMap(this), this.extend([
2187
- 'context',
2188
- 'mode',
2189
- 'devtool',
2190
- 'target',
2191
- 'watch',
2192
- 'watchOptions',
2193
- 'externals',
2194
- 'externalsType',
2195
- 'externalsPresets',
2196
- 'stats',
2197
- 'experiments',
2198
- 'amd',
2199
- 'bail',
2200
- 'cache',
2201
- 'dependencies',
2202
- 'ignoreWarnings',
2203
- 'loader',
2204
- 'profile',
2205
- 'name',
2206
- 'infrastructureLogging',
2207
- 'snapshot',
2208
- 'lazyCompilation'
2209
- ]);
2210
- }
2211
- }
2212
- let external_node_module_ = __webpack_require__("node:module"), vendors_require = (0, external_node_module_.createRequire)(import.meta.url), requireCompiledPackage = (name)=>vendors_require(`${COMPILED_PATH}/${name}/index.js`), setNodeEnv = (env)=>{
2354
+ }, external_node_module_ = __webpack_require__("node:module"), vendors_require = (0, external_node_module_.createRequire)(import.meta.url), requireCompiledPackage = (name)=>vendors_require(`${COMPILED_PATH}/${name}/index.js`), cjs_0 = __webpack_require__("../../node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
2355
+ var cjs_0_default = __webpack_require__.n(cjs_0);
2356
+ let setNodeEnv = (env)=>{
2213
2357
  process.env.NODE_ENV = env;
2214
2358
  }, isFunction = (func)=>'function' == typeof func, isObject = (obj)=>'[object Object]' === Object.prototype.toString.call(obj), objectPrototype = Object.prototype, getProto = Object.getPrototypeOf, isPlainObject = (obj)=>null !== obj && 'object' == typeof obj && getProto(obj) === objectPrototype, helpers_castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
2215
2359
  arr
2216
- ], cloneDeep = (value)=>null == value ? value : cjs_default()({}, value, {
2360
+ ], cloneDeep = (value)=>null == value ? value : cjs_0_default()({}, value, {
2217
2361
  isMergeableObject: isPlainObject
2218
2362
  });
2219
2363
  function getFilename(config, type, isProd, isServer) {
@@ -2764,6 +2908,7 @@ let OVERRIDE_PATHS = new Set([
2764
2908
  'resolve.extensions',
2765
2909
  'resolve.conditionNames',
2766
2910
  'resolve.mainFields',
2911
+ 'dev.writeToDisk',
2767
2912
  'provider'
2768
2913
  ]), mergeConfig_merge = (x, y, path = '')=>{
2769
2914
  if (((key)=>{
@@ -3399,7 +3544,7 @@ function createPublicContext(context) {
3399
3544
  async function createContext(options, userConfig) {
3400
3545
  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;
3401
3546
  return {
3402
- version: "2.0.0-beta.5",
3547
+ version: "2.0.0-beta.7",
3403
3548
  rootPath,
3404
3549
  distPath: '',
3405
3550
  cachePath,
@@ -3460,7 +3605,7 @@ async function emitConfigFiles({ bundlerConfigs, environmentConfigs, extraConfig
3460
3605
  src_logger.success(`config inspection completed, generated files: \n\n${fileInfos}\n`);
3461
3606
  }
3462
3607
  function stringifyConfig(config, verbose) {
3463
- return src_class.toString(config, {
3608
+ return dist_src.toString(config, {
3464
3609
  verbose
3465
3610
  });
3466
3611
  }
@@ -3548,7 +3693,7 @@ function reduceConfigsMergeContext({ initial, config, ctx, mergeFn = Object.assi
3548
3693
  }
3549
3694
  async function modifyBundlerChain(context, utils) {
3550
3695
  src_logger.debug('applying modifyBundlerChain hook');
3551
- let rspackChain = new src_class(), [modifiedBundlerChain] = await context.hooks.modifyBundlerChain.callChain({
3696
+ let rspackChain = new dist_src(), [modifiedBundlerChain] = await context.hooks.modifyBundlerChain.callChain({
3552
3697
  environment: utils.environment.name,
3553
3698
  args: [
3554
3699
  rspackChain,
@@ -4262,7 +4407,7 @@ function getSwcMinimizerOptions(config, jsOptions) {
4262
4407
  case 'none':
4263
4408
  options.minimizerOptions.format.comments = !1, options.extractComments = !1;
4264
4409
  }
4265
- return (options.minimizerOptions.format.asciiOnly = 'ascii' === config.output.charset, jsOptions) ? cjs_default()(options, jsOptions) : options;
4410
+ return (options.minimizerOptions.format.asciiOnly = 'ascii' === config.output.charset, jsOptions) ? cjs_0_default()(options, jsOptions) : options;
4266
4411
  }
4267
4412
  function parseMinifyOptions(config) {
4268
4413
  let isProd = 'production' === config.mode, { minify = !0 } = config.output;
@@ -4280,7 +4425,7 @@ function parseMinifyOptions(config) {
4280
4425
  cssOptions: minify.cssOptions
4281
4426
  };
4282
4427
  }
4283
- let src_0 = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.6_yaml@2.8.2/node_modules/postcss-load-config/src/index.js");
4428
+ let src_0 = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.8_yaml@2.8.2/node_modules/postcss-load-config/src/index.js");
4284
4429
  var src_0_default = __webpack_require__.n(src_0);
4285
4430
  function getLightningCSSLoaderOptions(config, targets, minify) {
4286
4431
  let userOptions = 'object' == typeof config.tools.lightningcssLoader ? config.tools.lightningcssLoader : {}, initialOptions = {
@@ -6325,7 +6470,7 @@ class SocketServer {
6325
6470
  });
6326
6471
  }
6327
6472
  onBuildDone() {
6328
- if (this.reportedBrowserLogs.clear(), this.socketsMap.size) for (let token of this.socketsMap.keys())this.sendStats({
6473
+ if (this.reportedBrowserLogs.clear(), this.ensureInitialChunks(), this.socketsMap.size) for (let token of this.socketsMap.keys())this.sendStats({
6329
6474
  token
6330
6475
  });
6331
6476
  }
@@ -6405,6 +6550,22 @@ class SocketServer {
6405
6550
  getEnvironmentByToken(token) {
6406
6551
  return this.context.environmentList.find(({ webSocketToken })=>webSocketToken === token);
6407
6552
  }
6553
+ getInitialChunks(stats) {
6554
+ let initialChunks = new Set();
6555
+ if (!stats.entrypoints) return initialChunks;
6556
+ for (let entrypoint of Object.values(stats.entrypoints)){
6557
+ let { chunks } = entrypoint;
6558
+ if (Array.isArray(chunks)) for (let chunkName of chunks)chunkName && initialChunks.add(String(chunkName));
6559
+ }
6560
+ return initialChunks;
6561
+ }
6562
+ ensureInitialChunks() {
6563
+ for (let { webSocketToken } of this.context.environmentList){
6564
+ if (this.initialChunksMap.has(webSocketToken)) continue;
6565
+ let result = this.getStats(webSocketToken);
6566
+ result && this.initialChunksMap.set(webSocketToken, this.getInitialChunks(result.stats));
6567
+ }
6568
+ }
6408
6569
  getStats(token) {
6409
6570
  let { stats } = this.context.buildState, environment = this.getEnvironmentByToken(token);
6410
6571
  if (!stats || !environment) return;
@@ -6422,12 +6583,7 @@ class SocketServer {
6422
6583
  sendStats({ force = !1, token }) {
6423
6584
  let result = this.getStats(token);
6424
6585
  if (!result) return null;
6425
- let { stats, errors, warnings } = result, newInitialChunks = new Set();
6426
- if (stats.entrypoints) for (let entrypoint of Object.values(stats.entrypoints)){
6427
- let { chunks } = entrypoint;
6428
- if (Array.isArray(chunks)) for (let chunkName of chunks)chunkName && newInitialChunks.add(String(chunkName));
6429
- }
6430
- let initialChunks = this.initialChunksMap.get(token), shouldReload = stats.entrypoints && initialChunks && !isEqualSet(initialChunks, newInitialChunks);
6586
+ let { stats, errors, warnings } = result, newInitialChunks = this.getInitialChunks(stats), initialChunks = this.initialChunksMap.get(token), shouldReload = stats.entrypoints && initialChunks && !isEqualSet(initialChunks, newInitialChunks);
6431
6587
  if (this.initialChunksMap.set(token, newInitialChunks), shouldReload) return void this.sockWrite({
6432
6588
  type: 'static-changed'
6433
6589
  }, token);
@@ -6748,7 +6904,7 @@ let applyDefaultMiddlewares = async ({ config, buildManager, context, devServer,
6748
6904
  server.base && '/' !== server.base && middlewares.use(getBaseUrlMiddleware({
6749
6905
  base: server.base
6750
6906
  }));
6751
- let { default: launchEditorMiddleware } = await import("./launch-editor-middleware.js").then(__webpack_require__.t.bind(__webpack_require__, "../../node_modules/.pnpm/launch-editor-middleware@2.13.0/node_modules/launch-editor-middleware/index.js", 23));
6907
+ let { default: launchEditorMiddleware } = await import("./launch-editor-middleware.js").then(__webpack_require__.t.bind(__webpack_require__, "../../node_modules/.pnpm/launch-editor-middleware@2.13.1/node_modules/launch-editor-middleware/index.js", 23));
6752
6908
  if (middlewares.use('/__open-in-editor', launchEditorMiddleware()), middlewares.use((({ environments })=>async function viewingServedFilesMiddleware(req, res, next) {
6753
6909
  if ('/rsbuild-dev-server' !== req.url.replace(postfixRE, '')) return void next();
6754
6910
  res.writeHead(200, {
@@ -8163,7 +8319,7 @@ try {
8163
8319
  sourceMap: getCSSSourceMap(config)
8164
8320
  },
8165
8321
  config: config.tools.cssLoader,
8166
- mergeFn: cjs_default()
8322
+ mergeFn: cjs_0_default()
8167
8323
  }), !emitCss);
8168
8324
  })({
8169
8325
  config,
@@ -8224,7 +8380,7 @@ try {
8224
8380
  'errorRecovery'
8225
8381
  ])
8226
8382
  }
8227
- }, mergedOptions = cssOptions ? cjs_default()(defaultOptions, cssOptions) : defaultOptions;
8383
+ }, mergedOptions = cssOptions ? cjs_0_default()(defaultOptions, cssOptions) : defaultOptions;
8228
8384
  chain.optimization.minimizer(CHAIN_ID.MINIMIZER.CSS).use(rspack.LightningCssMinimizerRspackPlugin, [
8229
8385
  mergedOptions
8230
8386
  ]).end();
@@ -8290,7 +8446,7 @@ try {
8290
8446
  let mergedConfig = reduceConfigs({
8291
8447
  initial: swcConfig,
8292
8448
  config: config.tools.swc,
8293
- mergeFn: cjs_default()
8449
+ mergeFn: cjs_0_default()
8294
8450
  });
8295
8451
  mergedConfig.jsc?.target !== void 0 && mergedConfig.env?.targets !== void 0 && 1 === Object.keys(mergedConfig.env).length && delete mergedConfig.env, mainRule.use(CHAIN_ID.USE.SWC).loader(builtinSwcLoaderName).options(mergedConfig), dataUriRule.resolve.set('fullySpecified', !1).end().use(CHAIN_ID.USE.SWC).loader(builtinSwcLoaderName).options(cloneDeep(mergedConfig));
8296
8452
  }
@@ -8579,7 +8735,7 @@ try {
8579
8735
  api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
8580
8736
  let { output: { manifest }, dev: { writeToDisk } } = environment.config;
8581
8737
  if (!1 === manifest) return;
8582
- let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.2_@module-federation+runtime-tools@2.0.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
8738
+ let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.5_@module-federation+runtime-tools@2.0.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
8583
8739
  manifestFilenames.set(environment.name, manifestOptions.filename);
8584
8740
  let pluginOptions = {
8585
8741
  fileName: manifestOptions.filename,
@@ -9084,7 +9240,7 @@ let applyServerOptions = (command)=>{
9084
9240
  };
9085
9241
  function setupCommands() {
9086
9242
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9087
- cli.version("2.0.0-beta.5"), 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)', {
9243
+ cli.version("2.0.0-beta.7"), 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)', {
9088
9244
  default: 'auto'
9089
9245
  }).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', {
9090
9246
  type: [
@@ -9153,7 +9309,7 @@ function initNodeEnv() {
9153
9309
  }
9154
9310
  function showGreeting() {
9155
9311
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9156
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.0.0-beta.5\n`);
9312
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.0.0-beta.7\n`);
9157
9313
  }
9158
9314
  function setupLogLevel() {
9159
9315
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9174,5 +9330,5 @@ function runCLI() {
9174
9330
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
9175
9331
  }
9176
9332
  }
9177
- let src_version = "2.0.0-beta.5";
9333
+ let src_version = "2.0.0-beta.7";
9178
9334
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, core_rspack as rspack, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, runCLI, src_logger as logger, src_version as version };