Repo for VuePress 2
The codebase has been completely refactored with TypeScript. Some major changes:
@vuepress/clifrom
vuepresspackage
@vuepress/clientfrom
@vuepress/corepackage
@vuepress/bundler-webpackfrom
@vuepress/corepackage and migrate to webpack 5
@vuepress/plugin-palette-stylusfrom
@vuepress/corepackage - stylus is no longer the default CSS pre-processor, and the way of styles customization should be determined by theme
The documentation has not finished yet. For now you can check out the breaking changes list below as migration reference.
https://vuepress.github.io
See Contributing Guide.
Temporarily record some breaking changes here.
shouldPrefetch-> the default value is changed to
false
patterns->
pagePatterns
extraWatchFiles-> removed, watch files manually in
onWatchedhook
evergreen-> the default value is changed to
true
markdown
markdown.lineNumbers->
markdown.code.lineNumbers, and the default value is changed to
true
markdown.slugify-> removed
markdown.pageSuffix-> removed
markdown.externalLinks->
markdown.links.externalAttrs
markdown.toc-> changed
markdown.plugins-> removed
markdown.extendMarkdown-> removed
markdown.extractHeaders-> changed
bundlerConfig(with
@vuepress/bundler-webpack)
postcss->
bundlerConfig.postcss
stylus->
bundlerConfig.stylus
scss->
bundlerConfig.scss
sass->
bundlerConfig.sass
less->
bundlerConfig.less
chainWebpack->
bundlerConfig.chainWebpack
configureWebpack->
bundlerConfig.configureWebpack
.vuepress/enhanceApp.js->
.vuepress/clientAppEnhance.{js,ts}
.vuepress/components-> will not auto register components, and you need to register your components manually in
.vuepress/clientAppEnhance.{js,ts}
:i_month-> removed
:i_day-> removed
:minutes-> removed (undocumented in 1.0)
:seconds-> removed (undocumented in 1.0)
:regular->
:raw
The stylus palette system of Vuepress 1.0 (i.e.
styles/palette.styland
styles/index.styl) will only work in default theme.
To make the stylus palette system reusable, it's extracted to
@vuepress/plugin-palette-stylus.
Theme authors can use their own way for users to configure styles (not be limited with stylus).
meta->
head, which uses the same type with
siteConfig.head
For example:
head: - - meta - name: foo content: bar - - link - rel: canonical href: foobar - - script - {} - console.log('hello from frontmatter');
Has the same structure with:
// .vuepress/config.js module.exports = { // ... head: [ ['meta', { name: 'foo', content: 'bar' }], ['link', { rel: 'canonical', href: 'foobar' }], ['script', {}, `console.log('hello from frontmatter');`], ], // ... }
ready->
onPrepared
updated->
onWatched
generated->
onGenerated
additionalPages-> removed, use
app.pages.push(createPage())in
onInitializedhook
clientDynamicModules-> removed, use
app.writeTemp()in
onPreparedhook
enhanceAppFiles->
clientAppEnhanceFiles
globalUIComponents->
clientAppRootComponentFiles
clientRootMixin->
clientAppSetupFiles
extendMarkdown->
extendsMarkdown
chainMarkdown-> removed
extendPageData->
extendsPageData
extendsCli-> removed
configureWebpack-> removed
chainWebpack-> removed
beforeDevServer-> removed
afterDevServer-> removed
.vuepress/theme-> won't be used as theme implicitly if the path exists, and set the path explicitly via
themeoption.
extend->
extends
You can still inherit a parent theme with
extends: 'parent-theme', which will extends the plugins, layouts, etc.
However, the
@themeand
@parent-themealiases are not available now.
ejectcommand -> removed
-c, --cache [cache]->
--cache- the shorthand
-cis not for
cacheoption, and the value of
cacheoption is not optional
--no-cache->
--clean-cache
$badgeErrorColor->
$badgeDangerColor
typeprop only accepts
tip,
warningand
danger
docs/.vuepress/config.tsas reference