Project Command
Less than 1 minute
This tutorial introduces VuePress project commands.
Common Commands
vuepress dev [dir]
will start a development server to allow you to develop your VuePress site locally.vuepress build [dir]
will build your VuePress site into static files for your subsequent deployment.
Using Template
If you are using the VuePress Theme Hope template, you can find the following three commands in package.json
:
{
"scripts": {
"docs:build": "vuepress build src",
"docs:clean-dev": "vuepress dev src --clean-cache",
"docs:dev": "vuepress dev src"
}
}
This means you can use:
pnpm
pnpm docs:dev
starts the development serverpnpm docs:build
builds the project and outputspnpm docs:clean-dev
to clear cache and start development server
yarn
yarn docs:dev
starts the development serveryarn docs:build
builds the project and outputsyarn docs:clean-dev
to clear cache and start development server
npm
npm run docs:dev
starts the development servernpm run docs:build
builds the project and outputsnpm run docs:clean-dev
to clear cache and start development server
Terminate DevServer
To terminate the development server, please click on the terminal and press Ctrl + C
twice.
Update Version
If you need to upgrade your theme and VuePress version, execute the following command:
pnpm
pnpm dlx vp-update
yarn
yarn dlx vp-update
npm
npx vp-update