Support `.env` file for production / preview node preset
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
It is quite often required to test production Node.js preset outputs with dotenv file. I am thinking of 3 possible ways:
- Change preview command to
node -r require/dotenv .output/server/index.mjs(user needs dotenv local dependency) - Support a preview command used by nitro (and other frameworks such as nuxi)
- Enable feature by default (as a bundled runtime)
- Enable feature behind a flag (can be enabled by a CLI flag)
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..
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the production and preview Node.js preset behavior and the preview command used to launch .output/server/index.mjs. Compare the proposed dotenv dependency, Nitro-style preview command, bundled runtime, and CLI-flag approaches, including runtime overhead. Done means selecting and documenting one supported approach with coverage for production and preview outputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100