Frequently Asked Questions
Answers to common questions about VitePress.General Questions
What is VitePress?
What is VitePress?
- Lightning-fast development with Vite
- Vue 3 components in markdown
- Optimized static site generation
- Beautiful default theme
- Powerful theming capabilities
How is VitePress different from VuePress?
How is VitePress different from VuePress?
- Much faster development and build times (powered by Vite)
- Simpler, more streamlined architecture
- Better performance out of the box
- Modern Vue 3 and Composition API
- Lighter weight and fewer dependencies
- Need plugin ecosystem from VuePress v1
- Require backward compatibility
- Using VuePress-specific plugins
Is VitePress production-ready?
Is VitePress production-ready?
- Vue.js official documentation
- Vite documentation
- Vitest documentation
- Rollup documentation
- Many other open source projects
Can I migrate from VuePress to VitePress?
Can I migrate from VuePress to VitePress?
- Config format changes: VitePress uses a different config structure
- Markdown plugins: Some VuePress plugins need replacement
- Theme customization: Different theming approach
- Components: May need to update Vue 2 to Vue 3 syntax
- Significantly faster build times
- Better developer experience
- Modern architecture
- Active development
Installation & Setup
What are the system requirements?
What are the system requirements?
- Node.js v20 or higher
- pnpm, npm, or yarn package manager
- Node.js v20+ (latest LTS)
- pnpm for faster installs
- 4GB+ RAM for large sites
- SSD storage for better performance
How do I create a new VitePress site?
How do I create a new VitePress site?
Why use pnpm instead of npm or yarn?
Why use pnpm instead of npm or yarn?
- Faster installation (hard links instead of copying)
- Better disk space efficiency
- Stricter dependency resolution
- Used by VitePress development team
- npm (works fine, just slower)
- yarn (also supported)
Configuration
Where do I put the configuration file?
Where do I put the configuration file?
.vitepress/config.ts (or .js, .mts, .mjs) in your docs directory:How do I configure the navigation and sidebar?
How do I configure the navigation and sidebar?
Can I use environment variables in config?
Can I use environment variables in config?
Customization
How do I customize the theme?
How do I customize the theme?
.vitepress/theme/index.ts:.vitepress/theme/custom.css:Can I use Vue components in markdown?
Can I use Vue components in markdown?
.vitepress/theme/components/MyComponent.vue:.vitepress/theme/index.ts:How do I add custom CSS or scripts?
How do I add custom CSS or scripts?
.vitepress/theme/custom.css and import in .vitepress/theme/index.ts.Per-page via frontmatter:Content & Markdown
What markdown features are supported?
What markdown features are supported?
- Headers, lists, links, images
- Code blocks with syntax highlighting
- Tables, blockquotes
- Emphasis (bold, italic)
- GitHub-flavored alerts (Note, Warning, etc.)
- Code groups and line highlighting
- File imports and snippets
- Custom containers
- Emoji :tada:
- Table of contents
- Math equations (with plugin)
- Vue components in markdown
- Template syntax
- Script and style blocks
How do I highlight specific lines in code blocks?
How do I highlight specific lines in code blocks?
How do I create a custom home page?
How do I create a custom home page?
home layout in frontmatter:Search
How do I add search to my site?
How do I add search to my site?
How do I customize local search?
How do I customize local search?
Deployment
How do I deploy to GitHub Pages?
How do I deploy to GitHub Pages?
.github/workflows/deploy.yml:gh-pages branch.What are the recommended hosting options?
What are the recommended hosting options?
- Netlify (automatic builds from Git)
- Vercel (zero configuration)
- Cloudflare Pages (fast global CDN)
- GitHub Pages (free for public repos)
- GitLab Pages (free for all repos)
- AWS S3 + CloudFront
- Azure Static Web Apps
- Firebase Hosting
- Render
How do I handle base paths for deployment?
How do I handle base paths for deployment?
- GitHub Pages repo:
base: '/repo-name/' - Root domain:
base: '/'(default) - Subdirectory:
base: '/docs/'
Performance & Optimization
How can I improve build performance?
How can I improve build performance?
- Use lazy-loaded languages for Shiki
- Optimize images before adding to docs
- Split large pages into smaller ones
- Use dynamic imports for heavy components
Should I commit the dist folder?
Should I commit the dist folder?
docs/.vitepress/dist/.Add to .gitignore:gh-pages).Troubleshooting
Build is failing with TypeScript errors
Build is failing with TypeScript errors
- Vite 7 plugin compatibility: Use
@ts-expect-errorfor incompatible plugins - Missing types: Install
@types/node - Config errors: Check your
.vitepress/config.tssyntax
Styles are not applying correctly
Styles are not applying correctly
- CSS import order in theme
- Specificity issues with custom CSS
- CSS variables properly defined for dark mode
- Scoped vs global styles
404 errors on deployed site
404 errors on deployed site
- Wrong base path: Set correct
basein config - Case sensitivity: URLs are case-sensitive on most servers
- Missing trailing slashes: Some servers require
/path/instead of/path - SPA fallback: Configure server to serve
index.htmlfor unknown routes
- Verify
basematches deployment path - Use lowercase file names
- Configure server redirects/rewrites
Getting Help
Where can I get help?
Where can I get help?
- Documentation: vitepress.dev
- GitHub Issues: vuejs/vitepress/issues
- Discussions: vuejs/vitepress/discussions
- Discord: chat.vuejs.org
- Search existing issues and discussions
- Check the documentation
- Read this FAQ
- Prepare a minimal reproduction
How do I report a bug?
How do I report a bug?
- Clear title: Describe the issue concisely
- VitePress version: Run
npm list vitepress - Node.js version: Run
node -v - Reproduction: Minimal example or repository
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Steps to reproduce: Detailed steps
- Screenshots: If applicable