3👍
From the Vue environment variable docs:
Note that only variables that start with VUE_APP_ will be statically embedded into the client bundle
This means that all custom vars you want to use in your .env
files must be prefixed with VUE_APP_
if you want to pull them into the Vue app. For example:
VUE_APP_SECRET=secret
VUE_APP_TITLE=myapp
You then access them in your code like:
console.log(process.env.VUE_APP_SECRET)
👤Dan
- [Vuejs]-Passing props/attribute to nested component inside custom component
- [Vuejs]-Re-using Vuetify theme colors
1👍
Ive managed to fix the issue doing the following:
<component :is="mainLogoLoader" class="logo"></component>
computed: {
mainLogoLoader () {
return () => import('@/logos/' +process.env.MAIN_SITE+ '.vue')
}
},
and in module.exports:
MAIN_SITE: '"'+process.env.site+'"'
and my build command:
#site=mysite npm run build
- [Vuejs]-How to use Vuetify in Laravel 9 Vue SPA?
- [Vuejs]-How to create common.css file and use postcss only?
Source:stackexchange.com