question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow custom vite env prefix

See original GitHub issue

Clear 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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Shinigami92commented, Aug 21, 2021

Does anyone work on this issue? I’m willing to give it a shot in weekends.

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 🙂

1reaction
iheyunfeicommented, Aug 21, 2021

Does anyone work on this issue? I’m willing to give it a shot in weekends.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found