diff --git a/packages/core/src/types/config.ts b/packages/core/src/types/config.ts index 1a13ee0425..37cc1fc9f2 100644 --- a/packages/core/src/types/config.ts +++ b/packages/core/src/types/config.ts @@ -1720,7 +1720,7 @@ export type WriteToDisk = boolean | ((filename: string) => boolean); export interface DevConfig { /** - * Enables forwarding of browser runtime errors to the terminal. When `true`, the dev + * Controls whether to forward browser runtime errors to the terminal. When `true`, the dev * client listens for window `error` events in the browser and send them to the dev server, * where they are printed in the terminal (prefixed with `[browser]`). * @default true diff --git a/website/docs/en/config/dev/browser-logs.mdx b/website/docs/en/config/dev/browser-logs.mdx new file mode 100644 index 0000000000..82c64aec29 --- /dev/null +++ b/website/docs/en/config/dev/browser-logs.mdx @@ -0,0 +1,38 @@ +# dev.browserLogs + +- **Type:** `boolean` +- **Default:** `true` +- **Version:** Added in v1.5.13 + +Controls whether to forward browser runtime errors to the terminal. + +When `true`, the Rsbuild client listens for window `error` events in the browser and send them to the dev server, where they are printed in the terminal (prefixed with `[browser]`). + +## Example + +For example, if you have the following code in your application: + +```jsx title="src/App.jsx" +const App = () => { + const item = undefined; + return