Skip to content

安装与安装向导

在cmd窗口运行下面的命令

npm add -D vitepress

执行完成后,大概你会看到下面的内容

added 71 packages in 17s

10 packages are looking for funding
  run `npm fund` for details

安装向导

VitePress 附带一个命令行设置向导,可以帮助你构建一个基本项目。安装后,通过运行以下命令启动向导:

npx vitepress init

下面是我的设置选择

┌  Welcome to VitePress!

◇  Where should VitePress initialize the config?
│  ./

◇  Site title:
│  bao

◇  Site description:
│  xiaobao

◇  Theme:
│  Default Theme + Customization

◇  Use TypeScript for config and theme files?
│  No

◇  Add VitePress npm scripts to package.json?
│  Yes

└  Done! Now run npm run docs:dev and start writing.

Tips:
- Since you've chosen to customize the theme, you should also explicitly install vue as a dev dependency.

执行完上面的命令后

我们看看我们的文件夹有什么新的变化

├─ vitehub
│  ├─ .vitepress
│  │  └─ config.js
│  ├─ api-examples.md
│  ├─ markdown-examples.md
│  └─ index.md
└─ package.json

本地运行

启动并运行

npm run docs:dev

Released under the MIT License