@rsbuild/core 1.6.13 → 1.6.14

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
- 7653: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 7492: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const loader = __nccwpck_require__(5551);
5
+ const loader = __nccwpck_require__(3594);
6
6
  module.exports = loader.default;
7
7
  module.exports.defaultGetLocalIdent =
8
- __nccwpck_require__(218).defaultGetLocalIdent;
8
+ __nccwpck_require__(7355).defaultGetLocalIdent;
9
9
  },
10
- 5551: (__unused_webpack_module, exports, __nccwpck_require__) => {
10
+ 3594: (__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__(1259));
15
- var _plugins = __nccwpck_require__(6644);
16
- var _utils = __nccwpck_require__(218);
15
+ var _plugins = __nccwpck_require__(8585);
16
+ var _utils = __nccwpck_require__(7355);
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
- 6644: (__unused_webpack_module, exports, __nccwpck_require__) => {
239
+ 8585: (__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,22 @@
258
258
  },
259
259
  });
260
260
  var _postcssImportParser = _interopRequireDefault(
261
- __nccwpck_require__(3439),
261
+ __nccwpck_require__(6338),
262
262
  );
263
263
  var _postcssIcssParser = _interopRequireDefault(
264
- __nccwpck_require__(8018),
264
+ __nccwpck_require__(8331),
265
265
  );
266
- var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(5477));
266
+ var _postcssUrlParser = _interopRequireDefault(__nccwpck_require__(7870));
267
267
  function _interopRequireDefault(obj) {
268
268
  return obj && obj.__esModule ? obj : { default: obj };
269
269
  }
270
270
  },
