Specify a vue-cli vue.config.js location

后端 未结 1 856
南旧
南旧 2021-01-18 11:50

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.

Ho

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-18 12:29

    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"
      }
    }
    

    0 讨论(0)
提交回复
热议问题