diff --git a/src/rspack/utils.ts b/src/rspack/utils.ts index 5ac55c8c..ecd973bb 100644 --- a/src/rspack/utils.ts +++ b/src/rspack/utils.ts @@ -25,9 +25,7 @@ export class FakeVirtualModulesPlugin { fs.mkdirSync(dir, { recursive: true }) } compiler.hooks.shutdown.tap(this.name, () => { - if (fs.existsSync(dir)) { - fs.rmdirSync(dir, { recursive: true }) - } + fs.rmSync(dir, { recursive: true, force: true }) }) }