# Environment Variables
vue-element-admin 4.0+ is built o
vue-cli, so all environment variables are controlled based on
.env # loaded in all cases .env.[mode] # only loaded in specified mode
An env file simply contains key=value pairs of environment variables:
note! ! !
Environment variables must start with
VUE_APP_. Such as:
You can access them in your application code:
In addition to
VUE_APP_* variables, there are also two special variables that will always be available in your app code:
NODE_ENV- this will be one of "development"、"production" or "test" depending on the mode the app is running in.
BASE_URL- this corresponds to the
vue.config.jsand is the base path your app is deployed at.
# Build related
In addition to some environment variables written in
.env, there are some build and deployment related variables that need to be configured in
You can set the different parameters by executing the judgment environment with
Specific code can learn from vue.config.js