← 返回命令列表

Linux command

vuepress 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start development server

vuepress dev [docs]

Build static site

vuepress build [docs]

Start dev server

vuepress dev [docs] --port [3000]

Build with debugging output

vuepress build [docs] --debug

Build to a custom output directory

vuepress build [docs] --dest [dist]

Show environment information

vuepress info

说明

VuePress is a Vue-powered static site generator designed for creating documentation websites. It compiles Markdown files into a single-page application (SPA) with pre-rendered static HTML for each page, combining SEO benefits with SPA navigation. VuePress allows using Vue components directly in Markdown files, enabling interactive documentation. It comes with a default theme optimized for technical documentation, including features like sidebar navigation, search, and automatic header anchors. The development server provides hot module reloading for both Markdown content and Vue components. For production, the build command generates optimized static files that can be deployed to any static hosting service. Configuration is done through a .vuepress/config.js or .vuepress/config.ts file in the source directory, controlling theme, plugins, navigation, and site metadata. CLI options override config file settings with the same name.

参数

dev _sourceDir_
Start a development server with hot-reloading. Default target is current directory.
build _sourceDir_
Build the site as static HTML files for deployment.
info
Display information about the system and dependencies.
-c, --config _file_
Set path to config file.
-p, --port _port_
Specify the port for the development server (default: 8080). Dev only.
--host _host_
Specify the host for the development server (default: 0.0.0.0). Dev only.
-d, --dest _dir_
Set the output directory for build (default: .vuepress/dist). Build only.
-t, --temp _dir_
Set the directory for temporary files.
--cache _dir_
Set the directory for cache files.
--debug
Enable debug mode with verbose output.
--clean-temp
Clean temporary files before dev or build.
--clean-cache
Clean cache files before dev or build.
--open
Open browser when ready. Dev only.
--no-watch
Disable watching page and config files. Dev only.
--help
Display help for a command.

FAQ

What is the vuepress command used for?

VuePress is a Vue-powered static site generator designed for creating documentation websites. It compiles Markdown files into a single-page application (SPA) with pre-rendered static HTML for each page, combining SEO benefits with SPA navigation. VuePress allows using Vue components directly in Markdown files, enabling interactive documentation. It comes with a default theme optimized for technical documentation, including features like sidebar navigation, search, and automatic header anchors. The development server provides hot module reloading for both Markdown content and Vue components. For production, the build command generates optimized static files that can be deployed to any static hosting service. Configuration is done through a .vuepress/config.js or .vuepress/config.ts file in the source directory, controlling theme, plugins, navigation, and site metadata. CLI options override config file settings with the same name.

How do I run a basic vuepress example?

Run `vuepress dev [docs]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does dev _sourceDir_ do in vuepress?

Start a development server with hot-reloading. Default target is current directory.