@rsbuild/webpack 1.6.1 → 1.7.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,7 @@ This package can be used to switch Rsbuild's bundler from Rspack to webpack.
7
7
  <img src="https://img.shields.io/npm/v/@rsbuild/webpack?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
8
8
  </a>
9
9
  <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
10
- <a href="https://npmcharts.com/compare/@rsbuild/webpack?minimal=true"><img src="https://img.shields.io/npm/dm/@rsbuild/webpack.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
10
+ <a href="https://npmcharts.com/compare/@rsbuild/webpack"><img src="https://img.shields.io/npm/dm/@rsbuild/webpack.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
11
11
  </p>
12
12
 
13
13
  > Note that this package is mainly used for compatibility with Modern.js and Rsbuild internal testing. We do not recommend you to use this package in a Rsbuild project. The API of the current package may change over iterations.
@@ -1,11 +1,11 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_stream__ from "stream";
1
+ import * as __rspack_external_stream from "stream";
2
2
  import { __webpack_require__ } from "./rslib-runtime.js";
3
3
  import picocolors from "picocolors";
4
4
  import webpack from "webpack";
5
5
  import { Console } from "node:console";
6
- import { logger } from "./index.js";
6
+ import { logger } from "./131.js";
7
7
  __webpack_require__.add({
8
- "../../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js": function(module) {
8
+ "../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js" (module) {
9
9
  let ansiEscapes = module.exports;
10
10
  module.exports.default = ansiEscapes;
11
11
  let isTerminalApp = 'Apple_Terminal' === process.env.TERM_PROGRAM;
@@ -40,10 +40,10 @@ __webpack_require__.add({
40
40
  }
41
41
  };
42
42
  },
43
- "../../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js": function(module) {
43
+ "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js" (module) {
44
44
  module.exports = ({ onlyFirst = !1 } = {})=>RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))", onlyFirst ? void 0 : 'g');
45
45
  },
46
- "../../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
46
+ "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js" (module, __unused_rspack_exports, __webpack_require__) {
47
47
  let colorConvert;
48
48
  module = __webpack_require__.nmd(module);
49
49
  let wrapAnsi16 = (fn, offset)=>(...args)=>{
@@ -73,7 +73,7 @@ __webpack_require__.add({
73
73
  configurable: !0
74
74
  });
75
75
  }, makeDynamicStyles = (wrap, targetSpace, identity, isBackground)=>{
76
- void 0 === colorConvert && (colorConvert = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"));
76
+ void 0 === colorConvert && (colorConvert = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"));
77
77
  let offset = 10 * !!isBackground, styles = {};
78
78
  for (let [sourceSpace, suite] of Object.entries(colorConvert)){
79
79
  let name = 'ansi16' === sourceSpace ? 'ansi' : sourceSpace;
@@ -269,12 +269,12 @@ __webpack_require__.add({
269
269
  }
270
270
  });
271
271
  },
272
- "../../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js": function(module) {
272
+ "../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js" (module) {
273
273
  let regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]';
274
274
  module.exports = (options)=>options && options.exact ? RegExp(`^${regex}$`) : RegExp(regex, 'g');
275
275
  },
276
- "../../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
277
- let sliceAnsi = __webpack_require__("../../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js"), stringWidth = __webpack_require__("../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js");
276
+ "../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js" (module, __unused_rspack_exports, __webpack_require__) {
277
+ let sliceAnsi = __webpack_require__("../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js"), stringWidth = __webpack_require__("../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js");
278
278
  function getIndexOfNearestSpace(string, index, shouldSearchRight) {
279
279
  if (' ' === string.charAt(index)) return index;
280
280
  for(let i = 1; i <= 3; i++)if (shouldSearchRight) {
@@ -320,8 +320,8 @@ __webpack_require__.add({
320
320
  throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
321
321
  };
322
322
  },
323
- "../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js": function(module, __unused_webpack_exports, __webpack_require__) {
324
- let cssKeywords = __webpack_require__("../../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"), reverseKeywords = {};
323
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js" (module, __unused_rspack_exports, __webpack_require__) {
324
+ let cssKeywords = __webpack_require__("../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"), reverseKeywords = {};
325
325
  for (let key of Object.keys(cssKeywords))reverseKeywords[cssKeywords[key]] = key;
326
326
  let convert = {
327
327
  rgb: {
@@ -817,8 +817,8 @@ __webpack_require__.add({
817
817
  ];
818
818
  };
819
819
  },
820
- "../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
821
- let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {};
820
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js" (module, __unused_rspack_exports, __webpack_require__) {
821
+ let conversions = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {};
822
822
  function wrapRaw(fn) {
823
823
  let wrappedFn = function(...args) {
824
824
  let arg0 = args[0];
@@ -850,8 +850,8 @@ __webpack_require__.add({
850
850
  });
851
851
  }), module.exports = convert;
852
852
  },
853
- "../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js": function(module, __unused_webpack_exports, __webpack_require__) {
854
- let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js");
853
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js" (module, __unused_rspack_exports, __webpack_require__) {
854
+ let conversions = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js");
855
855
  function buildGraph() {
856
856
  let graph = {}, models = Object.keys(conversions);
857
857
  for(let len = models.length, i = 0; i < len; i++)graph[models[i]] = {
@@ -895,7 +895,7 @@ __webpack_require__.add({
895
895
  return conversion;
896
896
  };
897
897
  },
898
- "../../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js": function(module) {
898
+ "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js" (module) {
899
899
  module.exports = {
900
900
  aliceblue: [
901
901
  240,
@@ -1639,16 +1639,16 @@ __webpack_require__.add({
1639
1639
  ]
1640
1640
  };
1641
1641
  },
1642
- "../../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js": function(module) {
1642
+ "../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js" (module) {
1643
1643
  module.exports = function() {
1644
1644
  return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
1645
1645
  };
1646
1646
  },
1647
- "../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": function(module) {
1647
+ "../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js" (module) {
1648
1648
  let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) && (codePoint >= 0x1100 && (codePoint <= 0x115F || 0x2329 === codePoint || 0x232A === codePoint || 0x2E80 <= codePoint && codePoint <= 0x3247 && 0x303F !== codePoint || 0x3250 <= codePoint && codePoint <= 0x4DBF || 0x4E00 <= codePoint && codePoint <= 0xA4C6 || 0xA960 <= codePoint && codePoint <= 0xA97C || 0xAC00 <= codePoint && codePoint <= 0xD7A3 || 0xF900 <= codePoint && codePoint <= 0xFAFF || 0xFE10 <= codePoint && codePoint <= 0xFE19 || 0xFE30 <= codePoint && codePoint <= 0xFE6B || 0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || 0x1B000 <= codePoint && codePoint <= 0x1B001 || 0x1F200 <= codePoint && codePoint <= 0x1F251 || 0x20000 <= codePoint && codePoint <= 0x3FFFD) || !1);
1649
1649
  module.exports = isFullwidthCodePoint, module.exports.default = isFullwidthCodePoint;
1650
1650
  },
1651
- "../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1651
+ "../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1652
1652
  let stream_1 = __webpack_require__("stream"), CONSOLE_METHODS = [
1653
1653
  'assert',
1654
1654
  'count',
@@ -1680,8 +1680,8 @@ __webpack_require__.add({
1680
1680
  };
1681
1681
  };
1682
1682
  },
1683
- "../../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1684
- let isFullwidthCodePoint = __webpack_require__("../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), astralRegex = __webpack_require__("../../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js"), ansiStyles = __webpack_require__("../../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"), ESCAPES = [
1683
+ "../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1684
+ let isFullwidthCodePoint = __webpack_require__("../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), astralRegex = __webpack_require__("../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js"), ansiStyles = __webpack_require__("../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"), ESCAPES = [
1685
1685
  '\u001B',
1686
1686
  '\u009B'
1687
1687
  ], wrapAnsi = (code)=>`${ESCAPES[0]}[${code}m`, checkAnsi = (ansiCodes, isEscapes, endAnsiCode)=>{
@@ -1737,8 +1737,8 @@ __webpack_require__.add({
1737
1737
  return output;
1738
1738
  };
1739
1739
  },
1740
- "../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1741
- let stripAnsi = __webpack_require__("../../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"), isFullwidthCodePoint = __webpack_require__("../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), emojiRegex = __webpack_require__("../../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"), stringWidth = (string)=>{
1740
+ "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1741
+ let stripAnsi = __webpack_require__("../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"), isFullwidthCodePoint = __webpack_require__("../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), emojiRegex = __webpack_require__("../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"), stringWidth = (string)=>{
1742
1742
  if ('string' != typeof string || 0 === string.length || 0 === (string = stripAnsi(string)).length) return 0;
1743
1743
  string = string.replace(emojiRegex(), ' ');
1744
1744
  let width = 0;
@@ -1750,15 +1750,15 @@ __webpack_require__.add({
1750
1750
  };
1751
1751
  module.exports = stringWidth, module.exports.default = stringWidth;
1752
1752
  },
1753
- "../../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1754
- let ansiRegex = __webpack_require__("../../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js");
1753
+ "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1754
+ let ansiRegex = __webpack_require__("../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js");
1755
1755
  module.exports = (string)=>'string' == typeof string ? string.replace(ansiRegex(), '') : string;
1756
1756
  },
1757
- stream: function(module) {
1758
- module.exports = __WEBPACK_EXTERNAL_MODULE_stream__;
1757
+ stream (module) {
1758
+ module.exports = __rspack_external_stream;
1759
1759
  }
1760
1760
  });
1761
- let clamp = (x, min, max)=>Math.min(max, Math.max(min, x)), cli_truncate = __webpack_require__("../../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js");
1761
+ let clamp = (x, min, max)=>Math.min(max, Math.max(min, x)), cli_truncate = __webpack_require__("../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js");
1762
1762
  var cli_truncate_default = __webpack_require__.n(cli_truncate);
1763
1763
  let defaultOption = {
1764
1764
  total: 100,
@@ -1778,9 +1778,9 @@ let defaultOption = {
1778
1778
  id: '',
1779
1779
  maxIdLen: 16,
1780
1780
  hasErrors: !1
1781
- }, ansi_escapes = __webpack_require__("../../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js");
1781
+ }, ansi_escapes = __webpack_require__("../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js");
1782
1782
  var ansi_escapes_default = __webpack_require__.n(ansi_escapes);
1783
- let build = __webpack_require__("../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js");
1783
+ let build = __webpack_require__("../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js");
1784
1784
  var build_default = __webpack_require__.n(build);
1785
1785
  let colorList = [
1786
1786
  'green',
@@ -1887,7 +1887,7 @@ function createNonTTYLogger() {
1887
1887
  let suffix = picocolors.gray(`(${id})`);
1888
1888
  if (done) {
1889
1889
  if (100 === prevPercentage) return;
1890
- prevPercentage = 100, hasErrors ? logger.error(`built failed in ${compileTime} ${suffix}`) : logger.ready(`built in ${compileTime} ${suffix}`);
1890
+ prevPercentage = 100, hasErrors ? logger.error(`build failed in ${compileTime} ${suffix}`) : logger.ready(`built in ${compileTime} ${suffix}`);
1891
1891
  } else current - prevPercentage > 10 && (prevPercentage = current, logger.info(`build progress: ${current.toFixed(0)}% ${suffix}`));
1892
1892
  }
1893
1893
  };
package/dist/131.js ADDED
@@ -0,0 +1,294 @@
1
+ import { logger } from "@rsbuild/core";
2
+ import MultiStats from "webpack/lib/MultiStats.js";
3
+ import { reduceConfigsWithContext } from "reduce-configs";
4
+ import node_fs from "node:fs";
5
+ let castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
6
+ arr
7
+ ];
8
+ async function modifyWebpackChain(context, utils, chain) {
9
+ logger.debug('modify webpack chain');
10
+ let [modifiedChain] = await context.hooks.modifyWebpackChain.callChain({
11
+ environment: utils.environment.name,
12
+ args: [
13
+ chain,
14
+ utils
15
+ ]
16
+ });
17
+ if (utils.environment.config.tools?.webpackChain) for (let item of castArray(utils.environment.config.tools.webpackChain))item(modifiedChain, utils);
18
+ return logger.debug('modify webpack chain done'), modifiedChain;
19
+ }
20
+ async function modifyWebpackConfig(context, webpackConfig, utils) {
21
+ logger.debug('modify webpack config');
22
+ let [modifiedConfig] = await context.hooks.modifyWebpackConfig.callChain({
23
+ environment: utils.environment.name,
24
+ args: [
25
+ webpackConfig,
26
+ utils
27
+ ]
28
+ });
29
+ return utils.environment.config.tools?.webpack && (modifiedConfig = reduceConfigsWithContext({
30
+ initial: modifiedConfig,
31
+ config: utils.environment.config.tools.webpack,
32
+ ctx: utils,
33
+ mergeFn: utils.mergeConfig
34
+ })), logger.debug('modify webpack config done'), modifiedConfig;
35
+ }
36
+ async function getChainUtils(target, environment, environments, helpers) {
37
+ let { default: webpack } = await import("webpack");
38
+ return {
39
+ ...helpers.getChainUtils(target, environment, environments),
40
+ name: ({
41
+ web: 'client',
42
+ node: 'server',
43
+ 'web-worker': 'web-worker'
44
+ })[target] || '',
45
+ webpack,
46
+ HtmlWebpackPlugin: helpers.getHTMLPlugin()
47
+ };
48
+ }
49
+ async function generateWebpackConfig({ target, context, environment, helpers }) {
50
+ let chainUtils = await getChainUtils(target, context.environments[environment], context.environments, helpers), { default: webpack } = await import("webpack"), { BannerPlugin, DefinePlugin, IgnorePlugin, ProvidePlugin, SourceMapDevToolPlugin, HotModuleReplacementPlugin } = webpack, bundlerChain = await helpers.modifyBundlerChain(context, {
51
+ ...chainUtils,
52
+ bundler: {
53
+ BannerPlugin,
54
+ DefinePlugin,
55
+ IgnorePlugin,
56
+ ProvidePlugin,
57
+ SourceMapDevToolPlugin,
58
+ HotModuleReplacementPlugin
59
+ }
60
+ }), webpackConfig = (await modifyWebpackChain(context, chainUtils, bundlerChain)).toConfig(), configUtils = helpers.getConfigUtils(()=>webpackConfig, chainUtils);
61
+ return webpackConfig = await modifyWebpackConfig(context, webpackConfig, configUtils);
62
+ }
63
+ async function initConfigs({ context, pluginManager, rsbuildOptions, helpers }) {
64
+ let normalizedConfig = await helpers.initRsbuildConfig({
65
+ context,
66
+ pluginManager
67
+ }), webpackConfigs = await Promise.all(Object.entries(normalizedConfig.environments).map(([environment, config])=>generateWebpackConfig({
68
+ target: config.output.target,
69
+ context,
70
+ environment,
71
+ helpers
72
+ })));
73
+ if ('verbose' === logger.level) {
74
+ let inspect = async ()=>{
75
+ await helpers.inspectConfig({
76
+ context,
77
+ bundler: 'webpack',
78
+ pluginManager,
79
+ inspectOptions: {
80
+ verbose: !0,
81
+ writeToDisk: !0
82
+ },
83
+ rsbuildOptions,
84
+ bundlerConfigs: webpackConfigs
85
+ });
86
+ };
87
+ context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
88
+ isFirstCompile && await inspect();
89
+ }), context.hooks.onAfterStartDevServer.tap(inspect);
90
+ }
91
+ return {
92
+ webpackConfigs
93
+ };
94
+ }
95
+ async function createCompiler_createCompiler(options) {
96
+ logger.debug('creating compiler');
97
+ let HOOK_NAME = 'rsbuild:compiler', { helpers, context } = options, { webpackConfigs } = await initConfigs(options);
98
+ await context.hooks.onBeforeCreateCompiler.callBatch({
99
+ bundlerConfigs: webpackConfigs,
100
+ environments: context.environments
101
+ });
102
+ let { default: webpack } = await import("webpack"), compiler = webpack(1 === webpackConfigs.length ? webpackConfigs[0] : webpackConfigs);
103
+ return compiler.hooks.run.tap(HOOK_NAME, ()=>{
104
+ context.buildState.status = 'building';
105
+ }), compiler.hooks.watchRun.tap(HOOK_NAME, ()=>{
106
+ context.buildState.status = 'building';
107
+ }), compiler.hooks.invalid.tap(HOOK_NAME, ()=>{
108
+ context.buildState.stats = null, context.buildState.status = 'idle', context.buildState.hasErrors = !1;
109
+ }), compiler.hooks.done.tap(HOOK_NAME, (statsInstance)=>{
110
+ let stats = helpers.getRsbuildStats(statsInstance, compiler, context.action), hasErrors = statsInstance.hasErrors();
111
+ context.buildState.stats = stats, context.buildState.status = 'done', context.buildState.hasErrors = hasErrors, context.socketServer?.onBuildDone();
112
+ let { message, level } = helpers.formatStats(stats, hasErrors, context.rootPath);
113
+ 'error' === level ? logger.error(message) : 'warning' === level && logger.warn(message);
114
+ }), 'dev' === context.action && helpers.registerDevHook({
115
+ compiler,
116
+ context,
117
+ bundlerConfigs: webpackConfigs,
118
+ MultiStatsCtor: MultiStats
119
+ }), await context.hooks.onAfterCreateCompiler.callBatch({
120
+ compiler,
121
+ environments: context.environments
122
+ }), logger.debug('compiler created'), {
123
+ compiler,
124
+ webpackConfigs
125
+ };
126
+ }
127
+ let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
128
+ let compiler, bundlerConfigs, { helpers, context } = initOptions;
129
+ if (customCompiler) compiler = customCompiler, bundlerConfigs = customCompiler.options;
130
+ else {
131
+ let result = await createCompiler_createCompiler(initOptions);
132
+ compiler = result.compiler, bundlerConfigs = result.webpackConfigs;
133
+ }
134
+ if (helpers.registerBuildHook({
135
+ context,
136
+ bundlerConfigs: bundlerConfigs,
137
+ compiler,
138
+ isWatch: !!watch,
139
+ MultiStatsCtor: MultiStats
140
+ }), watch) return compiler.watch({}, (err)=>{
141
+ err && logger.error(err);
142
+ }), {
143
+ close: ()=>new Promise((resolve)=>{
144
+ compiler.close(()=>{
145
+ resolve();
146
+ });
147
+ })
148
+ };
149
+ let { stats } = await new Promise((resolve, reject)=>{
150
+ compiler.run((err, stats)=>{
151
+ err ? reject(err) : context.buildState.hasErrors ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
152
+ closeErr && logger.error(closeErr), resolve({
153
+ stats
154
+ });
155
+ });
156
+ });
157
+ });
158
+ return {
159
+ stats,
160
+ close: async ()=>{}
161
+ };
162
+ };
163
+ async function applyTsConfigPathsPlugin({ chain, CHAIN_ID, mainFields, extensions, configFile }) {
164
+ let { TsconfigPathsPlugin } = await import("tsconfig-paths-webpack-plugin");
165
+ chain.resolve.plugin(CHAIN_ID.RESOLVE_PLUGIN.TS_CONFIG_PATHS).use(TsconfigPathsPlugin, [
166
+ {
167
+ configFile,
168
+ extensions,
169
+ mainFields: mainFields
170
+ }
171
+ ]);
172
+ }
173
+ function isWebTarget(target) {
174
+ return castArray(target).includes('web') || target.includes('web-worker');
175
+ }
176
+ let webpackProvider = async ({ context, pluginManager, rsbuildOptions, helpers })=>{
177
+ let { default: cssExtractPlugin } = await import("mini-css-extract-plugin");
178
+ if (helpers.setCssExtractPlugin(cssExtractPlugin), helpers.setHTMLPlugin) {
179
+ let { default: htmlPlugin } = await import("html-webpack-plugin");
180
+ helpers.setHTMLPlugin(htmlPlugin);
181
+ }
182
+ let createCompiler = async ()=>(await createCompiler_createCompiler({
183
+ context,
184
+ pluginManager,
185
+ rsbuildOptions,
186
+ helpers
187
+ })).compiler;
188
+ return pluginManager.addPlugins([
189
+ {
190
+ name: 'rsbuild-webpack:adaptor',
191
+ setup (api) {
192
+ api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, target })=>{
193
+ let mainFields, { config, tsconfigPath } = environment, aliasStrategy = config.source.aliasStrategy ?? config.resolve.aliasStrategy;
194
+ tsconfigPath && 'prefer-tsconfig' === aliasStrategy && await applyTsConfigPathsPlugin({
195
+ chain,
196
+ CHAIN_ID,
197
+ configFile: tsconfigPath,
198
+ mainFields: (mainFields = chain.resolve.mainFields.values()).length ? mainFields : isWebTarget(target) ? [
199
+ 'browser',
200
+ 'module',
201
+ 'main'
202
+ ] : [
203
+ 'module',
204
+ 'main'
205
+ ],
206
+ extensions: chain.resolve.extensions.values()
207
+ });
208
+ let { progressBar } = config.dev;
209
+ if (progressBar) {
210
+ let { ProgressPlugin } = await import("./0~999.js").then((mod)=>({
211
+ ProgressPlugin: mod.ProgressPlugin
212
+ }));
213
+ chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
214
+ {
215
+ id: environment.name,
216
+ prettyTime: helpers.prettyTime,
217
+ ...!0 === progressBar ? {} : progressBar
218
+ }
219
+ ]);
220
+ }
221
+ let { copy } = config.output;
222
+ if (copy) {
223
+ let { default: CopyPlugin } = await import("copy-webpack-plugin"), options = Array.isArray(copy) ? {
224
+ patterns: copy
225
+ } : copy;
226
+ chain.plugin(CHAIN_ID.PLUGIN.COPY).use(CopyPlugin, [
227
+ options
228
+ ]);
229
+ }
230
+ }), api.modifyWebpackConfig(async (config)=>{
231
+ let copyPlugin = config.plugins?.find((item)=>item?.constructor.name === 'CopyPlugin');
232
+ copyPlugin && copyPlugin.patterns.every((pattern)=>'string' != typeof pattern && pattern.context && !node_fs.existsSync(pattern.context)) && (config.plugins = config.plugins?.filter((item)=>item?.constructor.name !== 'CopyPlugin'));
233
+ });
234
+ }
235
+ }
236
+ ]), {
237
+ bundler: 'webpack',
238
+ createCompiler,
239
+ async initConfigs () {
240
+ let { webpackConfigs } = await initConfigs({
241
+ context,
242
+ pluginManager,
243
+ rsbuildOptions,
244
+ helpers
245
+ });
246
+ return webpackConfigs;
247
+ },
248
+ async createDevServer (options) {
249
+ let config = await helpers.initRsbuildConfig({
250
+ context,
251
+ pluginManager
252
+ });
253
+ return helpers.createDevServer({
254
+ context,
255
+ pluginManager,
256
+ rsbuildOptions
257
+ }, createCompiler, config, options);
258
+ },
259
+ async startDevServer (options) {
260
+ let config = await helpers.initRsbuildConfig({
261
+ context,
262
+ pluginManager
263
+ });
264
+ return (await helpers.createDevServer({
265
+ context,
266
+ pluginManager,
267
+ rsbuildOptions
268
+ }, createCompiler, config, options)).listen();
269
+ },
270
+ build: async (options)=>build({
271
+ context,
272
+ pluginManager,
273
+ rsbuildOptions,
274
+ helpers
275
+ }, options),
276
+ async inspectConfig (inspectOptions) {
277
+ let bundlerConfigs = (await initConfigs({
278
+ context,
279
+ pluginManager,
280
+ rsbuildOptions,
281
+ helpers
282
+ })).webpackConfigs;
283
+ return await helpers.inspectConfig({
284
+ context,
285
+ pluginManager,
286
+ bundler: 'webpack',
287
+ bundlerConfigs,
288
+ rsbuildOptions,
289
+ inspectOptions
290
+ });
291
+ }
292
+ };
293
+ };
294
+ export { logger, webpackProvider };
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
3
  exports.ids = [
4
- "363"
4
+ "56"
5
5
  ], exports.modules = {
6
- "./src/progress/ProgressPlugin.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6
+ "./src/progress/ProgressPlugin.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
7
7
  __webpack_require__.d(__webpack_exports__, {
8
8
  ProgressPlugin: ()=>ProgressPlugin
9
9
  });
10
- var core_ = __webpack_require__("@rsbuild/core"), external_picocolors_ = __webpack_require__("picocolors"), external_picocolors_default = __webpack_require__.n(external_picocolors_), external_webpack_ = __webpack_require__("webpack"), external_webpack_default = __webpack_require__.n(external_webpack_), cli_truncate = __webpack_require__("../../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js"), cli_truncate_default = __webpack_require__.n(cli_truncate);
10
+ var core_ = __webpack_require__("@rsbuild/core"), external_picocolors_ = __webpack_require__("picocolors"), external_picocolors_default = __webpack_require__.n(external_picocolors_), external_webpack_ = __webpack_require__("webpack"), external_webpack_default = __webpack_require__.n(external_webpack_), cli_truncate = __webpack_require__("../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js"), cli_truncate_default = __webpack_require__.n(cli_truncate);
11
11
  let clamp = (x, min, max)=>Math.min(max, Math.max(min, x)), defaultOption = {
12
12
  total: 100,
13
13
  current: 0,
@@ -27,7 +27,7 @@ exports.ids = [
27
27
  maxIdLen: 16,
28
28
  hasErrors: !1
29
29
  };
30
- var external_node_console_ = __webpack_require__("node:console"), build = __webpack_require__("../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js"), build_default = __webpack_require__.n(build), ansi_escapes = __webpack_require__("../../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js"), ansi_escapes_default = __webpack_require__.n(ansi_escapes);
30
+ var external_node_console_ = __webpack_require__("node:console"), build = __webpack_require__("../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js"), build_default = __webpack_require__.n(build), ansi_escapes = __webpack_require__("../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js"), ansi_escapes_default = __webpack_require__.n(ansi_escapes);
31
31
  let colorList = [
32
32
  'green',
33
33
  'cyan',
@@ -134,7 +134,7 @@ exports.ids = [
134
134
  let suffix = external_picocolors_default().gray(`(${id})`);
135
135
  if (done) {
136
136
  if (100 === prevPercentage) return;
137
- prevPercentage = 100, hasErrors ? core_.logger.error(`built failed in ${compileTime} ${suffix}`) : core_.logger.ready(`built in ${compileTime} ${suffix}`);
137
+ prevPercentage = 100, hasErrors ? core_.logger.error(`build failed in ${compileTime} ${suffix}`) : core_.logger.ready(`built in ${compileTime} ${suffix}`);
138
138
  } else current - prevPercentage > 10 && (prevPercentage = current, core_.logger.info(`build progress: ${current.toFixed(0)}% ${suffix}`));
139
139
  }
140
140
  };
@@ -1,8 +1,8 @@
1
1
  const __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
2
2
  exports.ids = [
3
- "0"
3
+ "639"
4
4
  ], exports.modules = {
5
- "../../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js": function(module) {
5
+ "../../node_modules/.pnpm/ansi-escapes@4.3.2/node_modules/ansi-escapes/index.js" (module) {
6
6
  "use strict";
7
7
  let ansiEscapes = module.exports;
8
8
  module.exports.default = ansiEscapes;
@@ -38,11 +38,11 @@ exports.ids = [
38
38
  }
39
39
  };
40
40
  },
41
- "../../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js": function(module) {
41
+ "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js" (module) {
42
42
  "use strict";
43
43
  module.exports = ({ onlyFirst = !1 } = {})=>RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))", onlyFirst ? void 0 : 'g');
44
44
  },
45
- "../../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
45
+ "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js" (module, __unused_rspack_exports, __webpack_require__) {
46
46
  "use strict";
47
47
  let colorConvert;
48
48
  module = __webpack_require__.nmd(module);
@@ -73,7 +73,7 @@ exports.ids = [
73
73
  configurable: !0
74
74
  });
75
75
  }, makeDynamicStyles = (wrap, targetSpace, identity, isBackground)=>{
76
- void 0 === colorConvert && (colorConvert = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"));
76
+ void 0 === colorConvert && (colorConvert = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"));
77
77
  let offset = 10 * !!isBackground, styles = {};
78
78
  for (let [sourceSpace, suite] of Object.entries(colorConvert)){
79
79
  let name = 'ansi16' === sourceSpace ? 'ansi' : sourceSpace;
@@ -269,14 +269,14 @@ exports.ids = [
269
269
  }
270
270
  });
271
271
  },
272
- "../../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js": function(module) {
272
+ "../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js" (module) {
273
273
  "use strict";
274
274
  let regex = '[\uD800-\uDBFF][\uDC00-\uDFFF]';
275
275
  module.exports = (options)=>options && options.exact ? RegExp(`^${regex}$`) : RegExp(regex, 'g');
276
276
  },
277
- "../../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
277
+ "../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js" (module, __unused_rspack_exports, __webpack_require__) {
278
278
  "use strict";
279
- let sliceAnsi = __webpack_require__("../../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js"), stringWidth = __webpack_require__("../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js");
279
+ let sliceAnsi = __webpack_require__("../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js"), stringWidth = __webpack_require__("../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js");
280
280
  function getIndexOfNearestSpace(string, index, shouldSearchRight) {
281
281
  if (' ' === string.charAt(index)) return index;
282
282
  for(let i = 1; i <= 3; i++)if (shouldSearchRight) {
@@ -322,8 +322,8 @@ exports.ids = [
322
322
  throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
323
323
  };
324
324
  },
325
- "../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js": function(module, __unused_webpack_exports, __webpack_require__) {
326
- let cssKeywords = __webpack_require__("../../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"), reverseKeywords = {};
325
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js" (module, __unused_rspack_exports, __webpack_require__) {
326
+ let cssKeywords = __webpack_require__("../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"), reverseKeywords = {};
327
327
  for (let key of Object.keys(cssKeywords))reverseKeywords[cssKeywords[key]] = key;
328
328
  let convert = {
329
329
  rgb: {
@@ -819,8 +819,8 @@ exports.ids = [
819
819
  ];
820
820
  };
821
821
  },
822
- "../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
823
- let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {};
822
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js" (module, __unused_rspack_exports, __webpack_require__) {
823
+ let conversions = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"), route = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"), convert = {};
824
824
  function wrapRaw(fn) {
825
825
  let wrappedFn = function(...args) {
826
826
  let arg0 = args[0];
@@ -852,8 +852,8 @@ exports.ids = [
852
852
  });
853
853
  }), module.exports = convert;
854
854
  },
855
- "../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js": function(module, __unused_webpack_exports, __webpack_require__) {
856
- let conversions = __webpack_require__("../../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js");
855
+ "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js" (module, __unused_rspack_exports, __webpack_require__) {
856
+ let conversions = __webpack_require__("../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js");
857
857
  function buildGraph() {
858
858
  let graph = {}, models = Object.keys(conversions);
859
859
  for(let len = models.length, i = 0; i < len; i++)graph[models[i]] = {
@@ -897,7 +897,7 @@ exports.ids = [
897
897
  return conversion;
898
898
  };
899
899
  },
900
- "../../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js": function(module) {
900
+ "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js" (module) {
901
901
  "use strict";
902
902
  module.exports = {
903
903
  aliceblue: [
@@ -1642,18 +1642,18 @@ exports.ids = [
1642
1642
  ]
1643
1643
  };
1644
1644
  },
1645
- "../../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js": function(module) {
1645
+ "../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js" (module) {
1646
1646
  "use strict";
1647
1647
  module.exports = function() {
1648
1648
  return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
1649
1649
  };
1650
1650
  },
1651
- "../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js": function(module) {
1651
+ "../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js" (module) {
1652
1652
  "use strict";
1653
1653
  let isFullwidthCodePoint = (codePoint)=>!Number.isNaN(codePoint) && (codePoint >= 0x1100 && (codePoint <= 0x115F || 0x2329 === codePoint || 0x232A === codePoint || 0x2E80 <= codePoint && codePoint <= 0x3247 && 0x303F !== codePoint || 0x3250 <= codePoint && codePoint <= 0x4DBF || 0x4E00 <= codePoint && codePoint <= 0xA4C6 || 0xA960 <= codePoint && codePoint <= 0xA97C || 0xAC00 <= codePoint && codePoint <= 0xD7A3 || 0xF900 <= codePoint && codePoint <= 0xFAFF || 0xFE10 <= codePoint && codePoint <= 0xFE19 || 0xFE30 <= codePoint && codePoint <= 0xFE6B || 0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || 0x1B000 <= codePoint && codePoint <= 0x1B001 || 0x1F200 <= codePoint && codePoint <= 0x1F251 || 0x20000 <= codePoint && codePoint <= 0x3FFFD) || !1);
1654
1654
  module.exports = isFullwidthCodePoint, module.exports.default = isFullwidthCodePoint;
1655
1655
  },
1656
- "../../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1656
+ "../../node_modules/.pnpm/patch-console@1.0.0/node_modules/patch-console/build/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1657
1657
  "use strict";
1658
1658
  let stream_1 = __webpack_require__("stream"), CONSOLE_METHODS = [
1659
1659
  'assert',
@@ -1686,9 +1686,9 @@ exports.ids = [
1686
1686
  };
1687
1687
  };
1688
1688
  },
1689
- "../../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1689
+ "../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1690
1690
  "use strict";
1691
- let isFullwidthCodePoint = __webpack_require__("../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), astralRegex = __webpack_require__("../../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js"), ansiStyles = __webpack_require__("../../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"), ESCAPES = [
1691
+ let isFullwidthCodePoint = __webpack_require__("../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), astralRegex = __webpack_require__("../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js"), ansiStyles = __webpack_require__("../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"), ESCAPES = [
1692
1692
  '\u001B',
1693
1693
  '\u009B'
1694
1694
  ], wrapAnsi = (code)=>`${ESCAPES[0]}[${code}m`, checkAnsi = (ansiCodes, isEscapes, endAnsiCode)=>{
@@ -1744,9 +1744,9 @@ exports.ids = [
1744
1744
  return output;
1745
1745
  };
1746
1746
  },
1747
- "../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1747
+ "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1748
1748
  "use strict";
1749
- let stripAnsi = __webpack_require__("../../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"), isFullwidthCodePoint = __webpack_require__("../../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), emojiRegex = __webpack_require__("../../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"), stringWidth = (string)=>{
1749
+ let stripAnsi = __webpack_require__("../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"), isFullwidthCodePoint = __webpack_require__("../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"), emojiRegex = __webpack_require__("../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"), stringWidth = (string)=>{
1750
1750
  if ('string' != typeof string || 0 === string.length || 0 === (string = stripAnsi(string)).length) return 0;
1751
1751
  string = string.replace(emojiRegex(), ' ');
1752
1752
  let width = 0;
@@ -1758,9 +1758,9 @@ exports.ids = [
1758
1758
  };
1759
1759
  module.exports = stringWidth, module.exports.default = stringWidth;
1760
1760
  },
1761
- "../../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
1761
+ "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js" (module, __unused_rspack_exports, __webpack_require__) {
1762
1762
  "use strict";
1763
- let ansiRegex = __webpack_require__("../../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js");
1763
+ let ansiRegex = __webpack_require__("../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js");
1764
1764
  module.exports = (string)=>'string' == typeof string ? string.replace(ansiRegex(), '') : string;
1765
1765
  }
1766
1766
  };
package/dist/index.cjs CHANGED
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  const __rslib_import_meta_url__ = 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
3
3
  var __webpack_modules__ = {
4
- "@rsbuild/core": function(module) {
4
+ "@rsbuild/core" (module) {
5
5
  module.exports = require("@rsbuild/core");
6
6
  },
7
- "node:console": function(module) {
7
+ "node:console" (module) {
8
8
  module.exports = require("node:console");
9
9
  },
10
- picocolors: function(module) {
10
+ picocolors (module) {
11
11
  module.exports = require("picocolors");
12
12
  },
13
- stream: function(module) {
13
+ stream (module) {
14
14
  module.exports = require("stream");
15
15
  },
16
- webpack: function(module) {
16
+ webpack (module) {
17
17
  module.exports = require("webpack");
18
18
  }
19
19
  }, __webpack_module_cache__ = {};
@@ -57,7 +57,7 @@ __webpack_require__.m = __webpack_modules__, __webpack_require__.n = (module)=>{
57
57
  };
58
58
  })();
59
59
  var __webpack_exports__ = {};
60
- for(var __webpack_i__ in (()=>{
60
+ for(var __rspack_i in (()=>{
61
61
  __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
62
62
  webpackProvider: ()=>webpackProvider
63
63
  });
@@ -171,7 +171,7 @@ for(var __webpack_i__ in (()=>{
171
171
  }), compiler.hooks.done.tap(HOOK_NAME, (statsInstance)=>{
172
172
  let stats = helpers.getRsbuildStats(statsInstance, compiler, context.action), hasErrors = statsInstance.hasErrors();
173
173
  context.buildState.stats = stats, context.buildState.status = 'done', context.buildState.hasErrors = hasErrors, context.socketServer?.onBuildDone();
174
- let { message, level } = helpers.formatStats(stats, hasErrors);
174
+ let { message, level } = helpers.formatStats(stats, hasErrors, context.rootPath);
175
175
  'error' === level ? core_.logger.error(message) : 'warning' === level && core_.logger.warn(message);
176
176
  }), 'dev' === context.action && helpers.registerDevHook({
177
177
  compiler,
@@ -188,7 +188,7 @@ for(var __webpack_i__ in (()=>{
188
188
  }
189
189
  let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
190
190
  let compiler, bundlerConfigs, { helpers, context } = initOptions;
191
- if (customCompiler) compiler = customCompiler;
191
+ if (customCompiler) compiler = customCompiler, bundlerConfigs = customCompiler.options;
192
192
  else {
193
193
  let result = await createCompiler_createCompiler(initOptions);
194
194
  compiler = result.compiler, bundlerConfigs = result.webpackConfigs;
@@ -272,8 +272,8 @@ for(var __webpack_i__ in (()=>{
272
272
  let { progressBar } = config.dev;
273
273
  if (progressBar) {
274
274
  let { ProgressPlugin } = await Promise.all([
275
- __webpack_require__.e("0"),
276
- __webpack_require__.e("363")
275
+ __webpack_require__.e("639"),
276
+ __webpack_require__.e("56")
277
277
  ]).then(__webpack_require__.bind(__webpack_require__, "./src/progress/ProgressPlugin.ts"));
278
278
  chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
279
279
  {
@@ -358,7 +358,7 @@ for(var __webpack_i__ in (()=>{
358
358
  };
359
359
  })(), exports.webpackProvider = __webpack_exports__.webpackProvider, __webpack_exports__)-1 === [
360
360
  "webpackProvider"
361
- ].indexOf(__webpack_i__) && (exports[__webpack_i__] = __webpack_exports__[__webpack_i__]);
361
+ ].indexOf(__rspack_i) && (exports[__rspack_i] = __webpack_exports__[__rspack_i]);
362
362
  Object.defineProperty(exports, '__esModule', {
363
363
  value: !0
364
364
  });
package/dist/index.js CHANGED
@@ -1,294 +1 @@
1
- import { logger } from "@rsbuild/core";
2
- import MultiStats from "webpack/lib/MultiStats.js";
3
- import { reduceConfigsWithContext } from "reduce-configs";
4
- import node_fs from "node:fs";
5
- let castArray = (arr)=>void 0 === arr ? [] : Array.isArray(arr) ? arr : [
6
- arr
7
- ];
8
- async function modifyWebpackChain(context, utils, chain) {
9
- logger.debug('modify webpack chain');
10
- let [modifiedChain] = await context.hooks.modifyWebpackChain.callChain({
11
- environment: utils.environment.name,
12
- args: [
13
- chain,
14
- utils
15
- ]
16
- });
17
- if (utils.environment.config.tools?.webpackChain) for (let item of castArray(utils.environment.config.tools.webpackChain))item(modifiedChain, utils);
18
- return logger.debug('modify webpack chain done'), modifiedChain;
19
- }
20
- async function modifyWebpackConfig(context, webpackConfig, utils) {
21
- logger.debug('modify webpack config');
22
- let [modifiedConfig] = await context.hooks.modifyWebpackConfig.callChain({
23
- environment: utils.environment.name,
24
- args: [
25
- webpackConfig,
26
- utils
27
- ]
28
- });
29
- return utils.environment.config.tools?.webpack && (modifiedConfig = reduceConfigsWithContext({
30
- initial: modifiedConfig,
31
- config: utils.environment.config.tools.webpack,
32
- ctx: utils,
33
- mergeFn: utils.mergeConfig
34
- })), logger.debug('modify webpack config done'), modifiedConfig;
35
- }
36
- async function getChainUtils(target, environment, environments, helpers) {
37
- let { default: webpack } = await import("webpack");
38
- return {
39
- ...helpers.getChainUtils(target, environment, environments),
40
- name: ({
41
- web: 'client',
42
- node: 'server',
43
- 'web-worker': 'web-worker'
44
- })[target] || '',
45
- webpack,
46
- HtmlWebpackPlugin: helpers.getHTMLPlugin()
47
- };
48
- }
49
- async function generateWebpackConfig({ target, context, environment, helpers }) {
50
- let chainUtils = await getChainUtils(target, context.environments[environment], context.environments, helpers), { default: webpack } = await import("webpack"), { BannerPlugin, DefinePlugin, IgnorePlugin, ProvidePlugin, SourceMapDevToolPlugin, HotModuleReplacementPlugin } = webpack, bundlerChain = await helpers.modifyBundlerChain(context, {
51
- ...chainUtils,
52
- bundler: {
53
- BannerPlugin,
54
- DefinePlugin,
55
- IgnorePlugin,
56
- ProvidePlugin,
57
- SourceMapDevToolPlugin,
58
- HotModuleReplacementPlugin
59
- }
60
- }), webpackConfig = (await modifyWebpackChain(context, chainUtils, bundlerChain)).toConfig(), configUtils = helpers.getConfigUtils(()=>webpackConfig, chainUtils);
61
- return webpackConfig = await modifyWebpackConfig(context, webpackConfig, configUtils);
62
- }
63
- async function initConfigs({ context, pluginManager, rsbuildOptions, helpers }) {
64
- let normalizedConfig = await helpers.initRsbuildConfig({
65
- context,
66
- pluginManager
67
- }), webpackConfigs = await Promise.all(Object.entries(normalizedConfig.environments).map(([environment, config])=>generateWebpackConfig({
68
- target: config.output.target,
69
- context,
70
- environment,
71
- helpers
72
- })));
73
- if ('verbose' === logger.level) {
74
- let inspect = async ()=>{
75
- await helpers.inspectConfig({
76
- context,
77
- bundler: 'webpack',
78
- pluginManager,
79
- inspectOptions: {
80
- verbose: !0,
81
- writeToDisk: !0
82
- },
83
- rsbuildOptions,
84
- bundlerConfigs: webpackConfigs
85
- });
86
- };
87
- context.hooks.onBeforeBuild.tap(async ({ isFirstCompile })=>{
88
- isFirstCompile && await inspect();
89
- }), context.hooks.onAfterStartDevServer.tap(inspect);
90
- }
91
- return {
92
- webpackConfigs
93
- };
94
- }
95
- async function createCompiler_createCompiler(options) {
96
- logger.debug('creating compiler');
97
- let HOOK_NAME = 'rsbuild:compiler', { helpers, context } = options, { webpackConfigs } = await initConfigs(options);
98
- await context.hooks.onBeforeCreateCompiler.callBatch({
99
- bundlerConfigs: webpackConfigs,
100
- environments: context.environments
101
- });
102
- let { default: webpack } = await import("webpack"), compiler = webpack(1 === webpackConfigs.length ? webpackConfigs[0] : webpackConfigs);
103
- return compiler.hooks.run.tap(HOOK_NAME, ()=>{
104
- context.buildState.status = 'building';
105
- }), compiler.hooks.watchRun.tap(HOOK_NAME, ()=>{
106
- context.buildState.status = 'building';
107
- }), compiler.hooks.invalid.tap(HOOK_NAME, ()=>{
108
- context.buildState.stats = null, context.buildState.status = 'idle', context.buildState.hasErrors = !1;
109
- }), compiler.hooks.done.tap(HOOK_NAME, (statsInstance)=>{
110
- let stats = helpers.getRsbuildStats(statsInstance, compiler, context.action), hasErrors = statsInstance.hasErrors();
111
- context.buildState.stats = stats, context.buildState.status = 'done', context.buildState.hasErrors = hasErrors, context.socketServer?.onBuildDone();
112
- let { message, level } = helpers.formatStats(stats, hasErrors);
113
- 'error' === level ? logger.error(message) : 'warning' === level && logger.warn(message);
114
- }), 'dev' === context.action && helpers.registerDevHook({
115
- compiler,
116
- context,
117
- bundlerConfigs: webpackConfigs,
118
- MultiStatsCtor: MultiStats
119
- }), await context.hooks.onAfterCreateCompiler.callBatch({
120
- compiler,
121
- environments: context.environments
122
- }), logger.debug('compiler created'), {
123
- compiler,
124
- webpackConfigs
125
- };
126
- }
127
- let build = async (initOptions, { watch, compiler: customCompiler } = {})=>{
128
- let compiler, bundlerConfigs, { helpers, context } = initOptions;
129
- if (customCompiler) compiler = customCompiler;
130
- else {
131
- let result = await createCompiler_createCompiler(initOptions);
132
- compiler = result.compiler, bundlerConfigs = result.webpackConfigs;
133
- }
134
- if (helpers.registerBuildHook({
135
- context,
136
- bundlerConfigs: bundlerConfigs,
137
- compiler,
138
- isWatch: !!watch,
139
- MultiStatsCtor: MultiStats
140
- }), watch) return compiler.watch({}, (err)=>{
141
- err && logger.error(err);
142
- }), {
143
- close: ()=>new Promise((resolve)=>{
144
- compiler.close(()=>{
145
- resolve();
146
- });
147
- })
148
- };
149
- let { stats } = await new Promise((resolve, reject)=>{
150
- compiler.run((err, stats)=>{
151
- err ? reject(err) : context.buildState.hasErrors ? reject(Error('webpack build failed.')) : compiler.close((closeErr)=>{
152
- closeErr && logger.error(closeErr), resolve({
153
- stats
154
- });
155
- });
156
- });
157
- });
158
- return {
159
- stats,
160
- close: async ()=>{}
161
- };
162
- };
163
- async function applyTsConfigPathsPlugin({ chain, CHAIN_ID, mainFields, extensions, configFile }) {
164
- let { TsconfigPathsPlugin } = await import("tsconfig-paths-webpack-plugin");
165
- chain.resolve.plugin(CHAIN_ID.RESOLVE_PLUGIN.TS_CONFIG_PATHS).use(TsconfigPathsPlugin, [
166
- {
167
- configFile,
168
- extensions,
169
- mainFields: mainFields
170
- }
171
- ]);
172
- }
173
- function isWebTarget(target) {
174
- return castArray(target).includes('web') || target.includes('web-worker');
175
- }
176
- let webpackProvider = async ({ context, pluginManager, rsbuildOptions, helpers })=>{
177
- let { default: cssExtractPlugin } = await import("mini-css-extract-plugin");
178
- if (helpers.setCssExtractPlugin(cssExtractPlugin), helpers.setHTMLPlugin) {
179
- let { default: htmlPlugin } = await import("html-webpack-plugin");
180
- helpers.setHTMLPlugin(htmlPlugin);
181
- }
182
- let createCompiler = async ()=>(await createCompiler_createCompiler({
183
- context,
184
- pluginManager,
185
- rsbuildOptions,
186
- helpers
187
- })).compiler;
188
- return pluginManager.addPlugins([
189
- {
190
- name: 'rsbuild-webpack:adaptor',
191
- setup (api) {
192
- api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, target })=>{
193
- let mainFields, { config, tsconfigPath } = environment, aliasStrategy = config.source.aliasStrategy ?? config.resolve.aliasStrategy;
194
- tsconfigPath && 'prefer-tsconfig' === aliasStrategy && await applyTsConfigPathsPlugin({
195
- chain,
196
- CHAIN_ID,
197
- configFile: tsconfigPath,
198
- mainFields: (mainFields = chain.resolve.mainFields.values()).length ? mainFields : isWebTarget(target) ? [
199
- 'browser',
200
- 'module',
201
- 'main'
202
- ] : [
203
- 'module',
204
- 'main'
205
- ],
206
- extensions: chain.resolve.extensions.values()
207
- });
208
- let { progressBar } = config.dev;
209
- if (progressBar) {
210
- let { ProgressPlugin } = await import("./0~24.js").then((mod)=>({
211
- ProgressPlugin: mod.ProgressPlugin
212
- }));
213
- chain.plugin(CHAIN_ID.PLUGIN.PROGRESS).use(ProgressPlugin, [
214
- {
215
- id: environment.name,
216
- prettyTime: helpers.prettyTime,
217
- ...!0 === progressBar ? {} : progressBar
218
- }
219
- ]);
220
- }
221
- let { copy } = config.output;
222
- if (copy) {
223
- let { default: CopyPlugin } = await import("copy-webpack-plugin"), options = Array.isArray(copy) ? {
224
- patterns: copy
225
- } : copy;
226
- chain.plugin(CHAIN_ID.PLUGIN.COPY).use(CopyPlugin, [
227
- options
228
- ]);
229
- }
230
- }), api.modifyWebpackConfig(async (config)=>{
231
- let copyPlugin = config.plugins?.find((item)=>item?.constructor.name === 'CopyPlugin');
232
- copyPlugin && copyPlugin.patterns.every((pattern)=>'string' != typeof pattern && pattern.context && !node_fs.existsSync(pattern.context)) && (config.plugins = config.plugins?.filter((item)=>item?.constructor.name !== 'CopyPlugin'));
233
- });
234
- }
235
- }
236
- ]), {
237
- bundler: 'webpack',
238
- createCompiler,
239
- async initConfigs () {
240
- let { webpackConfigs } = await initConfigs({
241
- context,
242
- pluginManager,
243
- rsbuildOptions,
244
- helpers
245
- });
246
- return webpackConfigs;
247
- },
248
- async createDevServer (options) {
249
- let config = await helpers.initRsbuildConfig({
250
- context,
251
- pluginManager
252
- });
253
- return helpers.createDevServer({
254
- context,
255
- pluginManager,
256
- rsbuildOptions
257
- }, createCompiler, config, options);
258
- },
259
- async startDevServer (options) {
260
- let config = await helpers.initRsbuildConfig({
261
- context,
262
- pluginManager
263
- });
264
- return (await helpers.createDevServer({
265
- context,
266
- pluginManager,
267
- rsbuildOptions
268
- }, createCompiler, config, options)).listen();
269
- },
270
- build: async (options)=>build({
271
- context,
272
- pluginManager,
273
- rsbuildOptions,
274
- helpers
275
- }, options),
276
- async inspectConfig (inspectOptions) {
277
- let bundlerConfigs = (await initConfigs({
278
- context,
279
- pluginManager,
280
- rsbuildOptions,
281
- helpers
282
- })).webpackConfigs;
283
- return await helpers.inspectConfig({
284
- context,
285
- pluginManager,
286
- bundler: 'webpack',
287
- bundlerConfigs,
288
- rsbuildOptions,
289
- inspectOptions
290
- });
291
- }
292
- };
293
- };
294
- export { logger, webpackProvider };
1
+ export { webpackProvider } from "./131.js";
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@rsbuild/webpack",
3
- "version": "1.6.1",
3
+ "version": "1.7.0-beta.0",
4
4
  "homepage": "https://rsbuild.rs",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/web-infra-dev/rsbuild",
8
- "directory": "packages/compat/webpack"
8
+ "directory": "packages/webpack"
9
9
  },
10
10
  "license": "MIT",
11
11
  "type": "module",
@@ -24,22 +24,22 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "copy-webpack-plugin": "11.0.0",
27
- "html-webpack-plugin": "^5.6.4",
27
+ "html-webpack-plugin": "^5.6.5",
28
28
  "mini-css-extract-plugin": "2.9.4",
29
29
  "picocolors": "^1.1.1",
30
30
  "reduce-configs": "^1.1.1",
31
31
  "tsconfig-paths-webpack-plugin": "4.2.0",
32
- "webpack": "^5.102.1"
32
+ "webpack": "^5.104.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@rslib/core": "0.17.1",
36
- "@types/node": "^24.9.2",
35
+ "@rslib/core": "0.18.4",
36
+ "@types/node": "^24.10.4",
37
37
  "ansi-escapes": "4.3.2",
38
38
  "cli-truncate": "2.1.0",
39
39
  "patch-console": "1.0.0",
40
40
  "typescript": "^5.9.3",
41
- "@scripts/test-helper": "1.0.1",
42
- "@rsbuild/core": "1.6.4"
41
+ "@rsbuild/core": "1.7.0-beta.0",
42
+ "@scripts/test-helper": "1.0.1"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@rsbuild/core": "^1.3.21"