VuePress VS VitePress #1281
Pinned
Mister-Hope
started this conversation in
General
Replies: 1 comment 1 reply
-
VuePress v1 site will upgrade to VuePress v2 or VitePress? I'm in trouble now. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Target
VuePress is more likely to be a complete static site generator. It supports different bundlers (currently both Webpack and Vite) as well as plugins and themes.
VuePress's plugin and theme APIs allow developers to extract any standalone feature into a package, any users can import them easily in projects. Through API Users / Plugins / Themes can make customizations easily, such as modifying markdown parser / bundler options/ site config, generating temp files, adding alias, etc.
VitePress is more likely to be a modified Vite that has a built-in theme and supports converting markdown with Vue syntax support to a web page
VitePress has no plugin or theme system, besides options it provides, simple features could be done by writing Vite plugins.
Start up, dealing pages and resolving routes
VuePress has a initialize/prepare stage, it will read all page contents from project folder markdown files, and convert them to
Page
objects, any markdown content will be converted to Vue component, then VuePress process page data with hooks in plugin APIs, later it write page data/components to temp folder, VuePress holds thesePage
objects inapp.pages
in all time so it can be accessed in API hooks.VuePress generates routes from page objects and uses standard
vue-router
package, and you can inject additional information about pages in routeMeta to access it globally (How we support blogging). This also means that all page routes and a full <URL to chunk path> map is injected to client.VitePress starts an application immediately by loading theme entry. (Just like a Vue project using Vite)
VitePress uses a custom router that loads markdown files directly.
The above means VitePress doesn't know how many pages and their path at all, it can only load a page if its path is provided. So:
SSG (Rendering static pages)
VuePress render pages one by one during SSG by loading page data from map. All page objects are still on
app.pages
because it should be accessible inonGenerated
hook. (Why it takes a lot of memory)VitePress can render pages parallel during SSG. And only one page of data is needed besides the application itself. (Why it's fast and take little memory here)
Beta Was this translation helpful? Give feedback.
All reactions