The codebase has been completely refactored with TypeScript. Some major changes:
- Fully migrated to Vue 3
- Extract
@vuepress/clifromvuepresspackage - Extract
@vuepress/clientfrom@vuepress/corepackage - Extract
@vuepress/bundler-webpackfrom@vuepress/corepackage and migrate to webpack 5- As webpack is decoupled with core, other bundlers are also possible to be supported
- Extract
@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.
See Contributing Guide.
-
@vuepress/markdown
- snippetsPlugin
-
Documentation
- Guide
- References
- API
- Migration Guide
Temporarily record some breaking changes here.
shouldPrefetch-> the default value is changed tofalsepatterns->pagePatternsextraWatchFiles-> removed, watch files manually inonWatchedhookevergreen-> the default value is changed totruemarkdownmarkdown.lineNumbers->markdown.code.lineNumbers, and the default value is changed totruemarkdown.slugify-> removedmarkdown.pageSuffix-> removedmarkdown.externalLinks->markdown.links.externalAttrsmarkdown.toc-> changedmarkdown.plugins-> removedmarkdown.extendMarkdown-> removedmarkdown.extractHeaders-> changed
- All webpack related configs are moved to
bundlerConfig(with@vuepress/bundler-webpack)postcss->bundlerConfig.postcssstylus->bundlerConfig.stylusscss->bundlerConfig.scsssass->bundlerConfig.sassless->bundlerConfig.lesschainWebpack->bundlerConfig.chainWebpackconfigureWebpack->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.styl and 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 withsiteConfig.headFor 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->onPreparedupdated->onWatchedgenerated->onGeneratedadditionalPages-> removed, useapp.pages.push(createPage())inonInitializedhookclientDynamicModules-> removed, useapp.writeTemp()inonPreparedhookenhanceAppFiles->clientAppEnhanceFilesglobalUIComponents->clientAppRootComponentFilesclientRootMixin->clientAppSetupFilesextendMarkdown->extendsMarkdownchainMarkdown-> removedextendPageData->extendsPageDataextendsCli-> removedconfigureWebpack-> removedchainWebpack-> removedbeforeDevServer-> removedafterDevServer-> removed
-
.vuepress/theme-> won't be used as theme implicitly if the path exists, and set the path explicitly viathemeoption. -
extend->extendsYou 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 <cache>- the shorthand-cis not forcacheoption, and the value ofcacheoption is not optional--no-cache->--clean-cache
<CodeGroup />,<CodeBlock />-><CodeGroup />,<CodeGroupItem /><Badge />$badgeErrorColor->$badgeDangerColortypeprop only acceptstip,warninganddanger
- Default theme config has changed a lot. Please checkout the types definition and our
docs/.vuepress/config.tsas reference