Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
A config solution was found by @hi-ogawa here honojs/vite-plugins#222 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi was trying@hono/vite-build which enables you to use Vite for the server and client code and make use of the single Vite dev server. Its rather nice that it lets you create something with minimal boilerplate in Vite, similar to the new Bun fullstack dev server.
In the server code, I noticed you cannot use
process.env
as Vite has the internal defines plugin to replace it with static values. honojs/vite-plugins#222.This doesn't make sense for the server, as the environment variables are usually used for configurability and providing secrets etc at runtime.
Anyone know a way to configure Vite's default behaviour for defines? Seems like it doesn't happen in library mode. Also it doesn't looks like there is a clear plugin api to modify the internal Vite plugins for situations like this, just the user config.
Is the approach Hono is currently taking with the plugin api just a new use case for Vite?
I can only think of imperfect workarounds, perhaps the approach of the Hono plugin is missing something altogether and the lib mode should be used for other reasons aswell, since it targets the server and not a "browser client"?
Beta Was this translation helpful? Give feedback.
All reactions