Handling Multiple Public Directories in Vite for a Monorepo Setup #17838
-
We are building a set of websites using a monorepo structure. We want to manage our public assets more efficiently by placing them in a shared package directory external to each site's root directory. Specifically, we need Vite to handle multiple locations for public assets, not just the default public folder. Here's an outline of our directory structure:
We want Vite to recognize and serve assets from Do you think this approach is sensible? If so, how can we configure Vite to support multiple public directories? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Maybe you can implement your needs with a custom plugin, I have implemented similar needs in my projects. Copy the files you want as public to Tips:
|
Beta Was this translation helpful? Give feedback.
-
I wrote a plugin about this issue to support monorepo and micro FE. You can check it here, I think it will help to solve your problem |
Beta Was this translation helpful? Give feedback.
I wrote a plugin about this issue to support monorepo and micro FE. You can check it here, I think it will help to solve your problem