Skip to content

refactor: allow setting dotenv config for loadOptions #3274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 3, 2025
Merged

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Apr 2, 2025

this allows configuring the location of the .env file, which is needed (for example) with nuxt's --dotenv argument. Otherwise, while Nuxt can load from .env.production (or similar), nitro will always load in the values from .env into process.env.

alternatively, it would be just as good to disable Nitro loading a .env file.

related: nuxt/cli#381

@danielroe danielroe requested a review from pi0 as a code owner April 2, 2025 14:43
Co-authored-by: Pooya Parsa <[email protected]>
Copy link

cloudflare-workers-and-pages bot commented Apr 2, 2025

Deploying nitrojs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98ed108
Status: ✅  Deploy successful!
Preview URL: https://e691a509.nitrojs.pages.dev
Branch Preview URL: https://fix-dotenv-override.nitrojs.pages.dev

View logs

@pi0 pi0 changed the title fix: allow configuring location of .env file refactor: allow setting dotenv config for loadOptions Apr 2, 2025
@pi0 pi0 merged commit eae11ca into v2 Apr 3, 2025
5 checks passed
@pi0 pi0 deleted the fix/dotenv-override branch April 3, 2025 22:15
pi0 pushed a commit that referenced this pull request Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants