pull/1/head
Evan You 5 years ago
parent 1209e7cc00
commit 47bddf6ac6

@ -1,7 +1,3 @@
## Problems to Fix
# (WIP) vitepress 📝💨
- Should not require vue-router
- Should not require chunk metadata for each page
- Should only inline site metadata that is used in runtime code (detect via proxy created with `useSiteData()`)
- Should use stringified site metadata
- i18n data should be fetched on demand
> [VuePress](http://vuepress.vuejs.org/)' little brother, built on top of [vite](https://github.com/vuejs/vite)

@ -24,7 +24,9 @@ const VitePressPlugin: Plugin = ({ app, root, watcher, resolver }) => {
}
})
// inject Koa middleware
app.use(async (ctx, next) => {
// handle .md -> vue transforms
if (ctx.path.endsWith('.md')) {
const file = resolver.publicToFile(ctx.path)
await cachedRead(ctx, file)
@ -35,7 +37,7 @@ const VitePressPlugin: Plugin = ({ app, root, watcher, resolver }) => {
return next()
}
// detect and serve vitepress files
// detect and serve vitepress @app / @theme files
const file = VitePressResolver.publicToFile(ctx.path, root)
if (file) {
ctx.type = path.extname(file)

Loading…
Cancel
Save