File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ export function setupCommands(): void {
123123 )
124124 . action ( async ( options : BuildOptions ) => {
125125 try {
126+ if ( ! options . watch ) {
127+ process . env . RSPACK_UNSAFE_FAST_DROP = 'true' ;
128+ }
129+
126130 const rsbuild = await init ( {
127131 cliOptions : options ,
128132 isBuildWatch : options . watch ,
Original file line number Diff line number Diff line change @@ -11,3 +11,12 @@ declare global {
1111 const RSBUILD_WEB_SOCKET_TOKEN : string ;
1212 const Deno : unknown ;
1313}
14+
15+ declare namespace NodeJS {
16+ interface ProcessEnv {
17+ /**
18+ * @experimental
19+ */
20+ RSPACK_UNSAFE_FAST_DROP ?: string ;
21+ }
22+ }
Original file line number Diff line number Diff line change @@ -105,6 +105,11 @@ export async function createCompiler(options: InitConfigsOptions): Promise<{
105105 ? rspack ( rspackConfigs )
106106 : rspack ( rspackConfigs [ 0 ] ) ;
107107
108+ // Enable unsafe fast drop in non-watch mode to improve performance
109+ if ( process . env . RSPACK_UNSAFE_FAST_DROP === 'true' ) {
110+ compiler . unsafeFastDrop = true ;
111+ }
112+
108113 let isVersionLogged = false ;
109114 let isCompiling = false ;
110115
You can’t perform that action at this time.
0 commit comments