diff --git a/.changeset/eleven-wasps-teach.md b/.changeset/eleven-wasps-teach.md new file mode 100644 index 000000000..3a0993f49 --- /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 28f496d91..896d771ac 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