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

vite.build.emptyOutDir not taken into consideration #6151

Closed
1 task
torchsmith opened this issue Feb 6, 2023 · 3 comments · Fixed by #6153
Closed
1 task

vite.build.emptyOutDir not taken into consideration #6151

torchsmith opened this issue Feb 6, 2023 · 3 comments · Fixed by #6153
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@torchsmith
Copy link
Contributor

What version of astro are you using?

2.0.5

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

yarn

What operating system are you using?

Mac

Describe the Bug

Would like to prevent astro from clearing out /dist on astro build.

Needed for caching certain files/folders in /dist in certain projects.

Just need to support the vite.build.emptyOutDir in the astro config.

Link to Minimal Reproducible Example

trust

Participation

  • I am willing to submit a pull request for this issue.
@Princesseuh Princesseuh added the - P3: minor bug An edge case that only affects very specific usage (priority) label Feb 6, 2023
@torchsmith
Copy link
Contributor Author

Found what I think is related code in src/core/build/static-build.ts line 61-64.

Not sure how to access vite settings/config.

// Lines 61-64
// Empty out the dist folder, if needed. Vite has a config for doing this
// but because we are running 2 vite builds in parallel, that would cause a race
// condition, so we are doing it ourselves
emptyDir(settings.config.outDir, new Set('.git'));

@torchsmith
Copy link
Contributor Author

image

Also this typescript error.... Not sure why it'd be erroring , and why outDir isn't in the typescript here. Same thing for settings.config.output in other places in the file.

@torchsmith
Copy link
Contributor Author

#6153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants