-
Notifications
You must be signed in to change notification settings - Fork 40
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
Loading vite config when it is not in the current working directory #92
Comments
Hi @peterlama, thanks for raising that issue. When it comes to the implementation, I think that creating a config option for custom config path and passing it down as you did is the best way. |
I stumbled upon the same problem statement and ended up setting up Vite SSR myself. I can give it a go if this hasn't been picked up yet. But what I did was similar to what OP has mentioned but in my case as the server was behind a reverse proxy, I did not want the server to use |
I forgot I had not followed up on this! I ended up pulling this package into my project's monorepo to make some other customizations, but I have now created a PR with the above mentioned config change. |
Thanks for working on this @peterlama and @szymmis 🚀 |
These changes together with #103 were published in v0.13.0! 🎉 |
First of all, I want to thank you! I was able to accomplish exactly what I wanted using this module.
With that said, I have a unique requirement and I had to make a couple changes to get it to work.
The thing is, my project is in a monorepo and I have the Express server and vite app in two different packages. This means the vite config is not in the current working directory and vite can't find it. There is the vite-express config option
inlineViteConfig
, but it seemed like vite plugins couldn't be used with that.My solution was to pass the absolute path of vite.config.ts to vite.resolveConfig and the root path to vite.createServer.
Essentially:
Would you be open to a PR for that?
The text was updated successfully, but these errors were encountered: