@rsbuild/core 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 5067: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 6079: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(7733);
5
+ const loader = __nccwpck_require__(6161);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(8320).defaultGetLocalIdent;
8
+ __nccwpck_require__(3212).defaultGetLocalIdent;
9
9
  },
10
- 7733: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 6161: (__unused_webpack_module, exports, __nccwpck_require__) => {
11
11
  "use strict";
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports["default"] = loader;
14
14
  var _postcss = _interopRequireDefault(__nccwpck_require__(9409));
15
- var _plugins = __nccwpck_require__(6154);
16
- var _utils = __nccwpck_require__(8320);
15
+ var _plugins = __nccwpck_require__(4222);
16
+ var _utils = __nccwpck_require__(3212);
17
17
  function _interopRequireDefault(obj) {
18
18
  return obj && obj.__esModule ? obj : { default: obj };
19
19
  }
@@ -236,7 +236,7 @@
236
236
  callback(null, `${importCode}${moduleCode}${exportCode}`);
237
237
  }
238
238
  },
239
- 6154: (__unused_webpack_module, exports, __nccwpck_require__) => {
239
+ 4222: (__unused_webpack_module, exports, __nccwpck_require__) => {
240
240
  "use strict";
241
241
  Object.defineProperty(exports, "__esModule", { value: true });
242
242
  Object.defineProperty(exports, "icssParser", {
@@ -258,20 +258,22 @@
258
258
  },
259
259
  });
260
260
  var _postcssImportParser = _interopRequireDefault(
261
- __nccwpck_require__(3353),
261
+ __nccwpck_require__(7173),
262
262
  );
263
- var _postcssIcssParser = _interopRequireDefault(__nccwpck_require__(400));
264
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(343));
263
+ var _postcssIcssParser = _interopRequireDefault(
264
+ __nccwpck_require__(2420),
265
+ );
266
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(835));
265
267
  function _interopRequireDefault(obj) {
266
268
  return obj && obj.__esModule ? obj : { default: obj };
267
269
  }
268
270
  },
