@rsbuild/core 1.7.2 → 1.7.4

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/131.js CHANGED
@@ -3566,7 +3566,7 @@ function createPublicContext(context) {
3566
3566
  async function createContext(options, userConfig) {
3567
3567
  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';
3568
3568
  return {
3569
- version: "1.7.2",
3569
+ version: "1.7.4",
3570
3570
  rootPath,
3571
3571
  distPath: '',
3572
3572
  cachePath,
@@ -5014,9 +5014,9 @@ let getInlineTests = (config)=>{
5014
5014
  };
5015
5015
  function getURLMessages(urls, routes) {
5016
5016
  if (routes.length <= 1) {
5017
- let pathname = routes.length ? routes[0].pathname : '';
5017
+ let pathname = routes.length ? routes[0].pathname : '', padWidth = Math.max(Math.max(...urls.map((u)=>u.label.trimEnd().length)) + 2, 10);
5018
5018
  return urls.map(({ label, url })=>{
5019
- let normalizedPathname = normalizeUrl(`${url}${pathname}`), prefix = `➜ ${color.dim(label.padEnd(10))}`;
5019
+ let normalizedPathname = normalizeUrl(`${url}${pathname}`), prefix = `➜ ${color.dim(label.trimEnd().padEnd(padWidth))}`;
5020
5020
  return ` ${prefix}${color.cyan(normalizedPathname)}\n`;
5021
5021
  }).join('');
5022
5022
  }
@@ -9211,7 +9211,7 @@ let applyServerOptions = (command)=>{
9211
9211
  };
9212
9212
  function setupCommands() {
9213
9213
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9214
- cli.version("1.7.2"), 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)', {
9214
+ cli.version("1.7.4"), 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)', {
9215
9215
  default: 'auto'
9216
9216
  }).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', {
9217
9217
  type: [
@@ -9280,7 +9280,7 @@ function initNodeEnv() {
9280
9280
  }
9281
9281
  function showGreeting() {
9282
9282
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9283
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.2\n`);
9283
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.4\n`);
9284
9284
  }
9285
9285
  function setupLogLevel() {
9286
9286
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9301,5 +9301,5 @@ function runCLI() {
9301
9301
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err);
9302
9302
  }
9303
9303
  }
