Allow custom vite env prefix
See original GitHub issueClear and concise description of the problem
As a developer using Vite I want to be able to set a custom prefix for VITE env variables.
Suggested solution
It seems that loadEnv
already accepts a prefix
argument. If the prefix can be passed via a vite config/option, this would be ideal.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that request the same feature to avoid creating a duplicate.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Allow to define custom env without VITE prefix · Issue #1095
Vite should have a whitelist of ENV which should be passed directly to app during development or building process. For example having an...
Read more >Env Variables and Modes
Vite exposes env variables on the special import.meta.env object. ... If you want to customize the env variables prefix, see the envPrefix option....
Read more >How to change envPrefix in vite react?
I want to change envDir to environment folder and envPrefix to CH_ . But don't know how to. Can you tell me how...
Read more >Configuration • Docs • SvelteKit
To allow people to make POST form submissions to your app from other origins, ... Note that Vite's envPrefix must be set separately...
Read more >Using environment variables in SvelteKit (and Vite)
Vite statically replaces any use of an environment variable so import.meta.env.VITE_FOO will compile down to "foo" assuming your .env has ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Currently there is no associated PR and I don’t know a branch for that. So yeah, pls feel free 🚀 I’m happy to review it when you are finished 🙂
Does anyone work on this issue? I’m willing to give it a shot in weekends.