@rsbuild/core 1.4.5 → 1.4.6

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
- 5860: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 5067: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(6218);
5
+ const loader = __nccwpck_require__(7733);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(6091).defaultGetLocalIdent;
8
+ __nccwpck_require__(8320).defaultGetLocalIdent;
9
9
  },
10
- 6218: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 7733: (__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__(9609);
16
- var _utils = __nccwpck_require__(6091);
15
+ var _plugins = __nccwpck_require__(6154);
16
+ var _utils = __nccwpck_require__(8320);
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
- 9609: (__unused_webpack_module, exports, __nccwpck_require__) => {
239
+ 6154: (__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,22 +258,20 @@
258
258
  },
259
259
  });
260
260
  var _postcssImportParser = _interopRequireDefault(
261
- __nccwpck_require__(8034),
261
+ __nccwpck_require__(3353),
262
262
  );
263
- var _postcssIcssParser = _interopRequireDefault(
264
- __nccwpck_require__(7323),
265
- );
266
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(3294));
263
+ var _postcssIcssParser = _interopRequireDefault(__nccwpck_require__(400));
264
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(343));
267
265
  function _interopRequireDefault(obj) {
268
266
  return obj && obj.__esModule ? obj : { default: obj };
269
267
  }
270
268
  },
271
- 7323: (__unused_webpack_module, exports, __nccwpck_require__) => {
269
+ 400: (__unused_webpack_module, exports, __nccwpck_require__) => {
272
270
  "use strict";
273
271
  Object.defineProperty(exports, "__esModule", { value: true });
274
272
  exports["default"] = void 0;
275
273
  var _icssUtils = __nccwpck_require__(9028);
276
- var _utils = __nccwpck_require__(6091);
274
+ var _utils = __nccwpck_require__(8320);
277
275
  const plugin = (options = {}) => ({
278
276
  postcssPlugin: "postcss-icss-parser",
279
277
  async OnceExit(root) {
@@ -372,14 +370,14 @@
372
370
  plugin.postcss = true;
373
371
  var _default = (exports["default"] = plugin);
374
372
  },
375
- 8034: (__unused_webpack_module, exports, __nccwpck_require__) => {
373
+ 3353: (__unused_webpack_module, exports, __nccwpck_require__) => {
376
374
  "use strict";
377
375
  Object.defineProperty(exports, "__esModule", { value: true });
378
376
  exports["default"] = void 0;
379
377
  var _postcssValueParser = _interopRequireDefault(
380
378
  __nccwpck_require__(2948),
381
379
  );
382
- var _utils = __nccwpck_require__(6091);
380
+ var _utils = __nccwpck_require__(8320);
383
381
  function _interopRequireDefault(obj) {
384
382
  return obj && obj.__esModule ? obj : { default: obj };
385
383
  }
@@ -684,14 +682,14 @@
684
682
  plugin.postcss = true;
685
683
  var _default = (exports["default"] = plugin);
686
684
  },
687
- 3294: (__unused_webpack_module, exports, __nccwpck_require__) => {
685
+ 343: (__unused_webpack_module, exports, __nccwpck_require__) => {
688
686
  "use strict";
689
687
  Object.defineProperty(exports, "__esModule", { value: true });
690
688
  exports["default"] = void 0;
691
689
  var _postcssValueParser = _interopRequireDefault(
692
690
  __nccwpck_require__(2948),
693
691
  );
694
- var _utils = __nccwpck_require__(6091);
692
+ var _utils = __nccwpck_require__(8320);
695
693
  function _interopRequireDefault(obj) {
696
694
  return obj && obj.__esModule ? obj : { default: obj };
697
695
  }
@@ -1034,7 +1032,7 @@
1034
1032
  plugin.postcss = true;
1035
1033
  var _default = (exports["default"] = plugin);
1036
1034
  },
1037
- 6091: (__unused_webpack_module, exports, __nccwpck_require__) => {
1035
+ 8320: (__unused_webpack_module, exports, __nccwpck_require__) => {
1038
1036
  "use strict";
1039
1037
  Object.defineProperty(exports, "__esModule", { value: true });
1040
1038
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -8098,6 +8096,6 @@
8098
8096
  }
8099
8097
  if (typeof __nccwpck_require__ !== "undefined")
8100
8098
  __nccwpck_require__.ab = __dirname + "/";
8101
- var __webpack_exports__ = __nccwpck_require__(5860);
8099
+ var __webpack_exports__ = __nccwpck_require__(5067);
8102
8100
  module.exports = __webpack_exports__;
8103
8101
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 1: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 822: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(34);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(431);
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
- 34: (module) => {
314
+ 431: (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
- 578: (module) => {
483
+ 293: (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
- 909: (module) => {
502
+ 124: (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
- 468: (module, __unused_webpack_exports, __nccwpck_require__) => {
523
+ 827: (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
- 113: (module) => {
549
+ 218: (module) => {
550
550
  const voidTags = [
551
551
  "area",
552
552
  "base",
@@ -614,19 +614,19 @@
614
614
  htmlTagObjectToString,
615
615
  };
616
616
  },
617
- 404: (module, __unused_webpack_exports, __nccwpck_require__) => {
617
+ 43: (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__(1);
623
+ const { CachedChildCompilation } = __nccwpck_require__(822);
624
624
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
625
- __nccwpck_require__(113);
626
- const prettyError = __nccwpck_require__(909);
627
- const chunkSorter = __nccwpck_require__(578);
625
+ __nccwpck_require__(218);
626
+ const prettyError = __nccwpck_require__(124);
627
+ const chunkSorter = __nccwpck_require__(293);
628
628
  const getHtmlRspackPluginHooks =
629
- __nccwpck_require__(468).getHtmlRspackPluginHooks;
629
+ __nccwpck_require__(827).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__(404);
1600
+ var __webpack_exports__ = __nccwpck_require__(43);
1601
1601
  module.exports = __webpack_exports__;
1602
1602
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 490: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(440)["default"];
4
+ 64: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(638)["default"];
6
6
  },
7
- 440: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 638: (__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__(457);
12
+ var _utils = __nccwpck_require__(887);
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
- 457: (module, exports, __nccwpck_require__) => {
182
+ 887: (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__(490);
719
+ var __webpack_exports__ = __nccwpck_require__(64);
720
720
  module.exports = __webpack_exports__;
721
721
  })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 139: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 642: (__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
- 782: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 531: (__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__(139);
133
+ const helpers_1 = __nccwpck_require__(642);
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__(782);
315
+ const hooks_1 = __nccwpck_require__(531);
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.5",
2253
+ version: "1.4.6",
2254
2254
  rootPath,
2255
2255
  distPath: '',
2256
2256
  cachePath,
@@ -3583,7 +3583,7 @@ ${section.body}` : section.body).join("\n\n"));
3583
3583
  if (mountPoint) return mountPoint;
3584
3584
  let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
3585
3585
  try {
3586
- await promises_namespaceObject.access(configFilePath, promises_namespaceObject.constants.F_OK), isConfigFileExists = !0;
3586
+ await promises_namespaceObject.access(configFilePath, external_node_fs_namespaceObject.constants.F_OK), isConfigFileExists = !0;
3587
3587
  } catch {}
3588
3588
  if (!isConfigFileExists) return defaultMountPoint;
3589
3589
  let configContent = await promises_namespaceObject.readFile(configFilePath, {
@@ -3678,7 +3678,7 @@ ${section.body}` : section.body).join("\n\n"));
3678
3678
  else {
3679
3679
  let isBundled = !open_dirname || '/' === open_dirname, exeLocalXdgOpen = !1;
3680
3680
  try {
3681
- await promises_namespaceObject.access(localXdgOpenPath, promises_namespaceObject.constants.X_OK), exeLocalXdgOpen = !0;
3681
+ await promises_namespaceObject.access(localXdgOpenPath, external_node_fs_namespaceObject.constants.X_OK), exeLocalXdgOpen = !0;
3682
3682
  } catch {}
3683
3683
  command = external_node_process_namespaceObject.versions.electron ?? ('android' === platform || isBundled || !exeLocalXdgOpen) ? 'xdg-open' : localXdgOpenPath;
3684
3684
  }
@@ -7864,11 +7864,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
7864
7864
  ].includes(level) && (index_js_namespaceObject.logger.level = level);
7865
7865
  }
7866
7866
  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.5\n`);
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`);
7868
7868
  try {
7869
7869
  !function() {
7870
7870
  let cli = ((name = "")=>new CAC(name))('rsbuild');
7871
- cli.help(), cli.version("1.4.5"), 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`', {
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`', {
7872
7872
  default: 'jiti'
7873
7873
  }).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
7874
  type: [
@@ -7926,7 +7926,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
7926
7926
  index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), index_js_namespaceObject.logger.error(err);
7927
7927
  }
7928
7928
  }
7929
- let src_version = "1.4.5";
7929
+ let src_version = "1.4.6";
7930
7930
  })(), 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
7931
  "PLUGIN_CSS_NAME",
7932
7932
  "PLUGIN_SWC_NAME",
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { logger } from "../compiled/rslog/index.js";
5
5
  import node_path, { dirname, isAbsolute as external_node_path_isAbsolute, join, posix, relative, sep } from "node:path";
6
6
  import { URL as external_node_url_URL, fileURLToPath, pathToFileURL } from "node:url";
7
7
  import picocolors from "../compiled/picocolors/index.js";
8
- import node_fs, { existsSync } from "node:fs";
8
+ import node_fs, { constants as external_node_fs_constants, existsSync } from "node:fs";
9
9
  import { EventEmitter } from "events";
10
10
  import { createRequire } from "node:module";
11
11
  import node_os, { constants as external_node_os_constants } from "node:os";
@@ -17,7 +17,7 @@ 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, { constants as promises_constants } from "node:fs/promises";
20
+ import promises 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.5",
2068
+ version: "1.4.6",
2069
2069
  rootPath,
2070
2070
  distPath: '',
2071
2071
  cachePath,
@@ -3388,7 +3388,7 @@ let open_execFile = node_util.promisify(node_child_process.execFile), open_dirna
3388
3388
  if (mountPoint) return mountPoint;
3389
3389
  let configFilePath = '/etc/wsl.conf', isConfigFileExists = !1;
3390
3390
  try {
3391
- await promises.access(configFilePath, promises_constants.F_OK), isConfigFileExists = !0;
3391
+ await promises.access(configFilePath, external_node_fs_constants.F_OK), isConfigFileExists = !0;
3392
3392
  } catch {}
3393
3393
  if (!isConfigFileExists) return defaultMountPoint;
3394
3394
  let configContent = await promises.readFile(configFilePath, {
@@ -3483,7 +3483,7 @@ let pTryEach = async (array, mapper)=>{
3483
3483
  else {
3484
3484
  let exeLocalXdgOpen = !1;
3485
3485
  try {
3486
- await promises.access(localXdgOpenPath, promises_constants.X_OK), exeLocalXdgOpen = !0;
3486
+ await promises.access(localXdgOpenPath, external_node_fs_constants.X_OK), exeLocalXdgOpen = !0;
3487
3487
  } catch {}
3488
3488
  command = node_process.versions.electron ?? ('android' === platform || !open_dirname || '/' === open_dirname || !exeLocalXdgOpen) ? 'xdg-open' : localXdgOpenPath;
3489
3489
  }
@@ -7647,11 +7647,11 @@ async function runCLI() {
7647
7647
  ].includes(level) && (logger.level = level);
7648
7648
  }
7649
7649
  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.5\n`);
7650
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && logger.log(), logger.greet(` Rsbuild v1.4.6\n`);
7651
7651
  try {
7652
7652
  !function() {
7653
7653
  let cli = ((name = "")=>new CAC(name))('rsbuild');
7654
- cli.help(), cli.version("1.4.5"), 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`', {
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`', {
7655
7655
  default: 'jiti'
7656
7656
  }).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
7657
  type: [
@@ -7709,5 +7709,5 @@ async function runCLI() {
7709
7709
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
7710
7710
  }
7711
7711
  }
7712
- let src_version = "1.4.5";
7712
+ let src_version = "1.4.6";
7713
7713
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, src_version as version };
@@ -1110,25 +1110,76 @@ export type MetaOptions = {
1110
1110
  [name: string]: string | false | MetaAttrs;
1111
1111
  };
1112
1112
  export type HtmlBasicTag = {
1113
+ /**
1114
+ * The HTML tag name to be generated. Should be a valid HTML element name.
1115
+ * @example
1116
+ * - `'script'` for JavaScript files
1117
+ * - `'link'` for stylesheets or external resources
1118
+ * - `'meta'` for metadata
1119
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element
1120
+ */
1113
1121
  tag: string;
1122
+ /**
1123
+ * HTML attributes to be applied to the tag.
1124
+ * - `string` values will be rendered as `attribute="value"`
1125
+ * - `true` renders as boolean attribute (e.g., `<input disabled>`)
1126
+ * - `false` or `null` or `undefined` values will omit the attribute
1127
+ *
1128
+ * @example
1129
+ * // String attributes
1130
+ * attrs: {
1131
+ * src: 'https://example.com/script.js',
1132
+ * type: 'text/javascript',
1133
+ * }
1134
+ * // Result: <script src="https://example.com/script.js" type="text/javascript">
1135
+
1136
+ * // Boolean attributes
1137
+ * attrs: {
1138
+ * async: true, // <script async>
1139
+ * defer: false, // attribute omitted
1140
+ * }
1141
+ * // Result: <script async>
1142
+ */
1114
1143
  attrs?: Record<string, string | boolean | null | undefined>;
1144
+ /**
1145
+ * The innerHTML content of the tag. The content is inserted as-is without
1146
+ * HTML escaping, so ensure it's safe to prevent XSS vulnerabilities.
1147
+ */
1115
1148
  children?: string;
1116
1149
  };
1117
1150
  export type HtmlTag = HtmlBasicTag & {
1118
- /** @default false */
1151
+ /**
1152
+ * Controls whether to add a hash query parameter to asset URLs for cache invalidation.
1153
+ * Only affects the `src` attribute of the `script` tag and the `href` attribute of the `link` tag.
1154
+ * - `false`: No hash query
1155
+ * - `true`: Generate hash based on HTML content
1156
+ * - `string`: Uses a custom hash string
1157
+ * - `function`: Custom hash generation via a function
1158
+ * @default false
1159
+ */
1119
1160
  hash?: boolean | string | ((url: string, hash: string) => string);
1120
- /** @default true */
1161
+ /**
1162
+ * Controls whether to prepend the asset prefix to resource URLs.
1163
+ * Only affects the `src` attribute of the `script` tag and the `href` attribute of the `link` tag.
1164
+ * - `true`: Prepends asset prefix to the URL
1165
+ * - `false`: Uses the URL as-is
1166
+ * - `string`: Uses a custom prefix
1167
+ * - `function`: Custom path transformation via a function
1168
+ * @default true
1169
+ */
1121
1170
  publicPath?: boolean | string | ((url: string, publicPath: string) => string);
1122
1171
  /**
1123
- * Defines the injection position of the current tag relative to existing tags
1124
- * - When set to `true`, the tag will be inserted after existing tags
1125
- * - When set to `false`, the tag will be inserted before existing tags
1172
+ * Defines the injection position relative to existing tags.
1173
+ * - `true`: Insert after existing tags
1174
+ * - `false`: Insert before existing tags
1126
1175
  * @default true
1127
1176
  */
1128
1177
  append?: boolean;
1129
1178
  /**
1130
- * Specifies whether to add the current tag to the HTML `<head>` element
1131
- * @default defaults to `true` for element types allowed in the `<head>`, otherwise `false`
1179
+ * Specifies whether to inject the tag into the HTML `<head>` element.
1180
+ * - `true`: Inject into `<head>`
1181
+ * - `false`: Inject into `<body>`
1182
+ * @default Auto-detect: `true` for head-allowed elements, `false` otherwise
1132
1183
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head#see_also
1133
1184
  */
1134
1185
  head?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.4.5",
3
+ "version": "1.4.6",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -46,7 +46,7 @@
46
46
  "types.d.ts"
47
47
  ],
48
48
  "dependencies": {
49
- "@rspack/core": "1.4.5",
49
+ "@rspack/core": "1.4.6",
50
50
  "@rspack/lite-tapable": "~1.0.1",
51
51
  "@swc/helpers": "^0.5.17",
52
52
  "core-js": "~3.44.0",