9304
- let src_version = "1.7.2";
9304
+ let src_version = "1.7.4";
9305
9305
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, node_fs, node_os, node_process, rspack_rspack as rspack, runCLI, src_logger as logger, src_version as version };
@@ -13,27 +13,8 @@ function _define_property(obj, key, value) {
13
13
  const { HTMLElement: HTMLElement = class {
14
14
  }, customElements: customElements } = "u" > typeof window ? window : globalThis;
15
15
  class ErrorOverlay extends HTMLElement {
16
- constructor(html){
16
+ init(html) {
17
17
  var _root_querySelector, _root_querySelector1;
18
- super(), _define_property(this, "close", (immediate = false)=>{
19
- const remove = ()=>{
20
- var _this_parentNode;
21
- return null == (_this_parentNode = this.parentNode) ? void 0 : _this_parentNode.removeChild(this);
22
- };
23
- if (this.animate && true !== immediate) this.animate([
24
- {
25
- opacity: 1
26
- },
27
- {
28
- opacity: 0
29
- }
30
- ], {
31
- duration: 300,
32
- easing: 'ease-out'
33
- }).addEventListener('finish', remove);
34
- else remove();
35
- });
36
- if (!this.attachShadow) return void logger.warn('[rsbuild] Error overlay disabled: Shadow DOM not supported in this browser.');
37
18
  const root = this.attachShadow({
38
19
  mode: 'open'
39
20
  });
@@ -53,6 +34,26 @@ class ErrorOverlay extends HTMLElement {
53
34
  };
54
35
  document.addEventListener('keydown', onEscKeydown);
55
36
  }
37
+ constructor(...args){
38
+ super(...args), _define_property(this, "close", (immediate = false)=>{
39
+ const remove = ()=>{
40
+ var _this_parentNode;
41
+ return null == (_this_parentNode = this.parentNode) ? void 0 : _this_parentNode.removeChild(this);
42
+ };
43
+ if (this.animate && true !== immediate) this.animate([
44
+ {
45
+ opacity: 1
46
+ },
47
+ {
48
+ opacity: 0
49
+ }
50
+ ], {
51
+ duration: 300,
52
+ easing: 'ease-out'
53
+ }).addEventListener('finish', remove);
54
+ else remove();
55
+ });
56
+ }
56
57
  }
57
58
  const overlayId = 'rsbuild-error-overlay';
58
59
  if (customElements && !customElements.get(overlayId)) customElements.define(overlayId, ErrorOverlay);
@@ -191,8 +192,18 @@ function getOverlayHtml(title, content) {
191
192
  `;
192
193
  }
193
194
  function createOverlay(title, content) {
195
+ const warn = ()=>{
196
+ logger.warn('[rsbuild] Error overlay disabled: Custom Elements not supported in this environment.');
197
+ };
198
+ if (!customElements || !customElements.get(overlayId)) return void warn();
194
199
  clearOverlay();
195
- document.body.appendChild(new ErrorOverlay(getOverlayHtml(title, content)));
200
+ try {
201
+ const overlay = document.createElement(overlayId);
202
+ overlay.init(getOverlayHtml(title, content));
203
+ document.body.appendChild(overlay);
204
+ } catch (_err) {
205
+ warn();
206
+ }
196
207
  }
197
208
  function clearOverlay() {
198
209
  document.querySelectorAll(overlayId).forEach((n)=>{
package/dist/index.cjs CHANGED
@@ -3700,7 +3700,7 @@ ${section.body}` : section.body).join("\n\n"));
3700
3700
  async function createContext(options, userConfig) {
3701
3701
  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';
3702
3702
  return {
3703
- version: "1.7.2",
3703
+ version: "1.7.4",
3704
3704
  rootPath,
3705
3705
  distPath: '',
3706
3706
  cachePath,
@@ -5138,9 +5138,9 @@ ${section.body}` : section.body).join("\n\n"));
5138
5138
  };
5139
5139
  function getURLMessages(urls, routes) {
5140
5140
  if (routes.length <= 1) {
5141
- let pathname = routes.length ? routes[0].pathname : '';
5141
+ let pathname = routes.length ? routes[0].pathname : '', padWidth = Math.max(Math.max(...urls.map((u)=>u.label.trimEnd().length)) + 2, 10);
5142
5142
  return urls.map(({ label, url })=>{
5143
- let normalizedPathname = normalizeUrl(`${url}${pathname}`), prefix = `➜ ${color.dim(label.padEnd(10))}`;
5143
+ let normalizedPathname = normalizeUrl(`${url}${pathname}`), prefix = `➜ ${color.dim(label.trimEnd().padEnd(padWidth))}`;
5144
5144
  return ` ${prefix}${color.cyan(normalizedPathname)}\n`;
5145
5145
  }).join('');
5146
5146
  }
@@ -9345,7 +9345,7 @@ try {
9345
9345
  };
9346
9346
  function setupCommands() {
9347
9347
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9348
- cli.version("1.7.2"), 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)', {
9348
+ cli.version("1.7.4"), 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)', {
9349
9349
  default: 'auto'
9350
9350
  }).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', {
9351
9351
  type: [
@@ -9414,7 +9414,7 @@ try {
9414
9414
  }
9415
9415
  function showGreeting() {
9416
9416
  let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
9417
- src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.2\n`);
9417
+ src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v1.7.4\n`);
9418
9418
  }
9419
9419
  function setupLogLevel() {
9420
9420
  let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -9435,7 +9435,7 @@ try {
9435
9435
  src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err);
9436
9436
  }
9437
9437
  }
9438
- let src_version = "1.7.2";
9438
+ let src_version = "1.7.4";
9439
9439
  })(), 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 === [
9440
9440
  "PLUGIN_CSS_NAME",
9441
9441
  "PLUGIN_SWC_NAME",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
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.7.1",
49
+ "@rspack/core": "~1.7.10",
50
50
  "@rspack/lite-tapable": "~1.1.0",
51
51
  "@swc/helpers": "^0.5.18",
52
52
  "core-js": "~3.47.0",
@@ -94,7 +94,7 @@
94
94
  "tinyglobby": "0.2.14",
95
95
  "typescript": "^5.9.3",
96
96
  "webpack": "^5.104.1",
97
- "webpack-bundle-analyzer": "^4.10.2",
97
+ "webpack-bundle-analyzer": "^5.3.0",
98
98
  "webpack-merge": "6.0.1",
99
99
  "ws": "^8.18.3"
100
100
  },