Open pi0 opened 1 year ago
For cloudflare presets previews, there's builtin dotenv supports too, but the file needs to be named .dev.vars
Good to know! My aim for this issue was mainly for Node presets but having other preset previews in mind, we might either leverage possible preview
command or guide with args to use .env
Currently, append --dotenv .env.local
to dev
or build
script doesn't work like nuxt
, is it?
Note that this feature should be coming to Node natively in 20.6.
what if running in serverless environment rather than node server in future?
Note that this feature should be coming to Node natively in 20.6.
Turns out the strong competition provided by deno and bun is working. We might have TS support in node at this rate 🤞🏽
It is quite often required to test production Node.js preset outputs with dotenv file. I am thinking of 3 possible ways:
node -r require/dotenv .output/server/index.mjs
(user needs dotenv local dependency)Need to check how much is actual runtime overhead of dotenv (it seems as low as 5KB).
Also worth to node that, the "local" kind presets (Bun and Deno) both already have built-in dotenv support via CLI args. And there is an ongoing discussion within Node.js team to make it build-in feature..