@rsbuild/core 0.7.1 → 0.7.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.
@@ -7637,18 +7637,18 @@ module.exports = parseJson;
7637
7637
 
7638
7638
  /***/ }),
7639
7639
 
7640
- /***/ 6399:
7640
+ /***/ 701:
7641
7641
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7642
7642
 
7643
- let tty = __nccwpck_require__(6224)
7644
-
7643
+ let argv = process.argv || [],
7644
+ env = process.env
7645
7645
  let isColorSupported =
7646
- !("NO_COLOR" in process.env || process.argv.includes("--no-color")) &&
7647
- ("FORCE_COLOR" in process.env ||
7648
- process.argv.includes("--color") ||
7646
+ !("NO_COLOR" in env || argv.includes("--no-color")) &&
7647
+ ("FORCE_COLOR" in env ||
7648
+ argv.includes("--color") ||
7649
7649
  process.platform === "win32" ||
7650
- (tty.isatty(1) && process.env.TERM !== "dumb") ||
7651
- "CI" in process.env)
7650
+ (require != null && (__nccwpck_require__(6224).isatty)(1) && env.TERM !== "dumb") ||
7651
+ "CI" in env)
7652
7652
 
7653
7653
  let formatter =
7654
7654
  (open, close, replace = open) =>
@@ -7661,40 +7661,47 @@ let formatter =
7661
7661
  }
7662
7662
 
7663
7663
  let replaceClose = (string, close, replace, index) => {
7664
- let start = string.substring(0, index) + replace
7665
- let end = string.substring(index + close.length)
7666
- let nextIndex = end.indexOf(close)
7667
- return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end
7668
- }
7669
-
7670
- let createColors = (enabled = isColorSupported) => ({
7671
- isColorSupported: enabled,
7672
- reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String,
7673
- bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String,
7674
- dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String,
7675
- italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String,
7676
- underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String,
7677
- inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String,
7678
- hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String,
7679
- strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String,
7680
- black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String,
7681
- red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String,
7682
- green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String,
7683
- yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String,
7684
- blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String,
7685
- magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String,
7686
- cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String,
7687
- white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String,
7688
- gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String,
7689
- bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String,
7690
- bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String,
7691
- bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String,
7692
- bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String,
7693
- bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String,
7694
- bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String,
7695
- bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String,
7696
- bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String,
7697
- })
7664
+ let result = ""
7665
+ let cursor = 0
7666
+ do {
7667
+ result += string.substring(cursor, index) + replace
7668
+ cursor = index + close.length
7669
+ index = string.indexOf(close, cursor)
7670
+ } while (~index)
7671
+ return result + string.substring(cursor)
7672
+ }
7673
+
7674
+ let createColors = (enabled = isColorSupported) => {
7675
+ let init = enabled ? formatter : () => String
7676
+ return {
7677
+ isColorSupported: enabled,
7678
+ reset: init("\x1b[0m", "\x1b[0m"),
7679
+ bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
7680
+ dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
7681
+ italic: init("\x1b[3m", "\x1b[23m"),
7682
+ underline: init("\x1b[4m", "\x1b[24m"),
7683
+ inverse: init("\x1b[7m", "\x1b[27m"),
7684
+ hidden: init("\x1b[8m", "\x1b[28m"),
7685
+ strikethrough: init("\x1b[9m", "\x1b[29m"),
7686
+ black: init("\x1b[30m", "\x1b[39m"),
7687
+ red: init("\x1b[31m", "\x1b[39m"),
7688
+ green: init("\x1b[32m", "\x1b[39m"),
7689
+ yellow: init("\x1b[33m", "\x1b[39m"),
7690
+ blue: init("\x1b[34m", "\x1b[39m"),
7691
+ magenta: init("\x1b[35m", "\x1b[39m"),
7692
+ cyan: init("\x1b[36m", "\x1b[39m"),
7693
+ white: init("\x1b[37m", "\x1b[39m"),
7694
+ gray: init("\x1b[90m", "\x1b[39m"),
7695
+ bgBlack: init("\x1b[40m", "\x1b[49m"),
7696
+ bgRed: init("\x1b[41m", "\x1b[49m"),
7697
+ bgGreen: init("\x1b[42m", "\x1b[49m"),
7698
+ bgYellow: init("\x1b[43m", "\x1b[49m"),
7699
+ bgBlue: init("\x1b[44m", "\x1b[49m"),
7700
+ bgMagenta: init("\x1b[45m", "\x1b[49m"),
7701
+ bgCyan: init("\x1b[46m", "\x1b[49m"),
7702
+ bgWhite: init("\x1b[47m", "\x1b[49m"),
7703
+ }
7704
+ }
7698
7705
 
