English
Config
Site Config
base
Type:
stringDefault:
/Details:
The base URL the site will be deployed at.
You will need to set this if you plan to deploy your site under a sub path. It should always start and end with a slash. For example, if you plan to deploy your site to GitHub pages at
https://foo.github.io/bar/, then you should setbaseto"/bar/".The
baseis automatically prepended to the URLs that start with/in other options, so you only need to specify it once. (Except for attrs of head)Notice that
baseshould be an absolute URL pathname starting and ending with/.Also see:
lang
Type:
stringDefault:
en-USDetails:
Language for the site.
This will be the
langattribute of the<html>tag in the rendered HTML.This can be specified in different locales.
Also see:
title
Type:
stringDefault:
''Details:
Title for the site.
This will be the suffix for all page titles, and displayed in the navbar in the default theme.
This can be specified in different locales.
Also see:
description
Type:
stringDefault:
''Details:
Description for the site.
This will be the
contentattribute of<meta name="description" />tag in the rendered HTML, which will be overrode by thedescriptionfield of page frontmatter.This can be specified in different locales.
Also see:
head
Type:
HeadConfig[]Default:
[]Details:
Extra tags to inject into the
<head>tag in the rendered HTML.You can specify each tag in the form of
[tagName, { attrName: attrValue }, innerHTML?].This can be specified in different locales.
Notice that if the
attrValueis a pathname, it will be kept as-is without prepending base automatically, so remember to prepend it manually if needed.Example:
To add a custom favicon:
export default {
head: [['link', { rel: 'icon', href: '/images/logo.png' }]],
}Rendered as:
<head>
<link rel="icon" href="/images/logo.png" />
</head>- Also see:
locales
Type:
{ [path: string]: Partial<SiteLocaleData> }Default:
{}Details:
Specify locales for i18n support.
Acceptable fields:
Also see:
Theme Config
theme
Type:
ThemeDetails:
Set the theme of your site.
If this option is not set, the default theme will be used.
Also see:
Bundler Config
bundler
Type:
BundlerDetails:
Set the bundler of your site.
This option is required.
vuepress-viteandvuepress-webpackare CLI shorthands that inject a default bundler (Vite and Webpack respectively). When you run the plainvuepresscommand, you need to set this option yourself, for examplebundler: viteBundler().There is no
vuepress-rspackshorthand. To use Rspack, install@vuepress/bundler-rspackand setbundler: rspackBundler().Also see:
Common Config
source
Type:
stringDetails:
The absolute path of the site source directory.
This option is required when using
@vuepress/coreprogrammatically. The CLI sets it to the directory passed to the command automatically, so you usually don't need to configure it in your config file.
dest
Type:
stringDefault:
`${sourceDir}/.vuepress/dist`Details:
Specify the output directory for
vuepress buildcommand.
temp
Type:
stringDefault:
`${sourceDir}/.vuepress/.temp`Details:
Specify the directory for temporary files.
Warning
Since VuePress will load temp files during dev and build, the temp directory should be inside project root to resolve dependencies correctly.
cache
Type:
stringDefault:
`${sourceDir}/.vuepress/.cache`Details:
Specify the directory for cache files.
public
Type:
stringDefault:
`${sourceDir}/.vuepress/public`Details:
Specify the directory for public files.
Also see:
debug
Type:
booleanDefault:
falseDetails:
Enable debug mode or not.
This would be helpful for developers. Also, we are using debug package for debug logging, which can be enabled via
DEBUG=vuepress*environment variable.
pagePatterns
Type:
string[]Default:
['**/*.md', '!.vuepress', '!node_modules']Details:
Specify the patterns of files you want to be resolved as pages. The patterns are relative to the source directory.
permalinkPattern
Type:
string | nullDefault:
nullDetails:
Specify the pattern to generate permalink.
This will be overrode by the
permalinkPatternfield of page frontmatter.Also see:
userStyle
Type:
string | nullDefault:
nullDetails:
Specify the path of a custom style file, which will be injected at the bottom of the client.
Themes can also set this option, but user config takes precedence over theme config.
Dev Config
host
Type:
stringDefault:
'0.0.0.0'Details:
Specify the host to use for the dev server.
port
Type:
numberDefault:
8080Details:
Specify the port to use for the dev server.
open
Type:
booleanDefault:
falseDetails:
Whether to open the browser after dev-server had been started.
templateDev
Type:
stringDefault:
'@vuepress/client/templates/dev.html'Details:
Specify the path of the HTML template to be used for dev.
Build Config
shouldPreload
Type:
boolean | ((file: string, type: string) => boolean)Default:
trueDetails:
A function to control what files should have
<link rel="preload">resource hints generated. Set totrueorfalseto enable or disable totally.By default, only those files that are required by current page will be preloaded. So you can keep it
truein most cases.
shouldPrefetch
Type:
boolean | 'as-needed' | ((file: string, type: string) => boolean)Default:
'as-needed'Details:
Controls which files get
<link rel="prefetch">resource hints.'as-needed'(default since v2.0.0-rc.32): only prefetch async resources of pages that are linked from the current page's Markdown content. This keeps the number of hints low on large sites.true: prefetch async files of all other pages. This is good for small sites, which will speed up the navigation, but it might not be a good idea if you have lots of pages in your site.false: disable prefetch hints entirely.- A function: return whether a file should be prefetched; it receives the file path and the resource type as arguments.
The default was
truein earlier 2.0.0-rc releases. Set it totrueexplicitly to restore the previous behavior.
templateBuild
Type:
stringDefault:
'@vuepress/client/templates/build.html'Details:
Specify the path of the HTML template to be used for build.
templateBuildRenderer
Type:
TemplateRendererDefault:
templateRendererDetails:
Specify the HTML template renderer to be used for build.
Markdown Config
markdown
Type:
MarkdownOptionsDefault:
{}Details:
Configure VuePress built-in Markdown syntax extensions.
It accepts all options of markdown-it, and the following additional options.
Since v2.0.0-rc.32, VuePress uses markdown-it v15 and
@mdit-vuev4. markdown-it ships its own type declarations (do not install@types/markdown-it), deep imports frommarkdown-it/lib/*are no longer supported, andMarkdownItEnvhas been removed in favor of augmentingmarkdown-it.Env. See Plugin API > extendsMarkdown for migration details. Thecodeoption has been removed as well; see markdown.code.Also see:
markdown.anchor
Type:
AnchorPluginOptions | falseDefault:
const defaultOptions = {
level: [1, 2, 3, 4, 5, 6],
permalink: anchorPlugin.permalink.headerLink({
class: 'header-anchor',
safariReaderFix: true,
}),
}Details:
Options for markdown-it-anchor.
Set to
falseto disable this plugin.Also see:
markdown.assets
Type:
AssetsPluginOptions | falseDetails:
Options for VuePress built-in markdown-it assets plugin.
Set to
falseto disable this plugin.
Caution
You should not configure it unless you understand what it is for.
markdown.assets.aliasSupport
Type:
boolean | '@-prefix'Default:
trueDetails:
Use aliases for non-strict relative paths.
This is a path that does not start with
./or../or/or<protocol header>:<img src="path1/path2.png" />- If the option is
true.path1is regarded as an alias. - If the option is
false. It is regarded as a relative path. - If the option is
"@-prefix". If the path starts with@,path1is regarded as an alias; Otherwise, it is regarded as a relative path.
- If the option is
markdown.assets.absolutePathPrependBase
Type:
booleanDefault:
truewhen using the Webpack or Rspack bundler,falsewhen using ViteDetails:
Whether to prepend base to absolute paths in Markdown.
VuePress sets the default according to
bundler.type: the Webpack and Rspack bundlers need it because they don't handlebasefor public files themselves, while Vite handlesbasefor public files automatically. You should not configure it unless you know the asset paths have already been processed.
markdown.code
Type:
neverDetails:
This option has been removed.
Code block syntax highlighting is not built in. Use @vuepress/plugin-prismjs or @vuepress/plugin-shiki instead. See Guide > Markdown > Syntax Extensions > Code Blocks and Migration > For Users.
markdown.component
Type:
falseDetails:
Options for @mdit-vue/plugin-component.
Set to
falseto disable this plugin.
Caution
You should not configure it unless you understand what it is for.
markdown.emoji
Type:
EmojiPluginOptions | falseDetails:
Options for markdown-it-emoji.
Set to
falseto disable this plugin.Also see:
markdown.frontmatter
Type:
FrontmatterPluginOptions | falseDetails:
Options for @mdit-vue/plugin-frontmatter.
Set to
falseto disable this plugin.Also see:
Caution
You should not configure it unless you understand what it is for.
markdown.headers
Type:
HeadersPluginOptions | falseDefault:
const defaultOptions = {
level: [2, 3],
}Details:
Options for @mdit-vue/plugin-headers.
Set to
falseto disable this plugin.Also see:
markdown.importCode
Type:
ImportCodePluginOptions | falseDetails:
Options for VuePress built-in markdown-it import-code plugin.
Set to
falseto disable this plugin.Also see:
markdown.importCode.handleImportPath
Type:
(str: string) => stringDefault:
(str) => strDetails:
A function to handle the import path of the import code syntax.
markdown.links
Type:
LinksPluginOptions | falseDetails:
Options for VuePress built-in markdown-it links plugin.
It will convert the tag of internal links to internalTag, and add extra attributes and icon to external links.
Set to
falseto disable this plugin.Also see:
markdown.links.internalTag
Type:
'a' | 'RouteLink' | 'RouterLink'Default:
'RouteLink'Details:
Tag for internal links.
By default, this plugin will transform internal links to RouteLink.
markdown.links.externalAttrs
Type:
Record<string, string>Default:
{ target: '_blank', rel: 'noopener noreferrer' }Details:
Additional attributes for external links.
markdown.sfc
Type:
SfcPluginOptions | falseDetails:
Options for @mdit-vue/plugin-sfc.
Set to
falseto disable this plugin.Also see:
Caution
You should not configure it unless you understand what it is for.
markdown.slugify
Type:
(str: string) => stringDetails:
The default slugify function.
markdown.title
Type:
falseDetails:
Options for @mdit-vue/plugin-title.
Set to
falseto disable this plugin.
Caution
You should not configure it unless you understand what it is for.
markdown.toc
Type:
TocPluginOptions | falseDefault:
const defaultOptions = {
level: [2, 3],
}Details:
Options for @mdit-vue/plugin-toc.
Set to
falseto disable this plugin.Also see:
markdown.vPre
Type:
VPrePluginOptions | falseDetails:
Options for VuePress built-in markdown-it v-pre plugin.
Set to
falseto disable this plugin.
markdown.vPre.block
Type:
booleanDefault:
trueDetails:
Add
v-predirective to<pre>tag of code block or not.Also see:
markdown.vPre.inline
Type:
booleanDefault:
trueDetails:
Add
v-predirective to<code>tag of inline code or not.Also see:
Plugin Config
plugins
Type:
(Plugin | Plugin[])[]Details:
Plugins to use.
This option accepts an array, each item of which could be a plugin or an array of plugins.
Also see:
Plugin API
User config file also works as a VuePress plugin, so all of the Plugin APIs are available except the name and multiple options.
Please check out Plugin API Reference for a full list of Plugin APIs.
