environment variables to be used in vitepress pages #634
Unanswered
fessacchiotto
asked this question in
Q&A
Replies: 2 comments 12 replies
-
Also looking for this answer. Is there any way? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This was quite difficult to figure out, but now I think I have it.
Inside the environment variable file:
<script setup>
const someEnvVariable = import.meta.env.VITE_SOME_ENV_VARIABLE;
</script>
|
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi! I'd like to retrieve the git build and branch data from an environment variable I can set/export at build time.
is there a way I can reference such an env variable somewhere in the markdown files or config files? tia!
Beta Was this translation helpful? Give feedback.
All reactions