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

Make 'public' directory path configurable #1799

Closed
pixelspark opened this issue Jan 29, 2021 · 0 comments
Closed

Make 'public' directory path configurable #1799

pixelspark opened this issue Jan 29, 2021 · 0 comments

Comments

@pixelspark
Copy link

Is your feature request related to a problem? Please describe.

I want to build two products (a client and a server) from the same project. To this end I have two Vite config files with (among others) different entry points. I want to use the public directory to copy over certain files to the client's root directory, but also to copy certain files to the server's root directory. Currently however there is no way to tell Vite to use a different 'public' directory for each build. Judging by the source code, the "public" path seems to be hardcoded:

const publicDir = resolve('public')

Describe the solution you'd like

Allow the "public" directory to be changed from the vite.config.js file. Suggestion:

"publicDir": "name of directory (public by default)"

Describe alternatives you've considered

Instructions on building both server and client with Vite are limited. I might be misusing Vite for this purpose, but I do like to use the same build system for both, so you just have to learn one system. I could use rollup directly for the server build of course.

Additional context
n/a

Very happy with Vite so far!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant