Skip to main content

Migration Guide

This guide will help you migrate your VitePress site from v1.x to v2.x (currently in alpha).

Overview

VitePress v2.0 brings significant improvements including Vite 7 support, Shiki v3 integration, and performance enhancements. While most changes are backwards compatible, there are several breaking changes to be aware of.
VitePress v2.0 is currently in alpha (v2.0.0-alpha.16). Test thoroughly before deploying to production.

Breaking Changes

New Features

Take advantage of these new features in v2:

Vite 7 Performance

Faster build times and improved development experience with Vite 7.

Shiki v3 Highlighting

Better syntax highlighting with lazy-loaded languages and improved performance.

Async Markdown Rendering

More powerful markdown processing with async support.

Enhanced DocSearch

DocSearch v4 with sidepanel and AI-powered search (beta).

CJK-Friendly Emphasis

Enabled by default for better CJK language support:

Distributed Config Files

Support for multiple config files across your project:

Custom Display Names for Code Blocks

Testing Your Migration

Troubleshooting

Vite 7 may cause type mismatches with some plugins. Solutions:
Or suppress with as any and report to plugin repository.
If your code block styles aren’t working:
  1. Replace .vp-code with .shiki
  2. Check for vp-adaptive-theme class usage
  3. Use pre.shiki or [class*='language-'] pre selectors
DocSearch v4 changed class names and structure:
  1. Review custom DocSearch CSS
  2. Update selectors for navbar search button
  3. Update modal styles
  4. Test on mobile viewports
This happens with custom content renderers:

Rollback Instructions

If you need to rollback to v1.x:
Then run:

Getting Help

For the latest breaking changes and migration notes, always check the official changelog.