Linux command
vitepress 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start development server
vitepress dev [docs]
Build for production
vitepress build [docs]
Preview production build
vitepress preview [docs]
Initialize new project
vitepress init
Start in current directory
vitepress
说明
VitePress is a static site generator powered by Vite and Vue.js. It is designed for documentation websites, providing fast development experience with hot module replacement and optimized production builds. Content is written in Markdown with Vue component support. The tool generates SEO-friendly static HTML pages that hydrate into a single-page application on load. Configuration is done through a .vitepress/config.js file. Themes can be customized or replaced entirely. Built-in features include navigation, sidebar, search, and dark mode. VitePress is the spiritual successor to VuePress, rebuilt on top of Vite for improved performance. Install via npm: `npm add -D vitepress`
参数
- --host _host_
- Development server host (default: localhost).
- --port _port_
- Development server port (default: 5173).
- --base _path_
- Public base path.
- --cors
- Enable CORS.
- --strictPort
- Exit if port is in use.
- --force
- Force optimizer to ignore cache.
- --minify
- Enable minification (build only).
- --mpa
- Multi-page app mode.
- -h, --help
- Display help.
- -v, --version
- Display version.
FAQ
What is the vitepress command used for?
VitePress is a static site generator powered by Vite and Vue.js. It is designed for documentation websites, providing fast development experience with hot module replacement and optimized production builds. Content is written in Markdown with Vue component support. The tool generates SEO-friendly static HTML pages that hydrate into a single-page application on load. Configuration is done through a .vitepress/config.js file. Themes can be customized or replaced entirely. Built-in features include navigation, sidebar, search, and dark mode. VitePress is the spiritual successor to VuePress, rebuilt on top of Vite for improved performance. Install via npm: `npm add -D vitepress`
How do I run a basic vitepress example?
Run `vitepress dev [docs]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --host _host_ do in vitepress?
Development server host (default: localhost).