dev.lazyCompilation
- Type:
- Default: depends on how the application renders:
- Pure CSR and streaming SSR applications:
{ imports: true, entries: false }, which compiles dynamic imports on demand; - Applications using string SSR (including any entry in
server.ssrByEntriesusing string SSR), RSC or SSG:false.
- Pure CSR and streaming SSR applications:
Enable lazy compilation (compilation on demand), implemented based on Rspack's lazy compilation feature.
This option only takes effect in the dev server and does not affect production build output. When enabled for streaming SSR applications, route components are still compiled eagerly so that first-screen JS/CSS injection stays correct.
An explicitly configured dev.lazyCompilation always takes precedence over the default. To disable it:
Info
The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to Rsbuild - dev.lazyCompilation。 In Rspack build mode,