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

docs.vitepress\config.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"
  },
posted @ 2021-01-07 15:38  彭成刚  阅读(785)  评论(0编辑  收藏  举报