close

dev.liveReload

  • Type: boolean | { html?: boolean }
  • Default: true

Whether to reload the page when source files are changed.

By default, Rsbuild uses HMR as the preferred method to update modules. If HMR is disabled or cannot be used in certain scenarios, it will automatically fallback to liveReload.

Refer to Hot Module Replacement for more information.

Disabling live reload

To disable live reload, set both dev.hmr and dev.liveReload to false. Then, no WebSocket requests will be made to the dev server on the page, and the page will not automatically refresh when files change.

rsbuild.config.ts
export default {
  dev: {
    hmr: false,
    liveReload: false,
  },
};

Options

liveReload.html

  • Type: boolean
  • Default: true

By default, Rsbuild triggers a full page reload when the HTML template changes.

When liveReload is an object, set liveReload.html to false to prevent a full page reload when the HTML template changes:

rsbuild.config.ts
export default {
  dev: {
    liveReload: {
      html: false,
    },
  },
};

Version history

VersionChanges
v2.0.0Added html option