Skip to content

Start VitePress dev server using designated directory as root. Defaults to current directory. The dev command can also be omitted when running in current directory.

sh
# start in current directory, omitting `dev`
vitepress

# start in sub directory
vitepress dev [root]
OptionDescription
--open [path]Open browser on startup (boolean | string)
--port <port>Specify port (number)
--base <path>Public base path (default: /) (string)
--corsEnable CORS
--strictPortExit if specified port is already in use (boolean)
--forceForce the optimizer to ignore the cache and re-bundle (boolean)

Build the VitePress site for production.

sh
vitepress build [root]
OptionDescription
--mpa (experimental)Build in MPA mode without client-side hydration (boolean)
--base <path>Public base path (default: /) (string)
--target <target>Transpile target (default: "modules") (string)
--outDir <dir>Output directory relative to cwd (default: <root>/.vitepress/dist) (string)
--minify [minifier]Enable/disable minification, or specify minifier to use (default: "esbuild") (boolean | "terser" | "esbuild")
--assetsInlineLimit <number>Static asset base64 inline threshold in bytes (default: 4096) (number)

Locally preview the production build.

sh
vitepress preview [root]
OptionDescription
--base <path>Public base path (default: /) (string)
--port <port>Specify port (number)

Start the Setup Wizard in current directory.

sh
vitepress init

Released under the MIT License.