7699
7706
  module.exports = createColors()
7700
7707
  module.exports.createColors = createColors
@@ -7702,17 +7709,17 @@ module.exports.createColors = createColors
7702
7709
 
7703
7710
  /***/ }),
7704
7711
 
7705
- /***/ 8933:
7712
+ /***/ 1595:
7706
7713
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
7707
7714
 
7708
7715
  "use strict";
7709
7716
 
7710
7717
 
7711
- module.exports = __nccwpck_require__(1683)["default"];
7718
+ module.exports = __nccwpck_require__(920)["default"];
7712
7719
 
7713
7720
  /***/ }),
7714
7721
 
7715
- /***/ 1683:
7722
+ /***/ 920:
7716
7723
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7717
7724
 
7718
7725
  "use strict";
@@ -7725,8 +7732,8 @@ __webpack_unused_export__ = ({
7725
7732
  exports["default"] = loader;
7726
7733
  var _path = _interopRequireDefault(__nccwpck_require__(1017));
7727
7734
  var _package = _interopRequireDefault(__nccwpck_require__(5446));
7728
- var _options = _interopRequireDefault(__nccwpck_require__(3712));
7729
- var _utils = __nccwpck_require__(1280);
7735
+ var _options = _interopRequireDefault(__nccwpck_require__(9489));
7736
+ var _utils = __nccwpck_require__(1949);
7730
7737
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7731
7738
  let hasExplicitDependencyOnPostCSS = false;
7732
7739
 
@@ -7787,7 +7794,7 @@ async function loader(content, sourceMap, meta) {
7787
7794
  // Reuse PostCSS AST from other loaders
7788
7795
  if (meta && meta.ast && meta.ast.type === "postcss" &&
7789
7796
  // eslint-disable-next-line global-require
7790
- (__nccwpck_require__(7992).satisfies)(meta.ast.version, `^${_package.default.version}`)) {
7797
+ (__nccwpck_require__(1280).satisfies)(meta.ast.version, `^${_package.default.version}`)) {
7791
7798
  ({
7792
7799
  root
7793
7800
  } = meta.ast);
@@ -7892,7 +7899,7 @@ async function loader(content, sourceMap, meta) {
7892
7899
 
7893
7900
  /***/ }),
7894
7901
 
7895
- /***/ 1280:
7902
+ /***/ 1949:
7896
7903
  /***/ ((module, exports, __nccwpck_require__) => {
7897
7904
 
7898
7905
  "use strict";
@@ -8586,7 +8593,7 @@ module.exports = require("@rsbuild/shared/jiti");
8586
8593
 
8587
8594
  /***/ }),
8588
8595
 
8589
- /***/ 7992:
8596
+ /***/ 1280:
8590
8597
  /***/ ((module) => {
8591
8598
 
8592
8599
  "use strict";
@@ -8678,7 +8685,7 @@ Object.defineProperty(exports, "__esModule", ({
8678
8685
  exports.codeFrameColumns = codeFrameColumns;
8679
8686
  exports["default"] = _default;
8680
8687
  var _highlight = __nccwpck_require__(8635);
8681
- var _picocolors = _interopRequireWildcard(__nccwpck_require__(6399), true);
8688
+ var _picocolors = _interopRequireWildcard(__nccwpck_require__(701), true);
8682
8689
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
8683
8690
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
8684
8691
  const colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
@@ -8830,7 +8837,7 @@ function _default(rawLines, lineNumber, colNumber, opts = {}) {
8830
8837
 
8831
8838
  /***/ }),
8832
8839
 
8833
- /***/ 752:
8840
+ /***/ 4707:
8834
8841
  /***/ ((__unused_webpack_module, exports) => {
8835
8842
 
8836
8843
  "use strict";
@@ -8908,7 +8915,7 @@ function isIdentifierName(name) {
8908
8915
 
8909
8916
  /***/ }),
8910
8917
 
8911
- /***/ 3596:
8918
+ /***/ 6764:
8912
8919
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
8913
8920
 
8914
8921
  "use strict";
@@ -8965,15 +8972,15 @@ Object.defineProperty(exports, "isStrictReservedWord", ({
8965
8972
  return _keyword.isStrictReservedWord;
8966
8973
  }
8967
8974
  }));
8968
- var _identifier = __nccwpck_require__(752);
8969
- var _keyword = __nccwpck_require__(6);
8975
+ var _identifier = __nccwpck_require__(4707);
8976
+ var _keyword = __nccwpck_require__(2727);
8970
8977
 
8971
8978
  //# sourceMappingURL=index.js.map
8972
8979
 
8973
8980
 
8974
8981
  /***/ }),
8975
8982
 
8976
- /***/ 6:
8983
+ /***/ 2727:
8977
8984
  /***/ ((__unused_webpack_module, exports) => {
8978
8985
 
8979
8986
  "use strict";
@@ -9028,8 +9035,8 @@ Object.defineProperty(exports, "__esModule", ({
9028
9035
  exports["default"] = highlight;
9029
9036
  exports.shouldHighlight = shouldHighlight;
9030
9037
  var _jsTokens = __nccwpck_require__(1192);
9031
- var _helperValidatorIdentifier = __nccwpck_require__(3596);
9032
- var _picocolors = _interopRequireWildcard(__nccwpck_require__(6399), true);
9038
+ var _helperValidatorIdentifier = __nccwpck_require__(6764);
9039
+ var _picocolors = _interopRequireWildcard(__nccwpck_require__(701), true);
9033
9040
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9034
9041
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9035
9042
  const colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
@@ -9143,7 +9150,7 @@ function highlight(code, options = {}) {
9143
9150
 
9144
9151
  /***/ }),
9145
9152
 
9146
- /***/ 3712:
9153
+ /***/ 9489:
9147
9154
  /***/ ((module) => {
9148
9155
 
9149
9156
  "use strict";
@@ -9271,7 +9278,7 @@ module.exports = JSON.parse('{"name":"postcss","version":"8.4.38","description":
9271
9278
  /******/ // startup
9272
9279
  /******/ // Load entry module and return exports
9273
9280
  /******/ // This entry module used 'module' so it can't be inlined
9274
- /******/ var __webpack_exports__ = __nccwpck_require__(8933);
9281
+ /******/ var __webpack_exports__ = __nccwpck_require__(1595);
9275
9282
  /******/ module.exports = __webpack_exports__;
9276
9283
  /******/
9277
9284
  /******/ })()
@@ -1,7 +1,7 @@
1
1
  /******/ (() => { // webpackBootstrap
2
2
  /******/ var __webpack_modules__ = ({
3
3
 
4
- /***/ 9138:
4
+ /***/ 8280:
5
5
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6
6
 
7
7
  "use strict";
@@ -105,7 +105,7 @@ exports.transformFiles = transformFiles;
105
105
 
106
106
  /***/ }),
107
107
 
108
- /***/ 9036:
108
+ /***/ 4134:
109
109
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
110
110
 
111
111
  "use strict";
@@ -116,7 +116,7 @@ const fs_1 = __nccwpck_require__(7147);
116
116
  const path_1 = __nccwpck_require__(1017);
117
117
  const tapable_1 = __nccwpck_require__(4260);
118
118
  const webpack_sources_1 = __nccwpck_require__(5433);
119
- const helpers_1 = __nccwpck_require__(9138);
119
+ const helpers_1 = __nccwpck_require__(8280);
120
120
  const compilerHookMap = new WeakMap();
121
121
  const getCompilerHooks = (compiler) => {
122
122
  let hooks = compilerHookMap.get(compiler);
@@ -7751,7 +7751,7 @@ var exports = __webpack_exports__;
7751
7751
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7752
7752
  exports.RspackManifestPlugin = exports.WebpackManifestPlugin = exports.getCompilerHooks = void 0;
7753
7753
  const path_1 = __nccwpck_require__(1017);
7754
- const hooks_1 = __nccwpck_require__(9036);
7754
+ const hooks_1 = __nccwpck_require__(4134);
7755
7755
  Object.defineProperty(exports, "getCompilerHooks", ({ enumerable: true, get: function () { return hooks_1.getCompilerHooks; } }));
7756
7756
  const emitCountMap = new Map();
7757
7757
  const defaults = {
@@ -11,8 +11,8 @@ function resolveFileName(stats) {
11
11
  }
12
12
  }
13
13
  }
14
- return `File: ${stats.moduleName}
15
- `;
14
+ return stats.moduleName ? `File: ${stats.moduleName}
15
+ ` : "";
16
16
  }
17
17
  function hintUnknownFiles(message) {
18
18
  const hint = "You may need an appropriate loader to handle this file type.";