@rsbuild/core 1.2.5 → 1.2.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.
package/dist/index.cjs CHANGED
@@ -1708,7 +1708,7 @@ var __webpack_exports__ = {};
1708
1708
  async function createContext(options, userConfig, bundlerType) {
1709
1709
  let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(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;
1710
1710
  return {
1711
- version: "1.2.5",
1711
+ version: "1.2.6",
1712
1712
  rootPath,
1713
1713
  distPath: '',
1714
1714
  cachePath,
@@ -2368,12 +2368,12 @@ var __webpack_exports__ = {};
2368
2368
  let excludeAsset = (asset)=>/\.(?:map|LICENSE\.txt)$/.test(asset.name), getAssetColor = (size)=>size > 300000 ? index_js_default().red : size > 100000 ? index_js_default().yellow : index_js_default().green, calcFileSize = (len)=>{
2369
2369
  let val = len / 1000;
2370
2370
  return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
2371
- }, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? index_js_default().cyan(assetName) : CSS_REGEX.test(assetName) ? index_js_default().yellow(assetName) : HTML_REGEX.test(assetName) ? index_js_default().green(assetName) : index_js_default().magenta(assetName);
2371
+ }, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? index_js_default().cyan(assetName) : CSS_REGEX.test(assetName) ? index_js_default().yellow(assetName) : HTML_REGEX.test(assetName) ? index_js_default().green(assetName) : index_js_default().magenta(assetName), COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest)$/i, isCompressible = (assetName)=>COMPRESSIBLE_REGEX.test(assetName);
2372
2372
  async function printFileSizes(options, stats, rootPath, environmentName) {
2373
2373
  let logs = [];
2374
2374
  if (!1 === options.detail && !1 === options.total) return logs;
2375
2375
  let formatAsset = async (asset, distPath, distFolder)=>{
2376
- let fileName = asset.name.split('?')[0], contents = await external_node_fs_default().promises.readFile(external_node_path_default().join(distPath, fileName)), size = contents.length, gzippedSize = options.compressed ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
2376
+ let fileName = asset.name.split('?')[0], contents = await external_node_fs_default().promises.readFile(external_node_path_default().join(distPath, fileName)), size = contents.length, gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
2377
2377
  return {
2378
2378
  size,
2379
2379
  folder: external_node_path_default().join(distFolder, external_node_path_default().dirname(fileName)),
@@ -6640,12 +6640,12 @@ ${section.body}` : section.body).join("\n\n"));
6640
6640
  }
6641
6641
  }(), process.title = 'rsbuild-node';
6642
6642
  let { npm_execpath } = process.env;
6643
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.5\n`);
6643
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), rslog_index_js_namespaceObject.logger.greet(` Rsbuild v1.2.6\n`);
6644
6644
  }();
6645
6645
  try {
6646
6646
  !function() {
6647
6647
  let cli = cac_dist('rsbuild');
6648
- cli.help(), cli.version("1.2.5"), applyCommonOptions(cli);
6648
+ cli.help(), cli.version("1.2.6"), applyCommonOptions(cli);
6649
6649
  let devCommand = cli.command('dev', 'starting the dev server'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
6650
6650
  applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
6651
6651
  try {
@@ -6696,7 +6696,7 @@ ${section.body}` : section.body).join("\n\n"));
6696
6696
  rslog_index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), rslog_index_js_namespaceObject.logger.error(err);
6697
6697
  }
6698
6698
  }
6699
- let src_rslib_entry_version = "1.2.5";
6699
+ let src_rslib_entry_version = "1.2.6";
6700
6700
  })();
6701
6701
  var __webpack_export_target__ = exports;
6702
6702
  for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
package/dist/index.js CHANGED
@@ -1617,7 +1617,7 @@ async function updateEnvironmentContext(context, configs) {
1617
1617
  async function createContext(options, userConfig, bundlerType) {
1618
1618
  let { cwd } = options, rootPath = userConfig.root ? getAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
1619
1619
  return {
1620
- version: "1.2.5",
1620
+ version: "1.2.6",
1621
1621
  rootPath,
1622
1622
  distPath: '',
1623
1623
  cachePath,
@@ -2274,12 +2274,12 @@ async function gzipSize(input) {
2274
2274
  let excludeAsset = (asset)=>/\.(?:map|LICENSE\.txt)$/.test(asset.name), getAssetColor = (size)=>size > 300000 ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.red : size > 100000 ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.yellow : __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.green, calcFileSize = (len)=>{
2275
2275
  let val = len / 1000;
2276
2276
  return `${val.toFixed(val < 1 ? 2 : 1)} kB`;
2277
- }, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.cyan(assetName) : CSS_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.yellow(assetName) : HTML_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.green(assetName) : __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.magenta(assetName);
2277
+ }, coloringAssetName = (assetName)=>JS_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.cyan(assetName) : CSS_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.yellow(assetName) : HTML_REGEX.test(assetName) ? __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.green(assetName) : __WEBPACK_EXTERNAL_MODULE__compiled_picocolors_index_js_ea7a20e9__.default.magenta(assetName), COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest)$/i, isCompressible = (assetName)=>COMPRESSIBLE_REGEX.test(assetName);
2278
2278
  async function printFileSizes(options, stats, rootPath, environmentName) {
2279
2279
  let logs = [];
2280
2280
  if (!1 === options.detail && !1 === options.total) return logs;
2281
2281
  let formatAsset = async (asset, distPath, distFolder)=>{
2282
- let fileName = asset.name.split('?')[0], contents = await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.readFile(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(distPath, fileName)), size = contents.length, gzippedSize = options.compressed ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
2282
+ let fileName = asset.name.split('?')[0], contents = await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.default.promises.readFile(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(distPath, fileName)), size = contents.length, gzippedSize = options.compressed && isCompressible(fileName) ? await gzipSize(contents) : null, gzipSizeLabel = gzippedSize ? getAssetColor(gzippedSize)(calcFileSize(gzippedSize)) : null;
2283
2283
  return {
2284
2284
  size,
2285
2285
  folder: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.join(distFolder, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__.default.dirname(fileName)),
@@ -6528,12 +6528,12 @@ async function runCLI() {
6528
6528
  }
6529
6529
  }(), process.title = 'rsbuild-node';
6530
6530
  let { npm_execpath } = process.env;
6531
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.5\n`);
6531
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && console.log(), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.greet(` Rsbuild v1.2.6\n`);
6532
6532
  }();
6533
6533
  try {
6534
6534
  !function() {
6535
6535
  let cli = cac_dist('rsbuild');
6536
- cli.help(), cli.version("1.2.5"), applyCommonOptions(cli);
6536
+ cli.help(), cli.version("1.2.6"), applyCommonOptions(cli);
6537
6537
  let devCommand = cli.command('dev', 'starting the dev server'), buildCommand = cli.command('build', 'build the app for production'), previewCommand = cli.command('preview', 'preview the production build locally'), inspectCommand = cli.command('inspect', 'inspect the Rspack and Rsbuild configs');
6538
6538
  applyServerOptions(devCommand), applyServerOptions(previewCommand), devCommand.action(async (options)=>{
6539
6539
  try {
@@ -6584,6 +6584,6 @@ async function runCLI() {
6584
6584
  __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error('Failed to start Rsbuild CLI.'), __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger.error(err);
6585
6585
  }
6586
6586
  }
6587
- let src_version = "1.2.5";
6587
+ let src_version = "1.2.6";
6588
6588
  var __webpack_exports__logger = __WEBPACK_EXTERNAL_MODULE__compiled_rslog_index_js_c302f6e3__.logger, __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
6589
6589
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defineConfig, ensureAssetPrefix, config_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, runCLI, src_version as version, __webpack_exports__logger as logger, __webpack_exports__rspack as rspack };
@@ -325,8 +325,16 @@ export interface SecurityConfig {
325
325
  export type NormalizedSecurityConfig = Required<SecurityConfig>;
326
326
  export type ConsoleType = 'log' | 'info' | 'warn' | 'error' | 'table' | 'group';
327
327
  export type BuildCacheOptions = {
328
- /** Base directory for the filesystem cache. */
328
+ /**
329
+ * The output directory of the cache files.
330
+ * @default 'node_modules/.cache'
331
+ */
329
332
  cacheDirectory?: string;
333
+ /**
334
+ * Add additional cache digests, the previous build cache will be invalidated
335
+ * when any value in the array changes.
336
+ * @default undefined
337
+ */
330
338
  cacheDigest?: Array<string | undefined>;
331
339
  };
332
340
  export type PrintFileSizeAsset = {
@@ -400,7 +408,8 @@ export interface PerformanceConfig {
400
408
  */
401
409
  removeMomentLocale?: boolean;
402
410
  /**
403
- * Controls the Rsbuild's caching behavior during the build process.
411
+ * To enable or configure persistent build cache.
412
+ * @experimental This feature is experimental and may be changed in the future.
404
413
  */
405
414
  buildCache?: BuildCacheOptions | boolean;
406
415
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.dev",
6
6
  "bugs": {