From 7177f7579b6e866f0fd895b3fd079d8ba330b1a9 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Wed, 16 Aug 2023 09:20:38 -0500 Subject: [PATCH] Cleanup dotfiles in dist (#8092) * fix(#7933, plt-789): cleanup dotfiles during build * chore: add changeset --- .changeset/eleven-wasps-teach.md | 5 +++++ packages/astro/src/core/build/static-build.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/eleven-wasps-teach.md diff --git a/.changeset/eleven-wasps-teach.md b/.changeset/eleven-wasps-teach.md new file mode 100644 index 000000000000..3a0993f49e22 --- /dev/null +++ b/.changeset/eleven-wasps-teach.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Ensure dotfiles are cleaned during static builds diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 28f496d91660..896d771ac55f 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -352,6 +352,8 @@ async function cleanServerOutput(opts: StaticBuildOptions) { // The SSR output is all .mjs files, the client output is not. const files = await glob('**/*.mjs', { cwd: fileURLToPath(out), + // Important! Also cleanup dotfiles like `node_modules/.pnpm/**` + dot: true, }); if (files.length) { // Remove all the SSR generated .mjs files