Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/browser/src/hostController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,12 @@ export const createBrowserLazyCompilationConfig = (
};
};

export const createBrowserRsbuildDevConfig = (isWatchMode: boolean) => {
export const createBrowserRsbuildDevConfig = (_isWatchMode: boolean) => {
return {
writeToDisk: isDebug(),
// Disable HMR in non-watch mode (tests run once and exit).
// Aligns with node mode behavior (packages/core/src/core/rsbuild.ts).
hmr: isWatchMode,
// Keep HMR enabled in browser mode even for one-shot runs.
// lazyCompilation depends on HMR runtime wiring for async import chains.
hmr: true,
client: {
logLevel: 'error' as const,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/tests/hostController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ describe('browser config resolution', () => {
expect(browserConfig.strictPort).toBe(true);
});

it('should disable HMR in non-watch mode and keep error-only client log', () => {
it('should enable HMR in non-watch mode and keep error-only client log', () => {
const devConfig = createBrowserRsbuildDevConfig(false);

expect(devConfig.hmr).toBe(false);
expect(devConfig.hmr).toBe(true);
expect(devConfig.client.logLevel).toBe('error');
});

Expand Down
Loading