Cleanup dotfiles in dist (#8092)

* fix(#7933, plt-789): cleanup dotfiles during build

* chore: add changeset
This commit is contained in:
Nate Moore 2023-08-16 09:20:38 -05:00 committed by GitHub
parent 0ad6a5e2d8
commit 7177f7579b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Ensure dotfiles are cleaned during static builds

View file

@ -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