-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Closed
Labels
Description
Version
4.4.4
Environment info
System:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Binaries:
Node: 11.11.0 - ~/.nvm/versions/node/v11.11.0/bin/node
Yarn: 1.16.0 - ~/.nvm/versions/node/v11.11.0/bin/yarn
npm: 6.7.0 - ~/.nvm/versions/node/v11.11.0/bin/npm
Steps to reproduce
VUE_CLI_SERVICE_CONFIG_PATH=$PWD/vue.lib-config.js vue-cli-service lib --sourceMap
What is expected?
读取项目文件夹下的vue.lib-config.js配置文件
What is actually happening?
实际上读取的是同级文件夹下的vue.config.js配置文件
vue-cli/packages/@vue/cli-service/lib/Service.js
Lines 306 to 318 in a41cac2
const possibleConfigPaths = [ | |
process.env.VUE_CLI_SERVICE_CONFIG_PATH, | |
'./vue.config.js', | |
'./vue.config.cjs' | |
] | |
let fileConfigPath | |
for (const p of possibleConfigPaths) { | |
const resolvedPath = p && path.resolve(this.context, p) | |
if (resolvedPath && fs.existsSync(resolvedPath)) { | |
fileConfigPath = resolvedPath | |
} | |
} |
之前是通过VUE_CLI_SERVICE_CONFIG_PATH环境变量自定义配置文件路径,请问现在是会被 ./vue.config.js
./vue.config.cjs
替换么