environment variables to be used in vitepress pages #634
Unanswered
fessacchiotto
asked this question in
Q&A
Replies: 2 comments 4 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.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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