I am trying to access some environment variables inside of the index.html
file. Are the environment variables even accessible at the time the index.html builds? I have tried something along the lines of this and I am able to print out the log in the console
index.html
<script type="text/javascript">
console.log('this is inside index.html');
</script>
But when I try to access the environment variables I am unable to do so. I have read in a few places that this is possible, but am unable to accomplish it.
.env file
VITE_MY_VAR = 'HELLO WORLD;
index.html
<script type="text/javascript">
console.log('my env var', VITE_MY_VAR);
<% console.log('test', process.env['VITE_MY_VAR']) %>
</script>