Skip to content

Commit

Permalink
Cleanup dotfiles in dist (#8092)
Browse files Browse the repository at this point in the history
* fix(#7933, plt-789): cleanup dotfiles during build

* chore: add changeset
  • Loading branch information
natemoo-re committed Aug 16, 2023
1 parent 0ad6a5e commit 7177f75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-wasps-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Ensure dotfiles are cleaned during static builds
2 changes: 2 additions & 0 deletions packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7177f75

Please sign in to comment.