I am using Vue-CLI and trying to hide certain "secrets" from the client-side code using environment variables.
Why do I get an undefined
in console?
Root file: .env.development
NODE_ENV=development
SECRET_WORD=foo
app file: src/components/example.vue
export default {
created() {
console.log(process.env.SECRET_WORD)
},
...snip...
Now, if I do VUE_APP_SECRET_WORD=foo
with process.env.VUE_APP_SECRET_WORD
it works, but I don't want to display secrets statically like that.