HonoH
Hono12mo ago
Josh

Question on vite build with node server

Hey, I'm new to using hono and I was trying to make a production build with vite using the vite-build plugin but whenever I run it none of the env variables will load. For dev I was injecting them with the dotenv-cli within the package.json scripts, but no matter what I do I cannot get them to work after making a vite build.

after the build i'm using the node "./dist/index.js" command but when logging the process.env variable there is nothing in there when compared to dev.

I'm going to test out trying to deploy this today with wrangler/cloudflare but I was just experimenting and trying to get the build to run locally for testing but nothing was working.
Was this page helpful?