-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Multiple and aliased publicDirs
#16138
Comments
I took a look at this one thinking it will be easy to implement, but if we go with |
This looks similar to #3428, which proposes support for snowpack mounts. I think it's an interesting idea, but I've not hit many cases that requires it (including for Astro and SvelteKit), and a single public directory has served well. I also think Nuxt can go ahead with its PR at the meantime. Following #3428, there only seems a few users who wanted it. |
In the application with |
I encountered this problem while working with monorepo. So I created a plugin for it. You can check out my library |
Description
Currently, Vite supports a single
publicDir
. However, there are situations where we might want to merge multiple public directories. For example, in Nuxt we support an arbitrary number of public directories, each with a possible prefix (e.g./foo
points to/some/dir
)We can implement this within Nuxt itself (e.g. nuxt/nuxt#26163) but we obviously lose out on some of the cool features Vite has, like rendering relative URLs, and in general the entire asset pipeline.
Suggested solution
publicDir
could also accept an array of strings or objects of{ dir: string, prefix: string }
(to support alias).Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: