I feel this should not be a hard thing to do, but I can't get it to run.
I want to have two different configs for my local Vue.js project (using vue-cli 3).
- the first having VUE_APP_API_URL on my localhost,
- the other connecting to a development/staging server
So, I want to have .env.development-1 and .env-development-2 or something like that; just a way to quickly switch between two otherwise identical configuration files.
I've read about build modes etc, but those articles all seem to target "building". I just want to run local devserver with a different config.
How would I solve this?
vue-clitake a look at cli.vuejs.org/guide/mode-and-env.html#modes .npm run devorserve), it is first build (by webpack) so those ENV variables will be injected into your code. This is exactly what you need...