269
- 400: (__unused_webpack_module, exports, __nccwpck_require__) => {
271
+ 2420: (__unused_webpack_module, exports, __nccwpck_require__) => {
270
272
  "use strict";
271
273
  Object.defineProperty(exports, "__esModule", { value: true });
272
274
  exports["default"] = void 0;
273
275
  var _icssUtils = __nccwpck_require__(9028);
274
- var _utils = __nccwpck_require__(8320);
276
+ var _utils = __nccwpck_require__(3212);
275
277
  const plugin = (options = {}) => ({
276
278
  postcssPlugin: "postcss-icss-parser",
277
279
  async OnceExit(root) {
@@ -370,14 +372,14 @@
370
372
  plugin.postcss = true;
371
373
  var _default = (exports["default"] = plugin);
372
374
  },
373
- 3353: (__unused_webpack_module, exports, __nccwpck_require__) => {
375
+ 7173: (__unused_webpack_module, exports, __nccwpck_require__) => {
374
376
  "use strict";
375
377
  Object.defineProperty(exports, "__esModule", { value: true });
376
378
  exports["default"] = void 0;
377
379
  var _postcssValueParser = _interopRequireDefault(
378
380
  __nccwpck_require__(2948),
379
381
  );
380
- var _utils = __nccwpck_require__(8320);
382
+ var _utils = __nccwpck_require__(3212);
381
383
  function _interopRequireDefault(obj) {
382
384
  return obj && obj.__esModule ? obj : { default: obj };
383
385
  }
@@ -682,14 +684,14 @@
682
684
  plugin.postcss = true;
683
685
  var _default = (exports["default"] = plugin);
684
686
  },
685
- 343: (__unused_webpack_module, exports, __nccwpck_require__) => {
687
+ 835: (__unused_webpack_module, exports, __nccwpck_require__) => {
686
688
  "use strict";
687
689
  Object.defineProperty(exports, "__esModule", { value: true });
688
690
  exports["default"] = void 0;
689
691
  var _postcssValueParser = _interopRequireDefault(
690
692
  __nccwpck_require__(2948),
691
693
  );
692
- var _utils = __nccwpck_require__(8320);
694
+ var _utils = __nccwpck_require__(3212);
693
695
  function _interopRequireDefault(obj) {
694
696
  return obj && obj.__esModule ? obj : { default: obj };
695
697
  }
@@ -1032,7 +1034,7 @@
1032
1034
  plugin.postcss = true;
1033
1035
  var _default = (exports["default"] = plugin);
1034
1036
  },
1035
- 8320: (__unused_webpack_module, exports, __nccwpck_require__) => {
1037
+ 3212: (__unused_webpack_module, exports, __nccwpck_require__) => {
1036
1038
  "use strict";
1037
1039
  Object.defineProperty(exports, "__esModule", { value: true });
1038
1040
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -8096,6 +8098,6 @@
8096
8098
  }
8097
8099
  if (typeof __nccwpck_require__ !== "undefined")
8098
8100
  __nccwpck_require__.ab = __dirname + "/";
8099
- var __webpack_exports__ = __nccwpck_require__(5067);
8101
+ var __webpack_exports__ = __nccwpck_require__(6079);
8100
8102
  module.exports = __webpack_exports__;
8101
8103
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 822: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 776: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(431);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(397);
6
6
  const compilerMap = new WeakMap();
7
7
  class CachedChildCompilation {
8
8
  constructor(compiler) {
@@ -311,7 +311,7 @@
311
311
  }
312
312
  module.exports = { CachedChildCompilation };
313
313
  },
314
- 431: (module) => {
314
+ 397: (module) => {
315
315
  "use strict";
316
316
  class HtmlWebpackChildCompiler {
317
317
  constructor(templates) {
@@ -480,7 +480,7 @@
480
480
  }
481
481
  module.exports = { HtmlWebpackChildCompiler };
482
482
  },
483
- 293: (module) => {
483
+ 875: (module) => {
484
484
  "use strict";
485
485
  module.exports = {};
486
486
  module.exports.none = (chunks) => chunks;
@@ -499,7 +499,7 @@
499
499
  };
500
500
  module.exports.auto = module.exports.none;
501
501
  },
502
- 124: (module) => {
502
+ 926: (module) => {
503
503
  "use strict";
504
504
  module.exports = function (err) {
505
505
  return {
@@ -520,7 +520,7 @@
520
520
  };
521
521
  };
522
522
  },
523
- 827: (module, __unused_webpack_exports, __nccwpck_require__) => {
523
+ 829: (module, __unused_webpack_exports, __nccwpck_require__) => {
524
524
  "use strict";
525
525
  const { AsyncSeriesWaterfallHook } = __nccwpck_require__(408);
526
526
  const htmlWebpackPluginHooksMap = new WeakMap();
@@ -546,7 +546,7 @@
546
546
  }
547
547
  module.exports = { getHtmlRspackPluginHooks };
548
548
  },
549
- 218: (module) => {
549
+ 236: (module) => {
550
550
  const voidTags = [
551
551
  "area",
552
552
  "base",
@@ -614,19 +614,19 @@
614
614
  htmlTagObjectToString,
615
615
  };
616
616
  },
617
- 43: (module, __unused_webpack_exports, __nccwpck_require__) => {
617
+ 297: (module, __unused_webpack_exports, __nccwpck_require__) => {
618
618
  "use strict";
619
619
  const promisify = __nccwpck_require__(23).promisify;
620
620
  const vm = __nccwpck_require__(154);
621
621
  const fs = __nccwpck_require__(896);
622
622
  const path = __nccwpck_require__(928);
623
- const { CachedChildCompilation } = __nccwpck_require__(822);
623
+ const { CachedChildCompilation } = __nccwpck_require__(776);
624
624
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
625
- __nccwpck_require__(218);
626
- const prettyError = __nccwpck_require__(124);
627
- const chunkSorter = __nccwpck_require__(293);
625
+ __nccwpck_require__(236);
626
+ const prettyError = __nccwpck_require__(926);
627
+ const chunkSorter = __nccwpck_require__(875);
628
628
  const getHtmlRspackPluginHooks =
629
- __nccwpck_require__(827).getHtmlRspackPluginHooks;
629
+ __nccwpck_require__(829).getHtmlRspackPluginHooks;
630
630
  const WITH_PLACEHOLDER = "function __with_placeholder__";
631
631
  class HtmlRspackPlugin {
632
632
  constructor(userOptions = {}) {
@@ -1597,6 +1597,6 @@
1597
1597
  }
1598
1598
  if (typeof __nccwpck_require__ !== "undefined")
1599
1599
  __nccwpck_require__.ab = __dirname + "/";
1600
- var __webpack_exports__ = __nccwpck_require__(43);
1600
+ var __webpack_exports__ = __nccwpck_require__(297);
1601
1601
  module.exports = __webpack_exports__;
1602
1602
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 64: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(638)["default"];
4
+ 124: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(642)["default"];
6
6
  },
7
- 638: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 642: (__unused_webpack_module, exports, __nccwpck_require__) => {
8
8
  var __webpack_unused_export__;
9
9
  __webpack_unused_export__ = { value: true };
10
10
  exports["default"] = loader;
11
11
  var _path = _interopRequireDefault(__nccwpck_require__(928));
12
- var _utils = __nccwpck_require__(887);
12
+ var _utils = __nccwpck_require__(307);
13
13
  function _interopRequireDefault(obj) {
14
14
  return obj && obj.__esModule ? obj : { default: obj };
15
15
  }
@@ -179,7 +179,7 @@
179
179
  callback(null, result.css, map, { ast });
180
180
  }
181
181
  },
182
- 887: (module, exports, __nccwpck_require__) => {
182
+ 307: (module, exports, __nccwpck_require__) => {
183
183
  module = __nccwpck_require__.nmd(module);
184
184
  Object.defineProperty(exports, "__esModule", { value: true });
185
185
  exports.exec = exec;
@@ -716,6 +716,6 @@
716
716
  })();
717
717
  if (typeof __nccwpck_require__ !== "undefined")
718
718
  __nccwpck_require__.ab = __dirname + "/";
719
- var __webpack_exports__ = __nccwpck_require__(64);
719
+ var __webpack_exports__ = __nccwpck_require__(124);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 642: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 664: (__unused_webpack_module, exports, __nccwpck_require__) => {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.transformFiles =
7
7
  exports.reduceChunk =
@@ -120,7 +120,7 @@
120
120
  .map(standardizeFilePaths);
121
121
  exports.transformFiles = transformFiles;
122
122
  },
123
- 531: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 161: (__unused_webpack_module, exports, __nccwpck_require__) => {
124
124
  Object.defineProperty(exports, "__esModule", { value: true });
125
125
  exports.normalModuleLoaderHook =
126
126
  exports.getCompilerHooks =
@@ -130,7 +130,7 @@
130
130
  const fs_1 = __nccwpck_require__(896);
131
131
  const path_1 = __nccwpck_require__(928);
132
132
  const lite_tapable_1 = __nccwpck_require__(408);
133
- const helpers_1 = __nccwpck_require__(642);
133
+ const helpers_1 = __nccwpck_require__(664);
134
134
  const compilerHookMap = new WeakMap();
135
135
  const getCompilerHooks = (compiler) => {
136
136
  let hooks = compilerHookMap.get(compiler);
@@ -312,7 +312,7 @@
312
312
  exports.getCompilerHooks =
313
313
  void 0;
314
314
  const path_1 = __nccwpck_require__(928);
315
- const hooks_1 = __nccwpck_require__(531);
315
+ const hooks_1 = __nccwpck_require__(161);
316
316
  Object.defineProperty(exports, "getCompilerHooks", {
317
317
  enumerable: true,
318
318
  get: function () {
package/dist/index.cjs CHANGED
@@ -2250,7 +2250,7 @@ ${section.body}` : section.body).join("\n\n"));
2250
2250
  async function createContext(options, userConfig) {
2251
2251
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_namespaceObject.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
2252
2252
  return {
2253
- version: "1.4.6",
2253
+ version: "1.4.7",
2254
2254
  rootPath,
2255
2255
  distPath: '',
2256
2256
  cachePath,
@@ -2733,7 +2733,7 @@ ${section.body}` : section.body).join("\n\n"));
2733
2733
  }, await updateEnvironmentContext(context, environments);
2734
2734
  var context1 = context;
2735
2735
  let distPaths = Object.values(context1.environments).map((item)=>item.distPath);
2736
- context1.distPath = function(paths) {
2736
+ return context1.distPath = function(paths) {
2737
2737
  let uniquePaths = [
2738
2738
  ...new Set(paths)
2739
2739
  ];
@@ -2745,14 +2745,20 @@ ${section.body}` : section.body).join("\n\n"));
2745
2745
  else break;
2746
2746
  }
2747
2747
  return common.join(external_node_path_namespaceObject.sep);
2748
- }(distPaths);
2749
- var config = context.normalizedConfig;
2750
- if (config.server.base && !config.server.base.startsWith('/')) throw Error(`${picocolors_index_js_default().dim('[rsbuild:config]')} The ${picocolors_index_js_default().yellow('"server.base"')} option should start with a slash, for example: "/base"`);
2751
- if (config.environments) {
2752
- let names = Object.keys(config.environments), regexp = /^[\w$-]+$/;
2753
- for (let name of names)regexp.test(name) || index_js_namespaceObject.logger.warn(`${picocolors_index_js_default().dim('[rsbuild:config]')} Environment name "${picocolors_index_js_default().yellow(name)}" contains invalid characters. Only letters, numbers, "-", "_", and "$" are allowed.`);
2754
- }
2755
- return context.normalizedConfig;
2748
+ }(distPaths), ((config)=>{
2749
+ if (config.server.base && !config.server.base.startsWith('/')) throw Error(`${picocolors_index_js_default().dim('[rsbuild:config]')} The ${picocolors_index_js_default().yellow('"server.base"')} option should start with a slash, for example: "/base"`);
2750
+ if (!config.environments) return;
2751
+ let environmentNames = Object.keys(config.environments), environmentNameRegexp = /^[\w$-]+$/, validTargets = [
2752
+ 'web',
2753
+ 'node',
2754
+ 'web-worker'
2755
+ ];
2756
+ for (let name of environmentNames){
2757
+ environmentNameRegexp.test(name) || index_js_namespaceObject.logger.warn(`${picocolors_index_js_default().dim('[rsbuild:config]')} Environment name "${picocolors_index_js_default().yellow(name)}" contains invalid characters. Only letters, numbers, "-", "_", and "$" are allowed.`);
2758
+ let outputConfig = config.environments[name].output;
2759
+ if (outputConfig.target && !validTargets.includes(outputConfig.target)) throw Error(`${picocolors_index_js_default().dim('[rsbuild:config]')} Invalid value of ${picocolors_index_js_default().yellow('output.target')}: ${picocolors_index_js_default().yellow(`"${outputConfig.target}"`)}, valid values are: ${picocolors_index_js_default().yellow(validTargets.join(', '))}`);
2760
+ }
2761
+ })(context.normalizedConfig), context.normalizedConfig;
2756
2762
  }
2757
2763
  async function initConfigs({ context, pluginManager, rsbuildOptions }) {
2758
2764
  let normalizedConfig = await initRsbuildConfig({
@@ -3227,9 +3233,10 @@ ${section.body}` : section.body).join("\n\n"));
3227
3233
  }, formatBasicTag = (tag)=>({
3228
3234
  tag: tag.tagName,
3229
3235
  attrs: tag.attributes,
3230
- children: tag.innerHTML
3236
+ children: tag.innerHTML,
3237
+ metadata: tag.meta
3231
3238
  }), fromBasicTag = (tag)=>({
3232
- meta: {},
3239
+ meta: tag.metadata ?? {},
3233
3240
  tagName: tag.tag,
3234
3241
  attributes: tag.attrs ?? {},
3235
3242
  voidTag: VOID_TAGS.includes(tag.tag),
@@ -3458,7 +3465,24 @@ ${section.body}` : section.body).join("\n\n"));
3458
3465
  } catch {
3459
3466
  return !1;
3460
3467
  }
3461
- }, is_wsl = external_node_process_namespaceObject.env.__IS_WSL_TEST__ ? isWsl : isWsl();
3468
+ }, is_wsl = external_node_process_namespaceObject.env.__IS_WSL_TEST__ ? isWsl : isWsl(), wslDrivesMountPoint = (()=>{
3469
+ let mountPoint, defaultMountPoint = '/mnt/';
3470
+ return async function() {
3471
+ if (mountPoint) return mountPoint;
3472
+ let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
3473
+ try {
3474
+ await promises_namespaceObject.access(configFilePath, promises_namespaceObject.constants.F_OK), isConfigFileExists = !0;
3475
+ } catch {}
3476
+ if (!isConfigFileExists) return defaultMountPoint;
3477
+ let configContent = await promises_namespaceObject.readFile(configFilePath, {
3478
+ encoding: 'utf8'
3479
+ }), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
3480
+ return configMountPoint ? mountPoint = (mountPoint = configMountPoint.groups.mountPoint.trim()).endsWith('/') ? mountPoint : `${mountPoint}/` : defaultMountPoint;
3481
+ };
3482
+ })(), powerShellPathFromWsl = async ()=>{
3483
+ let mountPoint = await wslDrivesMountPoint();
3484
+ return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
3485
+ }, powerShellPath = async ()=>is_wsl ? powerShellPathFromWsl() : `${external_node_process_namespaceObject.env.SYSTEMROOT || external_node_process_namespaceObject.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
3462
3486
  function defineLazyProperty(object, propertyName, valueGetter) {
3463
3487
  let define = (value)=>Object.defineProperty(object, propertyName, {
3464
3488
  value,
@@ -3577,26 +3601,9 @@ ${section.body}` : section.body).join("\n\n"));
3577
3601
  if ('win32' === external_node_process_namespaceObject.platform) return defaultBrowser();
3578
3602
  throw Error('Only macOS, Linux, and Windows are supported');
3579
3603
  }
3580
- let execFile = external_node_util_namespaceObject.promisify(external_node_child_process_namespaceObject.execFile), open_dirname = external_node_path_namespaceObject.dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__)), localXdgOpenPath = external_node_path_namespaceObject.join(open_dirname, 'xdg-open'), { platform, arch } = external_node_process_namespaceObject, getWslDrivesMountPoint = (()=>{
3581
- let mountPoint, defaultMountPoint = '/mnt/';
3582
- return async function() {
3583
- if (mountPoint) return mountPoint;
3584
- let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
3585
- try {
3586
- await promises_namespaceObject.access(configFilePath, external_node_fs_namespaceObject.constants.F_OK), isConfigFileExists = !0;
3587
- } catch {}
3588
- if (!isConfigFileExists) return defaultMountPoint;
3589
- let configContent = await promises_namespaceObject.readFile(configFilePath, {
3590
- encoding: 'utf8'
3591
- }), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
3592
- return configMountPoint ? mountPoint = (mountPoint = configMountPoint.groups.mountPoint.trim()).endsWith('/') ? mountPoint : `${mountPoint}/` : defaultMountPoint;
3593
- };
3594
- })(), getPowershellPathFromWsl = async ()=>{
3595
- let mountPoint = await getWslDrivesMountPoint();
3596
- return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
3597
- };
3604
+ let execFile = (0, external_node_util_namespaceObject.promisify)(external_node_child_process_namespaceObject.execFile), open_dirname = external_node_path_namespaceObject.dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__)), localXdgOpenPath = external_node_path_namespaceObject.join(open_dirname, 'xdg-open'), { platform, arch } = external_node_process_namespaceObject;
3598
3605
  async function getWindowsDefaultBrowserFromWsl() {
3599
- let powershellPath = await getPowershellPathFromWsl(), encodedCommand = external_node_buffer_namespaceObject.Buffer.from('(Get-ItemProperty -Path "HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice").ProgId', 'utf16le').toString('base64'), { stdout } = await execFile(powershellPath, [
3606
+ let powershellPath = await powerShellPath(), rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, encodedCommand = external_node_buffer_namespaceObject.Buffer.from(rawCommand, 'utf16le').toString('base64'), { stdout } = await execFile(powershellPath, [
3600
3607
  '-NoProfile',
3601
3608
  '-NonInteractive',
3602
3609
  '-ExecutionPolicy',
@@ -3607,6 +3614,7 @@ ${section.body}` : section.body).join("\n\n"));
3607
3614
  encoding: 'utf8'
3608
3615
  }), progId = stdout.trim(), browserMap = {
3609
3616
  ChromeHTML: 'com.google.chrome',
3617
+ BraveHTML: 'com.brave.Browser',
3610
3618
  MSEdgeHTM: 'com.microsoft.edge',
3611
3619
  FirefoxURL: 'org.mozilla.firefox'
3612
3620
  };
@@ -3648,6 +3656,7 @@ ${section.body}` : section.body).join("\n\n"));
3648
3656
  let ids = {
3649
3657
  'com.google.chrome': 'chrome',
3650
3658
  'google-chrome.desktop': 'chrome',
3659
+ 'com.brave.Browser': 'brave',
3651
3660
  'org.mozilla.firefox': 'firefox',
3652
3661
  'firefox.desktop': 'firefox',
3653
3662
  'com.microsoft.msedge': 'edge',
@@ -3659,6 +3668,7 @@ ${section.body}` : section.body).join("\n\n"));
3659
3668
  let browserName = ids[browser.id];
3660
3669
  return 'browserPrivate' === app && appArguments.push({
3661
3670
  chrome: '--incognito',
3671
+ brave: '--incognito',
3662
3672
  firefox: '--private-window',
3663
3673
  edge: '--inPrivate'
3664
3674
  }[browserName]), baseOpen({
@@ -3684,7 +3694,7 @@ ${section.body}` : section.body).join("\n\n"));
3684
3694
  }
3685
3695
  appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = 'ignore', childProcessOptions.detached = !0);
3686
3696
  } else {
3687
- command = is_wsl ? await getPowershellPathFromWsl() : `${external_node_process_namespaceObject.env.SYSTEMROOT || external_node_process_namespaceObject.env.windir || 'C:\\Windows'}\\System32\\WindowsPowerShell\\v1.0\\powershell`, cliArguments.push('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand'), is_wsl || (childProcessOptions.windowsVerbatimArguments = !0);
3697
+ command = await powerShellPath(), cliArguments.push('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand'), is_wsl || (childProcessOptions.windowsVerbatimArguments = !0);
3688
3698
  let encodedArguments = [
3689
3699
  'Start'
3690
3700
  ];
@@ -3727,9 +3737,24 @@ ${section.body}` : section.body).join("\n\n"));
3727
3737
  '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
3728
3738
  ]
3729
3739
  }
3740
+ })), defineLazyProperty(apps, 'brave', ()=>detectPlatformBinary({
3741
+ darwin: 'brave browser',
3742
+ win32: 'brave',
3743
+ linux: [
3744
+ 'brave-browser',
3745
+ 'brave'
3746
+ ]
3747
+ }, {
3748
+ wsl: {
3749
+ ia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',
3750
+ x64: [
3751
+ '/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe',
3752
+ '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'
3753
+ ]
3754
+ }
3730
3755
  })), defineLazyProperty(apps, 'firefox', ()=>detectPlatformBinary({
3731
3756
  darwin: 'firefox',
3732
- win32: 'C:\\Program Files\\Mozilla Firefox\\firefox.exe',
3757
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
3733
3758
  linux: 'firefox'
3734
3759
  }, {
3735
3760
  wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe'
@@ -5902,7 +5927,7 @@ ${section.body}` : section.body).join("\n\n"));
5902
5927
  buildDependencies
5903
5928
  });
5904
5929
  }), api.onAfterCreateCompiler(()=>{
5905
- cacheEnabled && 'rspack' === api.context.bundlerType && index_js_namespaceObject.logger.info(`Rspack persistent cache enabled ${picocolors_index_js_default().dim('(experimental)')}`);
5930
+ cacheEnabled && 'rspack' === api.context.bundlerType && index_js_namespaceObject.logger.debug('Rspack persistent cache enabled');
5906
5931
  });
5907
5932
  }
5908
5933
  },
@@ -7864,11 +7889,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
7864
7889
  ].includes(level) && (index_js_namespaceObject.logger.level = level);
7865
7890
  }
7866
7891
  let { npm_execpath } = process.env;
7867
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && index_js_namespaceObject.logger.log(), index_js_namespaceObject.logger.greet(` Rsbuild v1.4.6\n`);
7892
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && index_js_namespaceObject.logger.log(), index_js_namespaceObject.logger.greet(` Rsbuild v1.4.7\n`);
7868
7893
  try {
7869
7894
  !function() {
7870
7895
  let cli = ((name = "")=>new CAC(name))('rsbuild');
7871
- cli.help(), cli.version("1.4.6"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
7896
+ cli.help(), cli.version("1.4.7"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
7872
7897
  default: 'jiti'
7873
7898
  }).option('-r, --root <root>', 'specify the project root directory, can be an absolute path or a path relative to cwd').option('-m, --mode <mode>', 'specify the build mode, can be `development`, `production` or `none`').option('--log-level <level>', 'specify the log level, can be `info`, `warn`, `error` or `silent`').option('--env-mode <mode>', 'specify the env mode to load the `.env.[mode]` file').option('--environment <name>', 'specify the name of environment to build', {
7874
7899
  type: [
@@ -7926,7 +7951,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
7926
7951
  index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), index_js_namespaceObject.logger.error(err);
7927
7952
  }
7928
7953
  }
7929
- let src_version = "1.4.6";
7954
+ let src_version = "1.4.7";
7930
7955
  })(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defaultAllowedOrigins = __webpack_exports__.defaultAllowedOrigins, exports.defineConfig = __webpack_exports__.defineConfig, exports.ensureAssetPrefix = __webpack_exports__.ensureAssetPrefix, exports.loadConfig = __webpack_exports__.loadConfig, exports.loadEnv = __webpack_exports__.loadEnv, exports.logger = __webpack_exports__.logger, exports.mergeRsbuildConfig = __webpack_exports__.mergeRsbuildConfig, exports.rspack = __webpack_exports__.rspack, exports.runCLI = __webpack_exports__.runCLI, exports.version = __webpack_exports__.version, __webpack_exports__)-1 === [
7931
7956
  "PLUGIN_CSS_NAME",
7932
7957
  "PLUGIN_SWC_NAME",
package/dist/index.js CHANGED
@@ -12,12 +12,12 @@ import node_os, { constants as external_node_os_constants } from "node:os";
12
12
  import node_process from "node:process";
13
13
  import rspack_chain from "../compiled/rspack-chain/index.js";
14
14
  import { isPromise, isRegExp } from "node:util/types";
15
- import node_util, { promisify as external_node_util_promisify } from "node:util";
15
+ import { promisify as external_node_util_promisify } from "node:util";
16
16
  import { lookup } from "../compiled/mrmime/index.js";
17
17
  import node_zlib from "node:zlib";
18
18
  import { Buffer as external_node_buffer_Buffer } from "node:buffer";
19
19
  import node_child_process, { execFile } from "node:child_process";
20
- import promises from "node:fs/promises";
20
+ import promises, { constants as promises_constants } from "node:fs/promises";
21
21
  var EsmMode, __webpack_modules__ = {
22
22
  "../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
23
23
  let clone = __webpack_require__("../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js"), typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js"), isPlainObject = __webpack_require__("../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js");
@@ -2065,7 +2065,7 @@ async function updateEnvironmentContext(context, configs) {
2065
2065
  async function createContext(options, userConfig) {
2066
2066
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = join(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
2067
2067
  return {
2068
- version: "1.4.6",
2068
+ version: "1.4.7",
2069
2069
  rootPath,
2070
2070
  distPath: '',
2071
2071
  cachePath,
@@ -2540,7 +2540,7 @@ async function initRsbuildConfig({ context, pluginManager }) {
2540
2540
  environments
2541
2541
  }, await updateEnvironmentContext(context, environments);
2542
2542
  let distPaths = Object.values(context.environments).map((item)=>item.distPath);
2543
- context.distPath = function(paths) {
2543
+ return context.distPath = function(paths) {
2544
2544
  let uniquePaths = [
2545
2545
  ...new Set(paths)
2546
2546
  ];
@@ -2552,14 +2552,20 @@ async function initRsbuildConfig({ context, pluginManager }) {
2552
2552
  else break;
2553
2553
  }
2554
2554
  return common.join(sep);
2555
- }(distPaths);
2556
- var config = context.normalizedConfig;
2557
- if (config.server.base && !config.server.base.startsWith('/')) throw Error(`${picocolors.dim('[rsbuild:config]')} The ${picocolors.yellow('"server.base"')} option should start with a slash, for example: "/base"`);
2558
- if (config.environments) {
2559
- let names = Object.keys(config.environments), regexp = /^[\w$-]+$/;
2560
- for (let name of names)regexp.test(name) || logger.warn(`${picocolors.dim('[rsbuild:config]')} Environment name "${picocolors.yellow(name)}" contains invalid characters. Only letters, numbers, "-", "_", and "$" are allowed.`);
2561
- }
2562
- return context.normalizedConfig;
2555
+ }(distPaths), ((config)=>{
2556
+ if (config.server.base && !config.server.base.startsWith('/')) throw Error(`${picocolors.dim('[rsbuild:config]')} The ${picocolors.yellow('"server.base"')} option should start with a slash, for example: "/base"`);
2557
+ if (!config.environments) return;
2558
+ let environmentNames = Object.keys(config.environments), environmentNameRegexp = /^[\w$-]+$/, validTargets = [
2559
+ 'web',
2560
+ 'node',
2561
+ 'web-worker'
2562
+ ];
2563
+ for (let name of environmentNames){
2564
+ environmentNameRegexp.test(name) || logger.warn(`${picocolors.dim('[rsbuild:config]')} Environment name "${picocolors.yellow(name)}" contains invalid characters. Only letters, numbers, "-", "_", and "$" are allowed.`);
2565
+ let outputConfig = config.environments[name].output;
2566
+ if (outputConfig.target && !validTargets.includes(outputConfig.target)) throw Error(`${picocolors.dim('[rsbuild:config]')} Invalid value of ${picocolors.yellow('output.target')}: ${picocolors.yellow(`"${outputConfig.target}"`)}, valid values are: ${picocolors.yellow(validTargets.join(', '))}`);
2567
+ }
2568
+ })(context.normalizedConfig), context.normalizedConfig;
2563
2569
  }
2564
2570
  async function initConfigs({ context, pluginManager, rsbuildOptions }) {
2565
2571
  let normalizedConfig = await initRsbuildConfig({
@@ -3032,9 +3038,10 @@ let entryNameSymbol = Symbol('entryName'), VOID_TAGS = [
3032
3038
  }, formatBasicTag = (tag)=>({
3033
3039
  tag: tag.tagName,
3034
3040
  attrs: tag.attributes,
3035
- children: tag.innerHTML
3041
+ children: tag.innerHTML,
3042
+ metadata: tag.meta
3036
3043
  }), fromBasicTag = (tag)=>({
3037
- meta: {},
3044
+ meta: tag.metadata ?? {},
3038
3045
  tagName: tag.tag,
3039
3046
  attributes: tag.attrs ?? {},
3040
3047
  voidTag: VOID_TAGS.includes(tag.tag),
@@ -3263,7 +3270,24 @@ let isWsl = ()=>{
3263
3270
  } catch {
3264
3271
  return !1;
3265
3272
  }
3266
- }, is_wsl = node_process.env.__IS_WSL_TEST__ ? isWsl : isWsl();
3273
+ }, is_wsl = node_process.env.__IS_WSL_TEST__ ? isWsl : isWsl(), wslDrivesMountPoint = (()=>{
3274
+ let mountPoint, defaultMountPoint = '/mnt/';
3275
+ return async function() {
3276
+ if (mountPoint) return mountPoint;
3277
+ let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
3278
+ try {
3279
+ await promises.access(configFilePath, promises_constants.F_OK), isConfigFileExists = !0;
3280
+ } catch {}
3281
+ if (!isConfigFileExists) return defaultMountPoint;
3282
+ let configContent = await promises.readFile(configFilePath, {
3283
+ encoding: 'utf8'
3284
+ }), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
3285
+ return configMountPoint ? mountPoint = (mountPoint = configMountPoint.groups.mountPoint.trim()).endsWith('/') ? mountPoint : `${mountPoint}/` : defaultMountPoint;
3286
+ };
3287
+ })(), powerShellPathFromWsl = async ()=>{
3288
+ let mountPoint = await wslDrivesMountPoint();
3289
+ return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
3290
+ }, powerShellPath = async ()=>is_wsl ? powerShellPathFromWsl() : `${node_process.env.SYSTEMROOT || node_process.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
3267
3291
  function defineLazyProperty(object, propertyName, valueGetter) {
3268
3292
  let define = (value)=>Object.defineProperty(object, propertyName, {
3269
3293
  value,
@@ -3382,26 +3406,9 @@ async function default_browser_defaultBrowser() {
3382
3406
  if ('win32' === node_process.platform) return defaultBrowser();
3383
3407
  throw Error('Only macOS, Linux, and Windows are supported');
3384
3408
  }
3385
- let open_execFile = node_util.promisify(node_child_process.execFile), open_dirname = node_path.dirname(fileURLToPath(import.meta.url)), localXdgOpenPath = node_path.join(open_dirname, 'xdg-open'), { platform, arch } = node_process, getWslDrivesMountPoint = (()=>{
3386
- let mountPoint, defaultMountPoint = '/mnt/';
3387
- return async function() {
3388
- if (mountPoint) return mountPoint;
3389
- let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
3390
- try {
3391
- await promises.access(configFilePath, external_node_fs_constants.F_OK), isConfigFileExists = !0;
3392
- } catch {}
3393
- if (!isConfigFileExists) return defaultMountPoint;
3394
- let configContent = await promises.readFile(configFilePath, {
3395
- encoding: 'utf8'
3396
- }), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
3397
- return configMountPoint ? mountPoint = (mountPoint = configMountPoint.groups.mountPoint.trim()).endsWith('/') ? mountPoint : `${mountPoint}/` : defaultMountPoint;
3398
- };
3399
- })(), getPowershellPathFromWsl = async ()=>{
3400
- let mountPoint = await getWslDrivesMountPoint();
3401
- return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
3402
- };
3409
+ let open_execFile = external_node_util_promisify(node_child_process.execFile), open_dirname = node_path.dirname(fileURLToPath(import.meta.url)), localXdgOpenPath = node_path.join(open_dirname, 'xdg-open'), { platform, arch } = node_process;
3403
3410
  async function getWindowsDefaultBrowserFromWsl() {
3404
- let powershellPath = await getPowershellPathFromWsl(), encodedCommand = external_node_buffer_Buffer.from('(Get-ItemProperty -Path "HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice").ProgId', 'utf16le').toString('base64'), { stdout } = await open_execFile(powershellPath, [
3411
+ let powershellPath = await powerShellPath(), rawCommand = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, encodedCommand = external_node_buffer_Buffer.from(rawCommand, 'utf16le').toString('base64'), { stdout } = await open_execFile(powershellPath, [
3405
3412
  '-NoProfile',
3406
3413
  '-NonInteractive',
3407
3414
  '-ExecutionPolicy',
@@ -3412,6 +3419,7 @@ async function getWindowsDefaultBrowserFromWsl() {
3412
3419
  encoding: 'utf8'
3413
3420
  }), progId = stdout.trim(), browserMap = {
3414
3421
  ChromeHTML: 'com.google.chrome',
3422
+ BraveHTML: 'com.brave.Browser',
3415
3423
  MSEdgeHTM: 'com.microsoft.edge',
3416
3424
  FirefoxURL: 'org.mozilla.firefox'
3417
3425
  };
@@ -3453,6 +3461,7 @@ let pTryEach = async (array, mapper)=>{
3453
3461
  let ids = {
3454
3462
  'com.google.chrome': 'chrome',
3455
3463
  'google-chrome.desktop': 'chrome',
3464
+ 'com.brave.Browser': 'brave',
3456
3465
  'org.mozilla.firefox': 'firefox',
3457
3466
  'firefox.desktop': 'firefox',
3458
3467
  'com.microsoft.msedge': 'edge',
@@ -3464,6 +3473,7 @@ let pTryEach = async (array, mapper)=>{
3464
3473
  let browserName = ids[browser.id];
3465
3474
  return 'browserPrivate' === app && appArguments.push({
3466
3475
  chrome: '--incognito',
3476
+ brave: '--incognito',
3467
3477
  firefox: '--private-window',
3468
3478
  edge: '--inPrivate'
3469
3479
  }[browserName]), baseOpen({
@@ -3489,7 +3499,7 @@ let pTryEach = async (array, mapper)=>{
3489
3499
  }
3490
3500
  appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = 'ignore', childProcessOptions.detached = !0);
3491
3501
  } else {
3492
- command = is_wsl ? await getPowershellPathFromWsl() : `${node_process.env.SYSTEMROOT || node_process.env.windir || 'C:\\Windows'}\\System32\\WindowsPowerShell\\v1.0\\powershell`, cliArguments.push('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand'), is_wsl || (childProcessOptions.windowsVerbatimArguments = !0);
3502
+ command = await powerShellPath(), cliArguments.push('-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-EncodedCommand'), is_wsl || (childProcessOptions.windowsVerbatimArguments = !0);
3493
3503
  let encodedArguments = [
3494
3504
  'Start'
3495
3505
  ];
@@ -3532,9 +3542,24 @@ defineLazyProperty(apps, 'chrome', ()=>detectPlatformBinary({
3532
3542
  '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'
3533
3543
  ]
3534
3544
  }
3545
+ })), defineLazyProperty(apps, 'brave', ()=>detectPlatformBinary({
3546
+ darwin: 'brave browser',
3547
+ win32: 'brave',
3548
+ linux: [
3549
+ 'brave-browser',
3550
+ 'brave'
3551
+ ]
3552
+ }, {
3553
+ wsl: {
3554
+ ia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',
3555
+ x64: [
3556
+ '/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe',
3557
+ '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'
3558
+ ]
3559
+ }
3535
3560
  })), defineLazyProperty(apps, 'firefox', ()=>detectPlatformBinary({
3536
3561
  darwin: 'firefox',
3537
- win32: 'C:\\Program Files\\Mozilla Firefox\\firefox.exe',
3562
+ win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
3538
3563
  linux: 'firefox'
3539
3564
  }, {
3540
3565
  wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe'
@@ -5691,7 +5716,7 @@ async function applyDefaultPlugins(pluginManager, context) {
5691
5716
  buildDependencies
5692
5717
  });
5693
5718
  }), api.onAfterCreateCompiler(()=>{
5694
- cacheEnabled && 'rspack' === api.context.bundlerType && logger.info(`Rspack persistent cache enabled ${picocolors.dim('(experimental)')}`);
5719
+ cacheEnabled && 'rspack' === api.context.bundlerType && logger.debug('Rspack persistent cache enabled');
5695
5720
  });
5696
5721
  }
5697
5722
  },
@@ -7647,11 +7672,11 @@ async function runCLI() {
7647
7672
  ].includes(level) && (logger.level = level);
7648
7673
  }
7649
7674
  let { npm_execpath } = process.env;
7650
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && logger.log(), logger.greet(` Rsbuild v1.4.6\n`);
7675
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && logger.log(), logger.greet(` Rsbuild v1.4.7\n`);
7651
7676
  try {
7652
7677
  !function() {
7653
7678
  let cli = ((name = "")=>new CAC(name))('rsbuild');
7654
- cli.help(), cli.version("1.4.6"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
7679
+ cli.help(), cli.version("1.4.7"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
7655
7680
  default: 'jiti'
7656
7681
  }).option('-r, --root <root>', 'specify the project root directory, can be an absolute path or a path relative to cwd').option('-m, --mode <mode>', 'specify the build mode, can be `development`, `production` or `none`').option('--log-level <level>', 'specify the log level, can be `info`, `warn`, `error` or `silent`').option('--env-mode <mode>', 'specify the env mode to load the `.env.[mode]` file').option('--environment <name>', 'specify the name of environment to build', {
7657
7682
  type: [
@@ -7709,5 +7734,5 @@ async function runCLI() {
7709
7734
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
7710
7735
  }
7711
7736
  }
7712
- let src_version = "1.4.6";
7737
+ let src_version = "1.4.7";
7713
7738
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, src_version as version };
@@ -19,4 +19,4 @@ export { type Logger, logger } from './logger';
19
19
  export { mergeRsbuildConfig } from './mergeConfig';
20
20
  export type { RsbuildDevServer } from './server/devServer';
21
21
  export type { StartServerResult } from './server/helper';
22
- export type { AliasStrategy, AppIcon, AppIconItem, Build, BuildOptions, BundlerPluginInstance, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModifyWebpackChainFn, ModifyWebpackChainUtils, ModifyWebpackConfigFn, ModifyWebpackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, RequestHandler, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildProvider, RsbuildProviderHelpers, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SplitChunks, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFiles, } from './types';
22
+ export type { AliasStrategy, AppIcon, AppIconItem, Build, BuildOptions, BundlerPluginInstance, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModifyWebpackChainFn, ModifyWebpackChainUtils, ModifyWebpackConfigFn, ModifyWebpackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartProdServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartProdServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OutputConfig, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, RequestHandler, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildProvider, RsbuildProviderHelpers, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SplitChunks, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFiles, } from './types';
@@ -1146,6 +1146,12 @@ export type HtmlBasicTag = {
1146
1146
  * HTML escaping, so ensure it's safe to prevent XSS vulnerabilities.
1147
1147
  */
1148
1148
  children?: string;
1149
+ /**
1150
+ * The metadata object for tags, used to store additional information about tags.
1151
+ * `metadata` does not affect the generated HTML content.
1152
+ * @default undefined
1153
+ */
1154
+ metadata?: Record<string, any>;
1149
1155
  };
1150
1156
  export type HtmlTag = HtmlBasicTag & {
1151
1157
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -46,17 +46,17 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "1.4.6",
49
+ "@rspack/core": "1.4.8",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
51
  "@swc/helpers": "^0.5.17",
52
52
  "core-js": "~3.44.0",
53
53
  "jiti": "^2.4.2"
54
54
  },
55
55
  "devDependencies": {
56
- "@rslib/core": "0.10.4",
56
+ "@rslib/core": "0.10.5",
57
57
  "@types/connect": "3.4.38",
58
58
  "@types/cors": "^2.8.19",
59
- "@types/node": "^22.16.0",
59
+ "@types/node": "^22.16.4",
60
60
  "@types/on-finished": "2.3.5",
61
61
  "@types/webpack-bundle-analyzer": "4.7.0",
62
62
  "@types/ws": "^8.18.1",
@@ -74,7 +74,7 @@
74
74
  "launch-editor-middleware": "^2.10.0",
75
75
  "mrmime": "^2.0.1",
76
76
  "on-finished": "2.4.1",
77
- "open": "^10.1.2",
77
+ "open": "^10.2.0",
78
78
  "picocolors": "^1.1.1",
79
79
  "postcss": "^8.5.6",
80
80
  "postcss-load-config": "6.0.1",