@rsbuild/core 2.0.0-rc.1 → 2.0.0-rc.3

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 (44) hide show
  1. package/compiled/css-loader/index.js +2 -2
  2. package/compiled/html-rspack-plugin/index.js +14 -14
  3. package/compiled/postcss/index.js +1 -1
  4. package/compiled/postcss/lib/at-rule.d.ts +0 -1
  5. package/compiled/postcss/lib/comment.d.ts +0 -1
  6. package/compiled/postcss/lib/container.d.ts +1 -6
  7. package/compiled/postcss/lib/css-syntax-error.d.ts +0 -1
  8. package/compiled/postcss/lib/declaration.d.ts +0 -1
  9. package/compiled/postcss/lib/document.d.ts +0 -1
  10. package/compiled/postcss/lib/fromJSON.d.ts +1 -1
  11. package/compiled/postcss/lib/input.d.ts +0 -1
  12. package/compiled/postcss/lib/lazy-result.d.ts +3 -4
  13. package/compiled/postcss/lib/list.d.ts +1 -1
  14. package/compiled/postcss/lib/no-work-result.d.ts +0 -1
  15. package/compiled/postcss/lib/node.d.ts +0 -1
  16. package/compiled/postcss/lib/parse.d.ts +1 -1
  17. package/compiled/postcss/lib/postcss.d.ts +1 -3
  18. package/compiled/postcss/lib/previous-map.d.ts +0 -1
  19. package/compiled/postcss/lib/processor.d.ts +0 -1
  20. package/compiled/postcss/lib/result.d.ts +0 -1
  21. package/compiled/postcss/lib/root.d.ts +0 -1
  22. package/compiled/postcss/lib/rule.d.ts +12 -12
  23. package/compiled/postcss/lib/stringifier.d.ts +0 -1
  24. package/compiled/postcss/lib/stringify.d.ts +1 -1
  25. package/compiled/postcss/lib/warning.d.ts +0 -1
  26. package/compiled/postcss/license +1 -1
  27. package/compiled/postcss/package.json +1 -1
  28. package/compiled/postcss-loader/index.js +6 -6
  29. package/compiled/rspack-chain/package.json +1 -1
  30. package/compiled/rspack-chain/types/index.d.ts +3 -1
  31. package/dist/{863.js → 753.js} +104 -123
  32. package/dist/http-proxy-middleware.js +4 -4
  33. package/dist/index.js +1 -1
  34. package/dist/launch-editor-middleware.js +6 -6
  35. package/dist/manifest-plugin.js +8 -8
  36. package/dist/memfs.js +16 -56
  37. package/dist/tinyglobby.js +279 -127
  38. package/dist/ws.js +2 -2
  39. package/dist-types/server/devServer.d.ts +2 -2
  40. package/dist-types/server/socketServer.d.ts +3 -3
  41. package/dist-types/types/config.d.ts +7 -1
  42. package/package.json +6 -6
  43. package/dist-types/plugins/esm.d.ts +0 -2
  44. /package/dist/{863.js.LICENSE.txt → 753.js.LICENSE.txt} +0 -0
@@ -1,4 +1,4 @@
1
- /*! LICENSE: 863.js.LICENSE.txt */
1
+ /*! LICENSE: 753.js.LICENSE.txt */
2
2
  let flagForceColor, runtimeProcessArgs, runtimeInfo, swcHelpersPath, pluginHelper_htmlPlugin;
3
3
  import { rspack as core_rspack } from "@rspack/core";
4
4
  import node_util, { stripVTControlCharacters } from "node:util";
@@ -149,7 +149,7 @@ __webpack_require__.add({
149
149
  };
150
150
  },
151
151
  "../../node_modules/.pnpm/lilconfig@3.1.3/node_modules/lilconfig/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
