package.json脚本命令为

json
  • 01
  • 02
  • 03
  • 04
"scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build" },

将输出目录参数传递给build命令

shell
  • 01
npm run build -- --dest='../dist'

参考:https://cli.vuejs.org/zh/guide/cli-service.html#vue-cli-service-build