From 430e0346c9dc0def8af93e0a393dc2847e145d2f Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Wed, 19 Oct 2022 22:03:56 +0800 Subject: [PATCH] Use `fs.promises.rm` to remove node deprecation warning (#5119) --- .changeset/eight-swans-divide.md | 5 +++++ packages/astro/src/core/build/static-build.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/eight-swans-divide.md diff --git a/.changeset/eight-swans-divide.md b/.changeset/eight-swans-divide.md new file mode 100644 index 0000000000..84484d94b5 --- /dev/null +++ b/.changeset/eight-swans-divide.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Use `fs.promises.rm` to remove node deprecation warning diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index ee0877a19f..3746fc583e 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -270,7 +270,7 @@ async function cleanSsrOutput(opts: StaticBuildOptions) { const url = new URL(filename, out); const folder = await fs.promises.readdir(url); if (!folder.length) { - await fs.promises.rmdir(url, { recursive: true }); + await fs.promises.rm(url, { recursive: true, force: true }); } }) );