271
- 8018: (__unused_webpack_module, exports, __nccwpck_require__) => {
271
+ 8331: (__unused_webpack_module, exports, __nccwpck_require__) => {
272
272
  "use strict";
273
273
  Object.defineProperty(exports, "__esModule", { value: true });
274
274
  exports["default"] = void 0;
275
275
  var _icssUtils = __nccwpck_require__(229);
276
- var _utils = __nccwpck_require__(218);
276
+ var _utils = __nccwpck_require__(7355);
277
277
  const plugin = (options = {}) => ({
278
278
  postcssPlugin: "postcss-icss-parser",
279
279
  async OnceExit(root) {
@@ -372,14 +372,14 @@
372
372
  plugin.postcss = true;
373
373
  var _default = (exports["default"] = plugin);
374
374
  },
375
- 3439: (__unused_webpack_module, exports, __nccwpck_require__) => {
375
+ 6338: (__unused_webpack_module, exports, __nccwpck_require__) => {
376
376
  "use strict";
377
377
  Object.defineProperty(exports, "__esModule", { value: true });
378
378
  exports["default"] = void 0;
379
379
  var _postcssValueParser = _interopRequireDefault(
380
380
  __nccwpck_require__(5245),
381
381
  );
382
- var _utils = __nccwpck_require__(218);
382
+ var _utils = __nccwpck_require__(7355);
383
383
  function _interopRequireDefault(obj) {
384
384
  return obj && obj.__esModule ? obj : { default: obj };
385
385
  }
@@ -684,14 +684,14 @@
684
684
  plugin.postcss = true;
685
685
  var _default = (exports["default"] = plugin);
686
686
  },
687
- 5477: (__unused_webpack_module, exports, __nccwpck_require__) => {
687
+ 7870: (__unused_webpack_module, exports, __nccwpck_require__) => {
688
688
  "use strict";
689
689
  Object.defineProperty(exports, "__esModule", { value: true });
690
690
  exports["default"] = void 0;
691
691
  var _postcssValueParser = _interopRequireDefault(
692
692
  __nccwpck_require__(5245),
693
693
  );
694
- var _utils = __nccwpck_require__(218);
694
+ var _utils = __nccwpck_require__(7355);
695
695
  function _interopRequireDefault(obj) {
696
696
  return obj && obj.__esModule ? obj : { default: obj };
697
697
  }
@@ -1034,7 +1034,7 @@
1034
1034
  plugin.postcss = true;
1035
1035
  var _default = (exports["default"] = plugin);
1036
1036
  },
1037
- 218: (__unused_webpack_module, exports, __nccwpck_require__) => {
1037
+ 7355: (__unused_webpack_module, exports, __nccwpck_require__) => {
1038
1038
  "use strict";
1039
1039
  Object.defineProperty(exports, "__esModule", { value: true });
1040
1040
  exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0;
@@ -8098,6 +8098,6 @@
8098
8098
  }
8099
8099
  if (typeof __nccwpck_require__ !== "undefined")
8100
8100
  __nccwpck_require__.ab = __dirname + "/";
8101
- var __webpack_exports__ = __nccwpck_require__(7653);
8101
+ var __webpack_exports__ = __nccwpck_require__(7492);
8102
8102
  module.exports = __webpack_exports__;
8103
8103
  })();
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 559: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 178: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const { HtmlWebpackChildCompiler } = __nccwpck_require__(404);
5
+ const { HtmlWebpackChildCompiler } = __nccwpck_require__(355);
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
- 404: (module) => {
314
+ 355: (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
- 940: (module) => {
483
+ 361: (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
- 507: (module) => {
502
+ 256: (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
- 786: (module, __unused_webpack_exports, __nccwpck_require__) => {
523
+ 759: (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
- 959: (module) => {
549
+ 422: (module) => {
550
550
  const voidTags = [
551
551
  "area",
552
552
  "base",
@@ -614,19 +614,19 @@
614
614
  htmlTagObjectToString,
615
615
  };
616
616
  },
617
- 894: (module, __unused_webpack_exports, __nccwpck_require__) => {
617
+ 839: (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__(559);
623
+ const { CachedChildCompilation } = __nccwpck_require__(178);
624
624
  const { createHtmlTagObject, htmlTagObjectToString, HtmlTagArray } =
625
- __nccwpck_require__(959);
626
- const prettyError = __nccwpck_require__(507);
627
- const chunkSorter = __nccwpck_require__(940);
625
+ __nccwpck_require__(422);
626
+ const prettyError = __nccwpck_require__(256);
627
+ const chunkSorter = __nccwpck_require__(361);
628
628
  const getHtmlRspackPluginHooks =
629
- __nccwpck_require__(786).getHtmlRspackPluginHooks;
629
+ __nccwpck_require__(759).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__(894);
1600
+ var __webpack_exports__ = __nccwpck_require__(839);
1601
1601
  module.exports = __webpack_exports__;
1602
1602
  })();
@@ -1,15 +1,15 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 357: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
- module.exports = __nccwpck_require__(127)["default"];
4
+ 149: (module, __unused_webpack_exports, __nccwpck_require__) => {
5
+ module.exports = __nccwpck_require__(495)["default"];
6
6
  },
7
- 127: (__unused_webpack_module, exports, __nccwpck_require__) => {
7
+ 495: (__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 _nodePath = _interopRequireDefault(__nccwpck_require__(760));
12
- var _utils = __nccwpck_require__(802);
12
+ var _utils = __nccwpck_require__(818);
13
13
  function _interopRequireDefault(e) {
14
14
  return e && e.__esModule ? e : { default: e };
15
15
  }
@@ -179,7 +179,7 @@
179
179
  callback(null, result.css, map, { ast });
180
180
  }
181
181
  },
182
- 802: (module, exports, __nccwpck_require__) => {
182
+ 818: (module, exports, __nccwpck_require__) => {
183
183
  module = __nccwpck_require__.nmd(module);
184
184
  Object.defineProperty(exports, "__esModule", { value: true });
185
185
  exports.exec = exec;
@@ -715,6 +715,6 @@
715
715
  })();
716
716
  if (typeof __nccwpck_require__ !== "undefined")
717
717
  __nccwpck_require__.ab = __dirname + "/";
718
- var __webpack_exports__ = __nccwpck_require__(357);
718
+ var __webpack_exports__ = __nccwpck_require__(149);
719
719
  module.exports = __webpack_exports__;
720
720
  })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  "use strict";
3
3
  var __webpack_modules__ = {
4
- 38: (__unused_webpack_module, exports, __nccwpck_require__) => {
4
+ 965: (__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
- 935: (__unused_webpack_module, exports, __nccwpck_require__) => {
123
+ 552: (__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 node_fs_1 = __nccwpck_require__(24);
131
131
  const node_path_1 = __nccwpck_require__(760);
132
132
  const lite_tapable_1 = __nccwpck_require__(408);
133
- const helpers_1 = __nccwpck_require__(38);
133
+ const helpers_1 = __nccwpck_require__(965);
134
134
  const compilerHookMap = new WeakMap();
135
135
  const getCompilerHooks = (compiler) => {
136
136
  let hooks = compilerHookMap.get(compiler);
@@ -327,7 +327,7 @@
327
327
  exports.getCompilerHooks =
328
328
  void 0;
329
329
  const node_path_1 = __nccwpck_require__(760);
330
- const hooks_1 = __nccwpck_require__(935);
330
+ const hooks_1 = __nccwpck_require__(552);
331
331
  Object.defineProperty(exports, "getCompilerHooks", {
332
332
  enumerable: true,
333
333
  get: function () {
package/dist/131.js CHANGED
@@ -3420,7 +3420,7 @@ function createPublicContext(context) {
3420
3420
  async function createContext(options, userConfig) {
3421
3421
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3422
3422
  return {
3423
- version: "1.6.13",
3423
+ version: "1.6.14",
3424
3424
  rootPath,
3425
3425
  distPath: '',
3426
3426
  cachePath,
@@ -4490,7 +4490,7 @@ async function printFileSizes(options, stats, rootPath, distPath, environmentNam
4490
4490
  let colorFn = getAssetColor(totalGzipSize / assets.length);
4491
4491
  if (log += ' '.repeat(maxSizeLength - totalSizeLabelLength), log += ` ${colorFn(calcFileSize(totalGzipSize))}`, showDiff) {
4492
4492
  let totalGzipSizeDiff = totalGzipSize - (previousSizes[environmentName]?.totalGzipSize ?? 0);
4493
- 0 !== totalGzipSizeDiff && (log += ` ${formatDiff(totalGzipSizeDiff).label}`);
4493
+ isSignificantDiff(totalGzipSizeDiff) && (log += ` ${formatDiff(totalGzipSizeDiff).label}`);
4494
4494
  }
4495
4495
  }
4496
4496
  logs.push(log);
@@ -4899,6 +4899,7 @@ let getPort = async ({ host, port, strictPort, tryLimits = 20 })=>{
4899
4899
  if ('EADDRINUSE' !== e.code) throw e;
4900
4900
  port++, attempts++;
4901
4901
  }
4902
+ if (!found) throw Error(`${color.dim('[rsbuild:server]')} Failed to find an available port after ${tryLimits + 1} attempts, starting from ${color.yellow(original)}.`);
4902
4903
  if (port !== original && strictPort) throw Error(`${color.dim('[rsbuild:server]')} Port ${color.yellow(original)} is occupied, please choose another one.`);
4903
4904
  return port;
4904
4905
  }, getServerConfig = async ({ config })=>{
@@ -8477,8 +8478,12 @@ try {
8477
8478
  stage: 'summarize'
8478
8479
  }, ({ compiler, compilation })=>{
8479
8480
  if (0 === inlinedAssets.size) return;
8480
- let { devtool } = compiler.options;
8481
- for (let name of inlinedAssets)'hidden-source-map' === devtool || !1 === devtool ? compilation.deleteAsset(name) : delete compilation.assets[name];
8481
+ let { devtool } = compiler.options, hasSourceMap = 'hidden-source-map' !== devtool && !1 !== devtool;
8482
+ for (let name of inlinedAssets)hasSourceMap && compilation.updateAsset(name, compilation.assets[name], {
8483
+ related: {
8484
+ sourceMap: null
8485
+ }
8486
+ }), compilation.deleteAsset(name);
8482
8487
  inlinedAssets.clear();
8483
8488
  }), api.modifyHTMLTags(({ headTags, bodyTags }, { compiler, compilation, environment })=>{
8484
8489
  let { htmlPaths, config } = environment;
@@ -9161,7 +9166,7 @@ let applyServerOptions = (command)=>{
9161
9166
  };
9162
9167
  function setupCommands() {
9163
9168
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9164
- cli.version("1.6.13"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9169
+ cli.version("1.6.14"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9165
9170
  default: 'auto'
9166
9171
  }).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
9167
9172
  type: [
@@ -9230,7 +9235,7 @@ function initNodeEnv() {
9230
9235
  }
9231
9236
  function showGreeting() {
9232
9237
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9233
- logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.13\n`);
9238
+ logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.14\n`);
9234
9239
  }
9235
9240
  function setupLogLevel() {
9236
9241
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9251,7 +9256,7 @@ function runCLI() {
9251
9256
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
9252
9257
  }
9253
9258
  }
9254
- let src_version = "1.6.13";
9259
+ let src_version = "1.6.14";
9255
9260
  import * as __rspack_external_node_module_ab9f2194 from "node:module";
9256
9261
  import { createRequire as __rspack_createRequire } from "node:module";
9257
9262
  import * as __rspack_external_node_url_e96de089 from "node:url";
package/dist/index.cjs CHANGED
@@ -3555,7 +3555,7 @@ ${section.body}` : section.body).join("\n\n"));
3555
3555
  async function createContext(options, userConfig) {
3556
3556
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3557
3557
  return {
3558
- version: "1.6.13",
3558
+ version: "1.6.14",
3559
3559
  rootPath,
3560
3560
  distPath: '',
3561
3561
  cachePath,
@@ -4618,7 +4618,7 @@ ${section.body}` : section.body).join("\n\n"));
4618
4618
  let colorFn = getAssetColor(totalGzipSize / assets.length);
4619
4619
  if (log += ' '.repeat(maxSizeLength - totalSizeLabelLength), log += ` ${colorFn(calcFileSize(totalGzipSize))}`, showDiff) {
4620
4620
  let totalGzipSizeDiff = totalGzipSize - (previousSizes[environmentName]?.totalGzipSize ?? 0);
4621
- 0 !== totalGzipSizeDiff && (log += ` ${formatDiff(totalGzipSizeDiff).label}`);
4621
+ isSignificantDiff(totalGzipSizeDiff) && (log += ` ${formatDiff(totalGzipSizeDiff).label}`);
4622
4622
  }
4623
4623
  }
4624
4624
  logs.push(log);
@@ -5027,6 +5027,7 @@ ${section.body}` : section.body).join("\n\n"));
5027
5027
  if ('EADDRINUSE' !== e.code) throw e;
5028
5028
  port++, attempts++;
5029
5029
  }
5030
+ if (!found) throw Error(`${color.dim('[rsbuild:server]')} Failed to find an available port after ${tryLimits + 1} attempts, starting from ${color.yellow(original)}.`);
5030
5031
  if (port !== original && strictPort) throw Error(`${color.dim('[rsbuild:server]')} Port ${color.yellow(original)} is occupied, please choose another one.`);
5031
5032
  return port;
5032
5033
  }, getServerConfig = async ({ config })=>{
@@ -8612,8 +8613,12 @@ try {
8612
8613
  stage: 'summarize'
8613
8614
  }, ({ compiler, compilation })=>{
8614
8615
  if (0 === inlinedAssets.size) return;
8615
- let { devtool } = compiler.options;
8616
- for (let name of inlinedAssets)'hidden-source-map' === devtool || !1 === devtool ? compilation.deleteAsset(name) : delete compilation.assets[name];
8616
+ let { devtool } = compiler.options, hasSourceMap = 'hidden-source-map' !== devtool && !1 !== devtool;
8617
+ for (let name of inlinedAssets)hasSourceMap && compilation.updateAsset(name, compilation.assets[name], {
8618
+ related: {
8619
+ sourceMap: null
8620
+ }
8621
+ }), compilation.deleteAsset(name);
8617
8622
  inlinedAssets.clear();
8618
8623
  }), api.modifyHTMLTags(({ headTags, bodyTags }, { compiler, compilation, environment })=>{
8619
8624
  let { htmlPaths, config } = environment;
@@ -9296,7 +9301,7 @@ try {
9296
9301
  };
9297
9302
  function setupCommands() {
9298
9303
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9299
- cli.version("1.6.13"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9304
+ cli.version("1.6.14"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
9300
9305
  default: 'auto'
9301
9306
  }).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
9302
9307
  type: [
@@ -9365,7 +9370,7 @@ try {
9365
9370
  }
9366
9371
  function showGreeting() {
9367
9372
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9368
- logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.13\n`);
9373
+ logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.6.14\n`);
9369
9374
  }
9370
9375
  function setupLogLevel() {
9371
9376
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9386,7 +9391,7 @@ try {
9386
9391
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
9387
9392
  }
9388
9393
  }
9389
- let src_version = "1.6.13";
9394
+ let src_version = "1.6.14";
9390
9395
  })(), 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 === [
9391
9396
  "PLUGIN_CSS_NAME",
9392
9397
  "PLUGIN_SWC_NAME",
@@ -543,7 +543,10 @@ export type PrintFileSizeOptions = {
543
543
  */
544
544
  exclude?: (asset: PrintFileSizeAsset) => boolean;
545
545
  /**
546
- * Whether to show file size difference compared to the previous build.
546
+ * Controls whether file size differences are displayed relative to the previous build.
547
+ * When this option is enabled, Rsbuild records a snapshot of all output file sizes after
548
+ * each build. On subsequent builds, Rsbuild compares the current sizes against the previous
549
+ * snapshot and shows the change inline in parentheses.
547
550
  * @default false
548
551
  */
549
552
  diff?: boolean;
@@ -973,9 +976,7 @@ export type ManifestData = {
973
976
  /**
974
977
  * Maps each entry name to its associated output files.
975
978
  */
976
- entries: {
977
- [entryName: string]: ManifestByEntry;
978
- };
979
+ entries: Record<string, ManifestByEntry>;
979
980
  /**
980
981
  * Subresource Integrity (SRI) hashes for emitted assets.
981
982
  * The key is the asset file path, and the value is its integrity hash.
@@ -1211,19 +1212,33 @@ export type ScriptInject = boolean | 'body' | 'head';
1211
1212
  export type ScriptLoading = 'defer' | 'module' | 'blocking';
1212
1213
  export type OutputStructure = 'flat' | 'nested';
1213
1214
  /**
1214
- * custom properties
1215
- * e.g. { name: 'viewport' content: 'width=500, initial-scale=1' }
1215
+ * Custom meta tag attributes.
1216
+ * Key is the attribute name.
1217
+ * Value is the attribute value, as a string or boolean.
1218
+ *
1219
+ * @example
1220
+ * {
1221
+ * name: 'viewport',
1222
+ * content: 'width=500, initial-scale=1',
1223
+ * }
1216
1224
  */
1217
- export type MetaAttrs = {
1218
- [attrName: string]: string | boolean;
1219
- };
1220
- export type MetaOptions = {
1221
- /**
1222
- * name content pair
1223
- * e.g. { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' }`
1224
- */
1225
- [name: string]: string | false | MetaAttrs;
1226
- };
1225
+ export type MetaAttrs = Record<string, string | boolean>;
1226
+ /**
1227
+ * Meta options in name-content form.
1228
+ * Key is the meta name, such as `viewport`, `description`, or `robots`.
1229
+ * The value can be:
1230
+ * - `string`: the content of the meta tag
1231
+ * - `false`: explicitly disables the meta tag
1232
+ * - `MetaAttrs`: a set of custom meta attributes
1233
+ *
1234
+ * @example
1235
+ * {
1236
+ * viewport: 'width=device-width, initial-scale=1',
1237
+ * description: 'My awesome website',
1238
+ * robots: false,
1239
+ * }
1240
+ */
1241
+ export type MetaOptions = Record<string, string | false | MetaAttrs>;
1227
1242
  export type HtmlBasicTag = {
1228
1243
  /**
1229
1244
  * The HTML tag name to be generated. Should be a valid HTML element name.
@@ -1478,29 +1493,27 @@ export type ProgressBarConfig = {
1478
1493
  id?: string;
1479
1494
  };
1480
1495
  export type RequestHandler = Connect.NextHandleFunction;
1481
- export type EnvironmentAPI = {
1482
- [name: string]: {
1483
- /**
1484
- * Get stats info about current environment.
1485
- */
1486
- getStats: () => Promise<Rspack.Stats>;
1487
- /**
1488
- * Load and execute stats bundle in Server.
1489
- *
1490
- * @param entryName - relate to rsbuild source.entry
1491
- * @returns the return of entry module.
1492
- */
1493
- loadBundle: <T = unknown>(entryName: string) => Promise<T>;
1494
- /**
1495
- * Get the compiled HTML template.
1496
- */
1497
- getTransformedHtml: (entryName: string) => Promise<string>;
1498
- /**
1499
- * Provides some context information about the current environment
1500
- */
1501
- context: EnvironmentContext;
1502
- };
1503
- };
1496
+ export type EnvironmentAPI = Record<string, {
1497
+ /**
1498
+ * Get stats info about current environment.
1499
+ */
1500
+ getStats: () => Promise<Rspack.Stats>;
1501
+ /**
1502
+ * Load and execute stats bundle in Server.
1503
+ *
1504
+ * @param entryName - relate to rsbuild source.entry
1505
+ * @returns the return of entry module.
1506
+ */
1507
+ loadBundle: <T = unknown>(entryName: string) => Promise<T>;
1508
+ /**
1509
+ * Get the compiled HTML template.
1510
+ */
1511
+ getTransformedHtml: (entryName: string) => Promise<string>;
1512
+ /**
1513
+ * Provides some context information about the current environment
1514
+ */
1515
+ context: EnvironmentContext;
1516
+ }>;
1504
1517
  export type SetupMiddlewaresContext = Pick<RsbuildDevServer, 'sockWrite' | 'environments'>;
1505
1518
  export type SetupMiddlewaresFn = (middlewares: {
1506
1519
  unshift: (...handlers: RequestHandler[]) => void;
@@ -1809,11 +1822,11 @@ export interface RsbuildConfig extends EnvironmentConfig {
1809
1822
  */
1810
1823
  server?: ServerConfig;
1811
1824
  /**
1812
- * Configure rsbuild config by environment.
1825
+ * Configure Rsbuild config by environment.
1826
+ * The key represents the environment name.
1827
+ * The value is the Rsbuild config for the specified environment.
1813
1828
  */
1814
- environments?: {
1815
- [name: string]: EnvironmentConfig;
1816
- };
1829
+ environments?: Record<string, EnvironmentConfig>;
1817
1830
  /**
1818
1831
  * Used to switch the bundler type.
1819
1832
  */
@@ -1849,7 +1862,5 @@ export type NormalizedEnvironmentConfig = TwoLevelReadonly<Omit<MergedEnvironmen
1849
1862
  }>;
1850
1863
  export type NormalizedConfig = NormalizedEnvironmentConfig & {
1851
1864
  provider?: unknown;
1852
- environments: {
1853
- [name: string]: NormalizedEnvironmentConfig;
1854
- };
1865
+ environments: Record<string, NormalizedEnvironmentConfig>;
1855
1866
  };
@@ -1,8 +1,8 @@
1
- export * from './config';
2
- export * from './context';
3
- export * from './hooks';
4
- export * from './plugin';
5
- export * from './rsbuild';
6
- export * from './rspack';
7
- export * from './thirdParty';
8
- export * from './utils';
1
+ export type * from './config';
2
+ export type * from './context';
3
+ export type * from './hooks';
4
+ export type * from './plugin';
5
+ export type * from './rsbuild';
6
+ export type * from './rspack';
7
+ export type * from './thirdParty';
8
+ export type * from './utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.6.13",
3
+ "version": "1.6.14",
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.6.6",
49
+ "@rspack/core": "1.6.7",
50
50
  "@rspack/lite-tapable": "~1.1.0",
51
51
  "@swc/helpers": "^0.5.17",
52
52
  "core-js": "~3.47.0",