I want to build two separate vue apps that will be served on two different routes in an express application: a ‘public’ vue app and an ‘admin’ vue app. These two apps have their
It is also possible to have multiple vue.config.js
configs and switch them over using the VUE_CLI_SERVICE_CONFIG_PATH
environment variable.
For example, we can have a default vue.config.js
and an additional vue.public.config.js
and run the build like this:
# Build using vue.config.public.js
# Note: using real path here, it didn't work with relative path
CONF=`realpath vue.config.public.js`
VUE_CLI_SERVICE_CONFIG_PATH=$CONF npm run build
# Build using default vue.config.js
npm run build
Where npm run build
is defined in package.json
as vue-cli-service build
:
"scripts": {
"build": "vue-cli-service build"
}
Note: I didn't find any mention on VUE_CLI_SERVICE_CONFIG_PATH
in the documentation, found it looking at the source code.