@rsbuild/core 1.6.12 → 1.6.13

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,10 +1,11 @@
1
- import type { NormalizedClientConfig } from '../types';
1
+ import type { LogLevel, NormalizedClientConfig } from '../types';
2
2
  export declare const registerOverlay: (createFn: (html: string) => void, clearFn: () => void) => void;
3
- export declare function init({ token, config, serverHost, serverPort, liveReload, browserLogs, }: {
3
+ export declare function init({ token, config, serverHost, serverPort, liveReload, browserLogs, logLevel, }: {
4
4
  token: string;
5
5
  config: NormalizedClientConfig;
6
6
  serverHost: string;
7
7
  serverPort: number;
8
8
  liveReload: boolean;
9
9
  browserLogs: boolean;
10
+ logLevel: LogLevel;
10
11
  }): void;
@@ -0,0 +1,13 @@
1
+ import type { LogLevel } from '../types';
2
+ export declare const LOG_LEVEL: {
3
+ readonly silent: -1;
4
+ readonly error: 0;
5
+ readonly warn: 1;
6
+ readonly info: 2;
7
+ };
8
+ export declare const logger: {
9
+ level: LogLevel;
10
+ info(...messages: unknown[]): void;
11
+ warn(...messages: unknown[]): void;
12
+ error(...messages: unknown[]): void;
13
+ };
@@ -1,2 +1,2 @@
1
1
  import type { StatsError } from '@rspack/core';
2
- export declare function formatStatsError(stats: StatsError): string;
2
+ export declare function formatStatsError(stats: StatsError, root: string): string;
@@ -19,7 +19,7 @@ export type RsbuildAsset = {
19
19
  };
20
20
  export declare const getAssetsFromStats: (stats: Rspack.Stats) => RsbuildAsset[];
21
21
  export declare function getRsbuildStats(statsInstance: Rspack.Stats | Rspack.MultiStats, compiler: Rspack.Compiler | Rspack.MultiCompiler, action?: ActionType): RsbuildStats;
22
- export declare function formatStats(stats: RsbuildStats, hasErrors: boolean): {
22
+ export declare function formatStats(stats: RsbuildStats, hasErrors: boolean, root: string): {
23
23
  message?: string;
24
24
  level?: string;
25
25
  };
@@ -1,4 +1,6 @@
1
1
  import type { InternalContext, PrintFileSizeAsset, RsbuildPlugin } from '../types';
2
+ /** Normalize filename by removing hash for comparison across builds */
3
+ export declare function normalizeFilename(fileName: string): string;
2
4
  /** Exclude source map and license files by default */
3
5
  export declare const excludeAsset: (asset: PrintFileSizeAsset) => boolean;
4
6
  export declare const pluginFileSize: (context: InternalContext) => RsbuildPlugin;
@@ -542,6 +542,11 @@ export type PrintFileSizeOptions = {
542
542
  * @default (asset) => /\.(?:map|LICENSE\.txt)$/.test(asset.name)
543
543
  */
544
544
  exclude?: (asset: PrintFileSizeAsset) => boolean;
545
+ /**
546
+ * Whether to show file size difference compared to the previous build.
547
+ * @default false
548
+ */
549
+ diff?: boolean;
545
550
  };
546
551
  export interface PreconnectOption {
547
552
  /**
@@ -1532,6 +1537,11 @@ export type ClientConfig = {
1532
1537
  * @default true
1533
1538
  */
1534
1539
  overlay?: boolean;
1540
+ /**
1541
+ * Controls the log level for client-side logging in the browser console.
1542
+ * @default 'info'
1543
+ */
1544
+ logLevel?: 'info' | 'warn' | 'error' | 'silent';
1535
1545
  };
1536
1546
  export type NormalizedClientConfig = Optional<Required<ClientConfig>, 'protocol'>;
1537
1547
  export type { ChokidarOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.6.12",
3
+ "version": "1.6.13",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -55,7 +55,7 @@
55
55
  "devDependencies": {
56
56
  "@jridgewell/remapping": "^2.3.5",
57
57
  "@jridgewell/trace-mapping": "^0.3.31",
58
- "@rslib/core": "0.18.2",
58
+ "@rslib/core": "0.18.3",
59
59
  "@types/connect": "3.4.38",
60
60
  "@types/cors": "^2.8.19",
61
61
  "@types/node": "^24.10.1",