0👍
My recommendation is: Do not overcomplicate. Just use one single .env file.
Just make sure to don’t push it to the repo, otherwise it would be public. That’s all.
I my config I’ve got: .env for dev with the constants in there.
Then In the production enviroment you just set the Variables there.
- [Vuejs]-Get first several only items of the array with fetch
- [Vuejs]-How to access the value of a ref in Vue 3?
0👍
You should not push .env.production
to git repo but if you really want to do it, on build command you can do like this on package.json
file
"build": "cp .env.production .env && vue-cli-service build",
Source:stackexchange.com