szymmis / vite-express

⚡ @vitejs integration module for @expressjs
MIT License
657 stars 38 forks source link

Export ViteConfig so code using ViteExpress can statically type the `inlineConfig` #141

Open odahcam opened 3 months ago

odahcam commented 3 months ago

Currently I'm creating inlineConfig only if I have certain given environment variables:

Screenshot 2024-08-05 at 10 28 34

Without ViteConfig TS complains about my inline config object.

szymmis commented 2 months ago

Hi @odahcam, sorry for the delay. I think it would absolutely make sense to expose this type to the user but it isn't as easy as I though as I'm struggling with type definition generation. I guess I could just write types by hand as the API isn't changing that much nowadays but I'm not a big fan of this idea because code would no longer be the source of truth for the type declaration file.

I'll look into it a little bit more and I'll try to come back with something!