vitepress 发布到 gitee上的build命令 自动设置base

docs.vitepressconfig.js

const argv = require('minimist')(process.argv.slice(2))
const build = argv.build || false
const baseBuild = build ? '/vitepress2021/' : '/'
module.exports = {
  base: baseBuild,
  title: 'Hello VitePress',
  description: 'Just playing around.'
}

package.json

"scripts": {
    "dev": "vitepress dev docs --port 3999",
    "build": "vitepress build docs --build",
    "serve": "vitepress serve docs"
  },
原文地址:https://www.cnblogs.com/pengchenggang/p/14246804.html