From 615b2095fdffb96f52f43e6461786a7b98c1ef0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Sat, 30 Nov 2024 02:47:19 +0800 Subject: [PATCH] fix: remove deprecated nodejs api --- src/rspack/utils.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 }) }) }