152
- let path = __webpack_require__("path?37f5"), fs = __webpack_require__("fs?cdbd"), os = __webpack_require__("os"), url = __webpack_require__("url?5f07"), fsReadFileAsync = fs.promises.readFile;
152
+ let path = __webpack_require__("path?aeb1"), fs = __webpack_require__("fs?8b28"), os = __webpack_require__("os"), url = __webpack_require__("url?b918"), fsReadFileAsync = fs.promises.readFile;
153
153
  function getDefaultSearchPlaces(name, sync) {
154
154
  return [
155
155
  'package.json',
@@ -469,8 +469,8 @@ __webpack_require__.add({
469
469
  return (asyncHooks.AsyncResource && (res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')), res && res.runInAsyncScope) ? res.runInAsyncScope.bind(res, fn, null) : fn;
470
470
  }
471
471
  },
472
- "../../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__) {
473
- let yaml, { resolve } = __webpack_require__("node:path?815c"), 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");
472
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.9_yaml@2.8.2/node_modules/postcss-load-config/src/index.js" (module, __unused_rspack_exports, __webpack_require__) {
473
+ let yaml, { resolve } = __webpack_require__("node:path?435f"), 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.9_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.9_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.9_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
474
474
  async function processResult(ctx, result) {
475
475
  let obj, file = result.filepath || '', projectConfig = ((obj = result.config) && obj.__esModule ? obj : {
476
476
  default: obj
@@ -543,8 +543,8 @@ __webpack_require__.add({
543
543
  });
544
544
  };
545
545
  },
546
- "../../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__) {
547
- 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");
546
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.9_yaml@2.8.2/node_modules/postcss-load-config/src/options.js" (module, __unused_rspack_exports, __webpack_require__) {
547
+ let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.9_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
548
548
  module.exports = async function options(config, file) {
549
549
  if (config.parser && 'string' == typeof config.parser) try {
550
550
  config.parser = await req(config.parser, file);
@@ -564,8 +564,8 @@ __webpack_require__.add({
564
564
  return config;
565
565
  };
566
566
  },
567
- "../../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__) {
568
- 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");
567
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.9_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js" (module, __unused_rspack_exports, __webpack_require__) {
568
+ let req = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.9_yaml@2.8.2/node_modules/postcss-load-config/src/req.js");
569
569
  async function load(plugin, options, file) {
570
570
  try {
571
571
  if (null == options || 0 === Object.keys(options).length) return await req(plugin, file);
@@ -581,10 +581,10 @@ __webpack_require__.add({
581
581
  }), list;
582
582
  };
583
583
  },
584
- "../../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__) {
584
+ "../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.9_yaml@2.8.2/node_modules/postcss-load-config/src/req.js" (module, __unused_rspack_exports, __webpack_require__) {
585
585
  let tsx, jiti;
586
586
  var __filename = __rspack_fileURLToPath(import.meta.url);
587
- let { createRequire } = __webpack_require__("node:module?f56b"), { pathToFileURL } = __webpack_require__("node:url?5295"), TS_EXT_RE = /\.[mc]?ts$/, importError = [];
587
+ let { createRequire } = __webpack_require__("node:module?1bcb"), { pathToFileURL } = __webpack_require__("node:url?b4ec"), TS_EXT_RE = /\.[mc]?ts$/, importError = [];
588
588
  module.exports = async function req(name, rootFile = __filename) {
589
589
  let url = createRequire(rootFile).resolve(name);
590
590
  try {
@@ -624,10 +624,7 @@ __webpack_require__.add({
624
624
  crypto (module) {
625
625
  module.exports = __rspack_createRequire_require("crypto");
626
626
  },
627
- events (module) {
628
- module.exports = __rspack_createRequire_require("events");
629
- },
630
- "fs?cdbd" (module) {
627
+ "fs?8b28" (module) {
631
628
  module.exports = __rspack_createRequire_require("fs");
632
629
  },
633
630
  http (module) {
@@ -639,31 +636,31 @@ __webpack_require__.add({
639
636
  net (module) {
640
637
  module.exports = __rspack_createRequire_require("net");
641
638
  },
642
- "node:buffer?4a79" (module) {
639
+ "node:buffer?1cd0" (module) {
643
640
  module.exports = __rspack_createRequire_require("node:buffer");
644
641
  },
645
- "node:events?5dda" (module) {
642
+ "node:events?3ec9" (module) {
646
643
  module.exports = __rspack_createRequire_require("node:events");
647
644
  },
648
- "node:fs?31c0" (module) {
645
+ "node:fs?9592" (module) {
649
646
  module.exports = __rspack_createRequire_require("node:fs");
650
647
  },
651
- "node:module?f56b" (module) {
648
+ "node:module?1bcb" (module) {
652
649
  module.exports = __rspack_createRequire_require("node:module");
653
650
  },
654
- "node:path?815c" (module) {
651
+ "node:path?435f" (module) {
655
652
  module.exports = __rspack_createRequire_require("node:path");
656
653
  },
657
- "node:stream?be04" (module) {
654
+ "node:stream?3c93" (module) {
658
655
  module.exports = __rspack_createRequire_require("node:stream");
659
656
  },
660
- "node:url?5295" (module) {
657
+ "node:url?b4ec" (module) {
661
658
  module.exports = __rspack_createRequire_require("node:url");
662
659
  },
663
660
  os (module) {
664
661
  module.exports = __rspack_createRequire_require("os");
665
662
  },
666
- "path?37f5" (module) {
663
+ "path?aeb1" (module) {
667
664
  module.exports = __rspack_createRequire_require("path");
668
665
  },
669
666
  process (module) {
@@ -678,7 +675,7 @@ __webpack_require__.add({
678
675
  tty (module) {
679
676
  module.exports = __rspack_createRequire_require("tty");
680
677
  },
681
- "url?5f07" (module) {
678
+ "url?b918" (module) {
682
679
  module.exports = __rspack_createRequire_require("url");
683
680
  },
684
681
  util (module) {
@@ -686,6 +683,9 @@ __webpack_require__.add({
686
683
  },
687
684
  zlib (module) {
688
685
  module.exports = __rspack_createRequire_require("zlib");
686
+ },
687
+ events (module) {
688
+ module.exports = __rspack_createRequire_require("node:events");
689
689
  }
690
690
  }), function checkNodeVersion() {
691
691
  let { versions } = process;
@@ -1414,9 +1414,7 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1414
1414
  }, module.exports = deepmerge;
1415
1415
  },
1416
1416
  "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js" (__unused_rspack_module, exports) {
1417
- Object.defineProperty(exports, "__esModule", {
1418
- value: !0
1419
- }), exports.arrayToString = void 0, exports.arrayToString = (array, space, next)=>{
1417
+ exports.arrayToString = void 0, exports.arrayToString = (array, space, next)=>{
1420
1418
  let values = array.map(function(value, index) {
1421
1419
  let result = next(value, index);
1422
1420
  return void 0 === result ? String(result) : space + result.split("\n").join(`\n${space}`);
@@ -1424,11 +1422,9 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1424
1422
  return `[${eol}${values}${eol}]`;
1425
1423
  };
1426
1424
  },
1427
- "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js" (__unused_rspack_module, exports, __webpack_require__) {
1428
- Object.defineProperty(exports, "__esModule", {
1429
- value: !0
1430
- }), exports.FunctionParser = exports.dedentFunction = exports.functionToString = exports.USED_METHOD_KEY = void 0;
1431
- 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 = '"' === ({
1425
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js" (__unused_rspack_module, exports, __nested_rspack_require_5714_5733__) {
1426
+ exports.functionToString = exports.USED_METHOD_KEY = void 0;
1427
+ let quote_1 = __nested_rspack_require_5714_5733__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), METHOD_NAMES_ARE_QUOTED = '"' === ({
1432
1428
  " " () {}
1433
1429
  })[" "].toString().charAt(0), FUNCTION_PREFIXES = {
1434
1430
  Function: "function ",
@@ -1454,7 +1450,7 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1454
1450
  exports.USED_METHOD_KEY = new WeakSet(), exports.functionToString = (fn, space, next, key)=>{
1455
1451
  let name = "string" == typeof key ? key : void 0;
1456
1452
  return void 0 !== name && exports.USED_METHOD_KEY.add(fn), new FunctionParser(fn, space, next, name).stringify();
1457
- }, exports.dedentFunction = dedentFunction;
1453
+ };
1458
1454
  class FunctionParser {
1459
1455
  constructor(fn, indent, next, key){
1460
1456
  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);
@@ -1560,11 +1556,12 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1560
1556
  this.consumeMatch(/^(?:\s|\/\/.*|\/\*[^]*?\*\/)*/);
1561
1557
  }
1562
1558
  }
1563
- exports.FunctionParser = FunctionParser;
1564
1559
  },
1565
- "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
1566
- exports.stringify = void 0;
1567
- 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");
1560
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/index.js" (__unused_rspack_module, exports, __nested_rspack_require_14714_14733__) {
1561
+ Object.defineProperty(exports, "__esModule", {
1562
+ value: !0
1563
+ }), exports.stringify = void 0;
1564
+ let stringify_1 = __nested_rspack_require_14714_14733__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js"), quote_1 = __nested_rspack_require_14714_14733__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), ROOT_SENTINEL = Symbol("root");
1568
1565
  function replacerToString(replacer) {
1569
1566
  return replacer ? (value, space, next, key)=>replacer(value, space, (value)=>stringify_1.toString(value, space, next, key), key) : stringify_1.toString;
1570
1567
  }
@@ -1598,14 +1595,12 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1598
1595
  return result;
1599
1596
  };
1600
1597
  },
1601
- "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js" (__unused_rspack_module, exports, __webpack_require__) {
1602
- Object.defineProperty(exports, "__esModule", {
1603
- value: !0
1604
- }), exports.objectToString = void 0;
1605
- 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");
1598
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js" (__unused_rspack_module, exports, __nested_rspack_require_18136_18155__) {
1599
+ exports.objectToString = void 0;
1600
+ let quote_1 = __nested_rspack_require_18136_18155__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), function_1 = __nested_rspack_require_18136_18155__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js"), array_1 = __nested_rspack_require_18136_18155__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/array.js");
1606
1601
  exports.objectToString = (value, space, next, key)=>{
1607
1602
  if ("function" == typeof Buffer && Buffer.isBuffer(value)) return `Buffer.from(${next(value.toString("base64"))}, 'base64')`;
1608
- if ("object" == typeof global && value === global) return globalToString(value, space, next, key);
1603
+ if ("object" == typeof global && value === global) return globalToString(value, space, next);
1609
1604
  let toString = OBJECT_TYPES[Object.prototype.toString.call(value)];
1610
1605
  return toString ? toString(value, space, next, key) : void 0;
1611
1606
  };
@@ -1633,9 +1628,7 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1633
1628
  };
1634
1629
  },
1635
1630
  "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js" (__unused_rspack_module, exports) {
1636
- Object.defineProperty(exports, "__esModule", {
1637
- value: !0
1638
- }), exports.stringifyPath = exports.quoteKey = exports.isValidVariableName = exports.IS_VALID_IDENTIFIER = exports.quoteString = void 0;
1631
+ exports.stringifyPath = exports.quoteKey = exports.isValidVariableName = exports.W = exports.quoteString = void 0;
1639
1632
  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([
1640
1633
  [
1641
1634
  "\b",
@@ -1678,9 +1671,9 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1678
1671
  };
1679
1672
  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(" "));
1680
1673
  function isValidVariableName(name) {
1681
- return "string" == typeof name && !RESERVED_WORDS.has(name) && exports.IS_VALID_IDENTIFIER.test(name);
1674
+ return "string" == typeof name && !RESERVED_WORDS.has(name) && exports.W.test(name);
1682
1675
  }
1683
- exports.IS_VALID_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/, exports.isValidVariableName = isValidVariableName, exports.quoteKey = function quoteKey(key, next) {
1676
+ exports.W = /^[A-Za-z_$][A-Za-z0-9_$]*$/, exports.isValidVariableName = isValidVariableName, exports.quoteKey = function quoteKey(key, next) {
1684
1677
  return isValidVariableName(key) ? key : next(key);
1685
1678
  }, exports.stringifyPath = function stringifyPath(path, next) {
1686
1679
  let result = "";
@@ -1688,11 +1681,9 @@ __nested_rspack_require_65__.m = __webpack_modules__, __nested_rspack_require_65
1688
1681
  return result;
1689
1682
  };
1690
1683
  },
1691
- "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js" (__unused_rspack_module, exports, __webpack_require__) {
1692
- Object.defineProperty(exports, "__esModule", {
1693
- value: !0
1694
- }), exports.toString = void 0;
1695
- 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 = {
1684
+ "./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/stringify.js" (__unused_rspack_module, exports, __nested_rspack_require_23555_23574__) {
1685
+ exports.toString = void 0;
1686
+ let quote_1 = __nested_rspack_require_23555_23574__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/quote.js"), object_1 = __nested_rspack_require_23555_23574__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/object.js"), function_1 = __nested_rspack_require_23555_23574__("./node_modules/.pnpm/javascript-stringify@2.1.0/node_modules/javascript-stringify/dist/function.js"), PRIMITIVE_TYPES = {
1696
1687
  string: quote_1.quoteString,
1697
1688
  number: (value)=>Object.is(value, -0) ? "-0" : String(value),
1698
1689
  boolean: String,
@@ -3561,7 +3552,7 @@ function createPublicContext(context) {
3561
3552
  async function createContext(options, userConfig, logger) {
3562
3553
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = join(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
3563
3554
  return {
3564
- version: "2.0.0-rc.1",
3555
+ version: "2.0.0-rc.3",
3565
3556
  rootPath,
3566
3557
  distPath: '',
3567
3558
  cachePath,
@@ -4452,7 +4443,7 @@ function parseMinifyOptions(config) {
4452
4443
  cssOptions: minify.cssOptions
4453
4444
  };
4454
4445
  }
4455
- let postcss_load_config_src = __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");
4446
+ let postcss_load_config_src = __webpack_require__("../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.9_yaml@2.8.2/node_modules/postcss-load-config/src/index.js");
4456
4447
  var postcss_load_config_src_default = __webpack_require__.n(postcss_load_config_src);
4457
4448
  function getLightningCSSLoaderOptions(config, targets, minify) {
4458
4449
  let userOptions = 'object' == typeof config.tools.lightningcssLoader ? config.tools.lightningcssLoader : {}, initialOptions = {
@@ -4704,7 +4695,7 @@ async function printFileSizes(options, stats, rootPath, distPath, environmentNam
4704
4695
  if (showDetail) {
4705
4696
  let maxFileLength = Math.max(...assets.map((asset)=>asset.filenameLength), showTotal ? totalSizeTitle.length : 0, fileHeader.length), maxSizeLength = Math.max(...assets.map((a)=>a.sizeLabelLength), totalSizeLabelLength), showGzipHeader = !!(options.compressed && assets.some((item)=>null !== item.gzippedSize));
4706
4697
  for (let asset of (logs.push(getHeader(maxFileLength, maxSizeLength, fileHeader, showGzipHeader)), assets)){
4707
- let { sizeLabel, sizeLabelLength, gzipSizeLabel } = asset, { filenameLength } = asset, { filenameLabel } = asset;
4698
+ let { sizeLabel, filenameLabel } = asset, { sizeLabelLength, gzipSizeLabel, filenameLength } = asset;
4708
4699
  sizeLabelLength < maxSizeLength && (sizeLabel += ' '.repeat(maxSizeLength - sizeLabelLength)), filenameLength < maxFileLength && (filenameLabel += ' '.repeat(maxFileLength - filenameLength));
4709
4700
  let log = `${filenameLabel} ${sizeLabel}`;
4710
4701
  gzipSizeLabel && (log += ` ${gzipSizeLabel}`), logs.push(log);
@@ -6154,7 +6145,7 @@ let assets_middleware_assetsMiddleware = async ({ config, compiler, context, soc
6154
6145
  })(compiler)) return;
6155
6146
  let errorsCount = null, warningsCount = null;
6156
6147
  compiler.hooks.invalid.tap('rsbuild-dev-server', (fileName)=>{
6157
- errorsCount = null, warningsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && normalizeLiveReload(liveReload).html && socketServer.sockWrite({
6148
+ errorsCount = null, warningsCount = null, 'string' == typeof fileName && fileName.endsWith('.html') && normalizeLiveReload(liveReload).html && socketServer.sendMessage({
6158
6149
  type: 'full-reload'
6159
6150
  }, token);
6160
6151
  }), compiler.hooks.done.tap('rsbuild-dev-server', (stats)=>{
@@ -6486,7 +6477,7 @@ class SocketServer {
6486
6477
  }
6487
6478
  sendError(errors, token) {
6488
6479
  let { rootPath } = this.context, formattedErrors = errors.map((item)=>formatStatsError(item, rootPath, 'error', this.context.logger)), html = formattedErrors.map((error)=>convertLinksInHtml(ansiHTML(escapeHtml(error)), rootPath)).join('\n\n').trim();
6489
- this.sockWrite({
6480
+ this.sendMessage({
6490
6481
  type: 'errors',
6491
6482
  data: {
6492
6483
  text: formattedErrors,
@@ -6496,16 +6487,16 @@ class SocketServer {
6496
6487
  }
6497
6488
  sendWarning(warnings, token) {
6498
6489
  let formattedWarnings = warnings.map((item)=>formatStatsError(item, this.context.rootPath, 'warning', this.context.logger));
6499
- this.sockWrite({
6490
+ this.sendMessage({
6500
6491
  type: 'warnings',
6501
6492
  data: {
6502
6493
  text: formattedWarnings
6503
6494
  }
6504
6495
  }, token);
6505
6496
  }
6506
- sockWrite(message, token) {
6497
+ sendMessage(message, token) {
6507
6498
  let messageStr = JSON.stringify(message), sendToSockets = (sockets)=>{
6508
- for (let socket of sockets)this.send(socket, messageStr);
6499
+ for (let socket of sockets)this.sendRawMessage(socket, messageStr);
6509
6500
  };
6510
6501
  if (token) {
6511
6502
  let sockets = this.socketsMap.get(token);
@@ -6537,7 +6528,7 @@ class SocketServer {
6537
6528
  let stackTrace = isObject(browserLogs) && browserLogs.stackTrace || DEFAULT_STACK_TRACE, outputFs = this.getOutputFileSystem(), stackFrames = payload.stack ? stack_trace_parser_esm_parse(payload.stack) : null, cachedTraceMap = new Map(), log = await formatBrowserErrorLog(payload.message, context, outputFs, stackTrace, stackFrames, cachedTraceMap);
6538
6529
  if (this.reportedBrowserLogs.has(log) || (this.reportedBrowserLogs.add(log), this.context.logger.error(`${color.cyan('[browser]')} ${log}`)), 'object' == typeof client.overlay && client.overlay.runtime) {
6539
6530
  let resolvedLog = 'full' === stackTrace ? log : await formatBrowserErrorLog(payload.message, context, outputFs, 'full', stackFrames, cachedTraceMap);
6540
- this.sockWrite({
6531
+ this.sendMessage({
6541
6532
  type: 'resolved-client-error',
6542
6533
  data: {
6543
6534
  id: payload.id,
@@ -6594,24 +6585,24 @@ class SocketServer {
6594
6585
  let result = this.getStats(token);
6595
6586
  if (!result) return null;
6596
6587
  let { stats, errors, warnings } = result, newInitialChunks = this.getInitialChunks(stats), initialChunks = this.initialChunksMap.get(token), shouldReload = stats.entrypoints && initialChunks && !isEqualSet(initialChunks, newInitialChunks);
6597
- if (this.initialChunksMap.set(token, newInitialChunks), shouldReload) return void this.sockWrite({
6588
+ if (this.initialChunksMap.set(token, newInitialChunks), shouldReload) return void this.sendMessage({
6598
6589
  type: 'full-reload'
6599
6590
  }, token);
6600
6591
  if (stats.hash) {
6601
6592
  let prevHash = this.currentHash.get(token);
6602
- if (this.currentHash.set(token, stats.hash), !force && 0 === errors.length && 0 === warnings.length && prevHash === stats.hash) return void this.sockWrite({
6593
+ if (this.currentHash.set(token, stats.hash), !force && 0 === errors.length && 0 === warnings.length && prevHash === stats.hash) return void this.sendMessage({
6603
6594
  type: 'ok'
6604
6595
  }, token);
6605
- this.sockWrite({
6596
+ this.sendMessage({
6606
6597
  type: 'hash',
6607
6598
  data: stats.hash
6608
6599
  }, token);
6609
6600
  }
6610
- errors.length > 0 ? this.sendError(errors, token) : warnings.length > 0 ? this.sendWarning(warnings, token) : this.sockWrite({
6601
+ errors.length > 0 ? this.sendError(errors, token) : warnings.length > 0 ? this.sendWarning(warnings, token) : this.sendMessage({
6611
6602
  type: 'ok'
6612
6603
  }, token);
6613
6604
  }
6614
- send(socket, message) {
6605
+ sendRawMessage(socket, message) {
6615
6606
  socket.readyState === socket.OPEN && socket.send(message);
6616
6607
  }
6617
6608
  }
@@ -7186,13 +7177,11 @@ class CommonJsRunner extends BasicRunner {
7186
7177
  exports: {}
7187
7178
  };
7188
7179
  requireCache[file.path] = m;
7189
- let currentModuleScope = this.createModuleScope(this.getRequire(), m, file), args = Object.keys(currentModuleScope), argValues = args.map((arg)=>currentModuleScope[arg]), codeDefinition = `(function(${args.join(', ')}) {`, code = `${codeDefinition}${file.content}\n})`;
7190
- this.preExecute(code, file);
7180
+ let currentModuleScope = this.createModuleScope(this.getRequire(), m, file), args = Object.keys(currentModuleScope), argValues = args.map((arg)=>currentModuleScope[arg]);
7181
+ this.preExecute(file.content, file);
7191
7182
  let dynamicImport = Function('specifier', 'return import(specifier)');
7192
- return vm.runInThisContext(code, {
7183
+ return vm.compileFunction(file.content, args, {
7193
7184
  filename: file.path,
7194
- lineOffset: 0,
7195
- columnOffset: -codeDefinition.length,
7196
7185
  importModuleDynamically: async (specifier)=>await dynamicImport(specifier)
7197
7186
  }).call(m.exports, ...argValues), this.postExecute(m, file), m.exports;
7198
7187
  };
@@ -7395,13 +7384,13 @@ async function startWatchFiles({ paths, options, type = 'reload-page' }, buildMa
7395
7384
  if ('reload-page' !== type) return;
7396
7385
  let watcher = await createChokidar(paths, root, options);
7397
7386
  return watcher.on('change', ()=>{
7398
- buildManager.socketServer.sockWrite({
7387
+ buildManager.socketServer.sendMessage({
7399
7388
  type: 'full-reload'
7400
7389
  });
7401
7390
  }), watcher;
7402
7391
  }
7403
7392
  async function devServer_createDevServer(options, createCompiler, config, { getPortSilently, runCompile = !0 } = {}) {
7404
- let lastStats, fileWatcher, devMiddlewares, buildManager, { context } = options, { logger } = context;
7393
+ let lastStats, { context } = options, { logger } = context;
7405
7394
  logger.debug('create dev server');
7406
7395
  let { port, portTip } = await resolvePort(config), { middlewareMode, host } = config.server, isHttps = !!config.server.https, routes = getRoutes(context);
7407
7396
  context.devServer = {
@@ -7455,10 +7444,10 @@ async function devServer_createDevServer(options, createCompiler, config, { getP
7455
7444
  protocol,
7456
7445
  clearCache: !0,
7457
7446
  logger
7458
- }), cleanupGracefulShutdown = middlewareMode ? null : setupGracefulShutdown(), closingPromise = null, closeServer = async ()=>(closingPromise || (closingPromise = (async ()=>{
7447
+ }), state = {}, cleanupGracefulShutdown = middlewareMode ? null : setupGracefulShutdown(), closingPromise = null, closeServer = async ()=>(closingPromise || (closingPromise = (async ()=>{
7459
7448
  removeCleanup(closeServer), cleanupGracefulShutdown?.(), await context.hooks.onCloseDevServer.callBatch(), await Promise.all([
7460
- devMiddlewares?.close(),
7461
- fileWatcher?.close()
7449
+ state.devMiddlewares?.close(),
7450
+ state.fileWatcher?.close()
7462
7451
  ]);
7463
7452
  })()), closingPromise);
7464
7453
  middlewareMode || registerCleanup(closeServer);
@@ -7484,25 +7473,31 @@ async function devServer_createDevServer(options, createCompiler, config, { getP
7484
7473
  if (!htmlPath) throw Error(`${color.dim('[rsbuild:getTransformedHtml]')} Failed to get HTML file by entryName: ${color.yellow(entryName)}`);
7485
7474
  let fileName = join(distPath, htmlPath);
7486
7475
  return utils.readFileSync(fileName);
7487
- })(entryName, utils)), environmentAPI = {}, getErrorMsg = (method)=>`${color.dim('[rsbuild:server]')} Can not call ${color.yellow(method)} when ${color.yellow('runCompile')} is false`;
7476
+ })(entryName, utils)), environmentAPI = {}, createHotSend = (token)=>(type, data)=>state.buildManager?.socketServer.sendMessage({
7477
+ type,
7478
+ data
7479
+ }, token), getErrorMsg = (method)=>`${color.dim('[rsbuild:server]')} Can not call ${color.yellow(method)} when ${color.yellow('runCompile')} is false`;
7488
7480
  context.environmentList.forEach((environment, index)=>{
7489
7481
  environmentAPI[environment.name] = {
7490
7482
  context: environment,
7483
+ hot: {
7484
+ send: createHotSend(environment.webSocketToken)
7485
+ },
7491
7486
  getStats: async ()=>{
7492
- if (!buildManager) throw Error(getErrorMsg('getStats'));
7487
+ if (!state.buildManager) throw Error(getErrorMsg('getStats'));
7493
7488
  return await waitLastCompileDone, lastStats[index];
7494
7489
  },
7495
7490
  loadBundle: async (entryName)=>{
7496
- if (!buildManager) throw Error(getErrorMsg('loadBundle'));
7491
+ if (!state.buildManager) throw Error(getErrorMsg('loadBundle'));
7497
7492
  return await waitLastCompileDone, cacheableLoadBundle(lastStats[index], entryName, {
7498
- readFileSync: buildManager.readFileSync,
7493
+ readFileSync: state.buildManager.readFileSync,
7499
7494
  environment
7500
7495
  });
7501
7496
  },
7502
7497
  getTransformedHtml: async (entryName)=>{
7503
- if (!buildManager) throw Error(getErrorMsg('getTransformedHtml'));
7498
+ if (!state.buildManager) throw Error(getErrorMsg('getTransformedHtml'));
7504
7499
  return await waitLastCompileDone, cacheableTransformedHtml(lastStats[index], entryName, {
7505
- readFileSync: buildManager.readFileSync,
7500
+ readFileSync: state.buildManager.readFileSync,
7506
7501
  environment
7507
7502
  });
7508
7503
  }
@@ -7516,10 +7511,7 @@ async function devServer_createDevServer(options, createCompiler, config, { getP
7516
7511
  middlewares,
7517
7512
  environments: environmentAPI,
7518
7513
  httpServer,
7519
- sockWrite: (type, data)=>buildManager?.socketServer.sockWrite({
7520
- type,
7521
- data
7522
- }),
7514
+ sockWrite: createHotSend(),
7523
7515
  listen: async ()=>{
7524
7516
  if (!httpServer) throw Error(`${color.dim('[rsbuild:server]')} Can not listen dev server as ${color.yellow('server.middlewareMode')} is enabled.`);
7525
7517
  let serverTerminator = getServerTerminator(httpServer);
@@ -7529,7 +7521,7 @@ async function devServer_createDevServer(options, createCompiler, config, { getP
7529
7521
  port
7530
7522
  }, async (err)=>{
7531
7523
  if (err) throw err;
7532
- middlewares.use(optionsFallbackMiddleware), middlewares.use(notFoundMiddleware), devMiddlewares && httpServer.on('upgrade', devMiddlewares.onUpgrade), logger.debug('listen dev server done'), await devServer.afterListen(), onBeforeRestartServer(devServer.close), resolve({
7524
+ middlewares.use(optionsFallbackMiddleware), middlewares.use(notFoundMiddleware), state.devMiddlewares && httpServer.on('upgrade', state.devMiddlewares.onUpgrade), logger.debug('listen dev server done'), await devServer.afterListen(), onBeforeRestartServer(devServer.close), resolve({
7533
7525
  port,
7534
7526
  urls: urls.map((item)=>item.url),
7535
7527
  server: devServer
@@ -7545,7 +7537,7 @@ async function devServer_createDevServer(options, createCompiler, config, { getP
7545
7537
  });
7546
7538
  },
7547
7539
  connectWebSocket: ({ server })=>{
7548
- devMiddlewares && server.on('upgrade', devMiddlewares.onUpgrade);
7540
+ state.devMiddlewares && server.on('upgrade', state.devMiddlewares.onUpgrade);
7549
7541
  },
7550
7542
  close: closeServer,
7551
7543
  printUrls,
@@ -7561,17 +7553,17 @@ async function devServer_createDevServer(options, createCompiler, config, { getP
7561
7553
  })).filter((item)=>'function' == typeof item),
7562
7554
  ...setupPostCallbacks
7563
7555
  ];
7564
- return runCompile ? context.hooks.onBeforeCreateCompiler.tap(beforeCreateCompiler) : await beforeCreateCompiler(), buildManager = runCompile ? await startCompile() : void 0, fileWatcher = await setupWatchFiles({
7556
+ return runCompile ? context.hooks.onBeforeCreateCompiler.tap(beforeCreateCompiler) : await beforeCreateCompiler(), state.buildManager = runCompile ? await startCompile() : void 0, state.fileWatcher = await setupWatchFiles({
7565
7557
  config,
7566
- buildManager,
7558
+ buildManager: state.buildManager,
7567
7559
  root: context.rootPath
7568
- }), devMiddlewares = await getDevMiddlewares({
7569
- buildManager,
7560
+ }), state.devMiddlewares = await getDevMiddlewares({
7561
+ buildManager: state.buildManager,
7570
7562
  config,
7571
7563
  devServer,
7572
7564
  context,
7573
7565
  postCallbacks
7574
- }), buildManager?.watch(), logger.debug('create dev server done'), devServer;
7566
+ }), state.buildManager?.watch(), logger.debug('create dev server done'), devServer;
7575
7567
  }
7576
7568
  async function startPreviewServer(context, config, { getPortSilently } = {}) {
7577
7569
  let { logger } = context, { connect } = await import("./connect-next.js"), middlewares = connect(), { port, portTip } = await resolvePort(config), serverConfig = config.server, { host, headers, proxy, historyApiFallback, compress, base, cors } = serverConfig, protocol = serverConfig.https ? 'https' : 'http', routes = getRoutes(context), urls = await getAddressUrls({
@@ -7826,25 +7818,29 @@ function applyDefaultPlugins(pluginManager, context) {
7826
7818
  {
7827
7819
  name: 'rsbuild:output',
7828
7820
  setup (api) {
7829
- api.modifyBundlerChain((chain, { CHAIN_ID, isDev, isProd, isServer, environment, rspack })=>{
7821
+ api.modifyBundlerChain((chain, { CHAIN_ID, isDev, isProd, isServer, environment, rspack, target })=>{
7830
7822
  var jsAsync;
7831
7823
  let { distPath, config } = environment, publicPath = getPublicPath({
7832
7824
  config,
7833
7825
  isDev,
7834
7826
  context: api.context
7835
7827
  }), jsPath = config.output.distPath.js, jsAsyncPath = void 0 !== (jsAsync = config.output.distPath.jsAsync) ? jsAsync : isServer ? jsPath : jsPath ? `${jsPath}/async` : 'async', jsFilename = getFilename(config, 'js', isProd, isServer), isJsFilenameFn = 'function' == typeof jsFilename;
7836
- if (chain.output.path(distPath).filename(isJsFilenameFn ? (...args)=>{
7828
+ chain.output.path(distPath).filename(isJsFilenameFn ? (...args)=>{
7837
7829
  let name = jsFilename(...args);
7838
7830
  return posix.join(jsPath, name);
7839
7831
  } : posix.join(jsPath, jsFilename)).chunkFilename(isJsFilenameFn ? (...args)=>{
7840
7832
  let name = jsFilename(...args);
7841
7833
  return posix.join(jsAsyncPath, name);
7842
- } : posix.join(jsAsyncPath, jsFilename)).publicPath(publicPath).bundlerInfo({
7843
- force: !1
7844
- }), isServer && chain.output.library({
7845
- type: 'commonjs2',
7846
- ...chain.output.get('library') || {}
7847
- }), config.output.copy) {
7834
+ } : posix.join(jsAsyncPath, jsFilename)).publicPath(publicPath);
7835
+ let isESM = config.output.module;
7836
+ if (isServer && chain.output.library({
7837
+ ...chain.output.get('library') || {},
7838
+ type: isESM ? 'module' : 'commonjs2'
7839
+ }), isESM) {
7840
+ if ('web-worker' === target) throw Error('[rsbuild:config] `output.module: true` is not supported for web-worker target.');
7841
+ chain.node.set('__dirname', !1).set('__filename', !1), chain.output.module(!0).chunkFormat('module').chunkLoading('import').workerChunkLoading('import');
7842
+ }
7843
+ if (config.output.copy) {
7848
7844
  let { copy } = config.output, options = Array.isArray(copy) ? {
7849
7845
  patterns: copy
7850
7846
  } : copy;
@@ -8495,21 +8491,6 @@ try {
8495
8491
  });
8496
8492
  }
8497
8493
  },
8498
- {
8499
- name: 'rsbuild:esm',
8500
- setup (api) {
8501
- api.modifyBundlerChain((chain, { environment, target })=>{
8502
- let { config } = environment;
8503
- if (config.output.module) {
8504
- if ('node' === target && chain.output.library({
8505
- ...chain.output.get('library'),
8506
- type: 'module'
8507
- }), 'web-worker' === target) throw Error('[rsbuild:config] `output.module` is not supported for web-worker target.');
8508
- chain.node.set('__dirname', !1).set('__filename', !1), chain.output.module(!0).chunkFormat('module').chunkLoading('import').workerChunkLoading('import');
8509
- }
8510
- });
8511
- }
8512
- },
8513
8494
  pluginExternals(),
8514
8495
  {
8515
8496
  name: 'rsbuild:split-chunks',
@@ -8776,7 +8757,7 @@ try {
8776
8757
  api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
8777
8758
  let { output: { manifest }, dev: { writeToDisk } } = environment.config;
8778
8759
  if (!1 === manifest) return;
8779
- 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-rc.1_@emnapi+core@1.9.2_@emnapi+runtime_ae0458ffc4f2907bc50e0834703a6ec7/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
8760
+ 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-rc.2/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
8780
8761
  manifestFilenames.set(environment.name, manifestOptions.filename);
8781
8762
  let pluginOptions = {
8782
8763
  fileName: manifestOptions.filename,
@@ -9120,12 +9101,12 @@ async function loadConfig_loadConfig({ cwd = process.cwd(), path, envMode, meta,
9120
9101
  throw Error(`${color.dim('[rsbuild:loadConfig]')} Cannot find config file: ${color.dim(customConfigPath)}`);
9121
9102
  }
9122
9103
  for (let file of [
9123
- 'rsbuild.config.mjs',
9124
9104
  'rsbuild.config.ts',
9125
9105
  'rsbuild.config.js',
9126
- 'rsbuild.config.cjs',
9127
9106
  'rsbuild.config.mts',
9128
- 'rsbuild.config.cts'
9107
+ 'rsbuild.config.mjs',
9108
+ 'rsbuild.config.cts',
9109
+ 'rsbuild.config.cjs'
9129
9110
  ]){
9130
9111
  let configFile = join(root, file);
9131
9112
  if (node_fs.existsSync(configFile)) return configFile;
@@ -9290,7 +9271,7 @@ let applyServerOptions = (command)=>{
9290
9271
  };
9291
9272
  function setupCommands() {
9292
9273
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9293
- cli.version("2.0.0-rc.1"), 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)', {
9274
+ cli.version("2.0.0-rc.3"), 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)', {
9294
9275
  default: 'auto'
9295
9276
  }).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', {
9296
9277
  type: [
@@ -9367,7 +9348,7 @@ function initNodeEnv() {
9367
9348
  }
9368
9349
  function showGreeting() {
9369
9350
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9370
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.0.0-rc.1\n`);
9351
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.0.0-rc.3\n`);
9371
9352
  }
9372
9353
  function setupLogLevel() {
9373
9354
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9388,5 +9369,5 @@ function runCLI() {
9388
9369
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
9389
9370
  }
9390
9371
  }
9391
- let src_version = "2.0.0-rc.1";
9372
+ let src_version = "2.0.0-rc.3";
9392
9373
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, core_rspack as rspack, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger_createLogger as createLogger, mergeRsbuildConfig, runCLI, src_logger as logger, src_version as version };