Specify a vue-cli vue.config.js location

橙三吉。 提交于 2019-12-01 20:11:19

问题


I have a vue.config.js file in my project's base directory. I'd like to move this next to my other config files in a /config/ folder.

How can I specify the new location of this file for vue-cli?


回答1:


The environment variable VUE_CLI_SERVICE_CONFIG_PATH specifies the absolute path to vue.config.js. Relative paths for this variable fail on macOS (and probably other platforms).

Example on command line:

$ VUE_CLI_SERVICE_CONFIG_PATH=$PWD/config/vue.config.js npm run build

Or in package.json:

{
  "scripts": {
    "build": "VUE_CLI_SERVICE_CONFIG_PATH=$PWD/config/vue.config.js vue-cli-service build"
  }
}


来源:https://stackoverflow.com/questions/52131843/specify-a-vue-cli-vue-config-js-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!