-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Add exclude option for build.copyPublicDir #14148
Comments
I don't think we need a new feature for this since it could be fixed with a post-build step to remove the But also, (depending on your usecase) could you dynamically create the directory instead of using |
The plubic folder will also be used for development, dynamic creation seems a bit cumbersome, remove .gitkeep with a post-build step will be great, thanks! The. getkeep file is not very large, so preserving it is not a problem, I just hope this option can handle various situations, I brought up a PR and if it's not needed, it can be turned off. |
I think we'd want to make public more opinionated, in that it simply copies it entirely to dist. So I think it's best to not add this new option. It could also be done as a Vite plugin with the generateBundle hook to manually remove the unwanted files too. I'll see if others have thoughts on this though. |
Yeah, this application scenario is really limited, so only the .gitkeep file was ignored in the latest PR |
Let's close this issue, I also think it is better to avoid adding extra complexity to Vite core if possible. See also #14304 (comment) |
Description
When I use vercel to deploy the vite application, I need to write files to the public folder, so I added the .gitkeep file, but vite also uses .gitkeep as a package file.
This problem is because I need to use the web program packaged by vite as a cli tool, but I also want to deploy it to the vercel server for users to view the effect. In order to facilitate API requests, I use the public folder.
Suggested solution
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: