Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: "chunks" directory appears in build output, if custom modules are imported in Astro files #4868

Merged
merged 5 commits into from Sep 26, 2022
Merged

Conversation

rishi-raj-jain
Copy link
Contributor

@rishi-raj-jain rishi-raj-jain commented Sep 25, 2022

fixes #4435

Attempts to maintain a list of directories from which the server side assets are found, and then after removing the files, loop over to remove only empty directories.

@changeset-bot
Copy link

changeset-bot bot commented Sep 25, 2022

🦋 Changeset detected

Latest commit: 3f75956

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Sep 25, 2022
@rishi-raj-jain rishi-raj-jain changed the title Update static-build.ts fix: "chunks" directory appears in build output, if custom modules are imported in Astro files Sep 25, 2022
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! This looks good to me. I think a simple directory check is enough to capture most cases.

@rishi-raj-jain
Copy link
Contributor Author

I think a simple directory check is enough to capture most cases.

Yeah, I was thinking of a recursive check, but can implement that if a case like that comes up?

@rishi-raj-jain
Copy link
Contributor Author

rishi-raj-jain commented Sep 26, 2022

Found https://gist.github.com/fixpunkt/fe32afe14fbab99d9feb4e8da7268445, which can be called on all the directories created from the .mjs files.

@bluwy
Copy link
Member

bluwy commented Sep 26, 2022

Yeah I think this PR is good for now, you can implement a recursive one if you're interested too, maybe we should avoid the glob too and manually iterate through the directories to avoid too many fs calls. But I'll merge this one first. Thanks for your help around Astro lately!

@bluwy bluwy merged commit b99f990 into withastro:main Sep 26, 2022
@astrobot-houston astrobot-houston mentioned this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"chunks" directory appears in build output, if custom modules are imported in Astro files
2 participants