Skip to content
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

[SYNC] feat: allow custom vite env prefix (#4676) #52

Closed
github-actions bot opened this issue Aug 28, 2021 · 0 comments · Fixed by #56
Closed

[SYNC] feat: allow custom vite env prefix (#4676) #52

github-actions bot opened this issue Aug 28, 2021 · 0 comments · Fixed by #56
Labels

Comments

@github-actions
Copy link
Contributor

feat: allow custom vite env prefix (#4676) (dfdb9cc)


+++ b/docs/config/index.md
@@ -333,6 +333,18 @@ export default defineConfig(async ({ command, mode }) => {
See [here](/guide/env-and-mode#env-files) for more about environment files.
+### envPrefix
+
+- **Type:** `string | string[]`
+- **Default:** `VITE_`
+
+  Env variables starts with `envPrefix` will be exposed to your client source code via import.meta.env.
+
+:::warning SECURITY NOTES
+
+- `envPrefix` should not be set as `''`, which will expose all your env variables and cause unexpected leaking of of sensitive information. Vite will throw error when detecting `''`.
+  :::
+
## Server Options
### server.host
@github-actions github-actions bot added the sync label Aug 28, 2021
@Gumball12 Gumball12 mentioned this issue Sep 6, 2021
Gumball12 added a commit that referenced this issue Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants