diff --git a/packages/core/src/node/initRsbuild.ts b/packages/core/src/node/initRsbuild.ts index 1847a6450..6cb685803 100644 --- a/packages/core/src/node/initRsbuild.ts +++ b/packages/core/src/node/initRsbuild.ts @@ -243,6 +243,12 @@ async function createInternalBuildConfig( if (isServer) { chain.output.filename('main.cjs'); } + + const enableIncremental = + !isProduction() && !process.env.DISABLE_RSPACK_INCREMENTAL; + if (enableIncremental) { + chain.merge({ experiments: { incremental: true } }); + } }, }, environments: {