blog-vue/vite.config.ts

40 lines
787 B
TypeScript

import { fileURLToPath, URL } from 'node:url'
import Vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages'
import Markdown from 'unplugin-vue-markdown/vite'
import mk from '@vscode/markdown-it-katex'
export default {
plugins: [
Vue({
include: [/\.vue$/, /\.md$/],
}),
Pages(),
Markdown({
excerpt: true,
frontmatterOptions: {
grayMatterOptions: {
excerpt: true,
excerpt_separator: '<!--more-->',
},
},
headEnabled: true,
markdownItSetup(md) {
// @ts-ignore
md.use(mk.default)
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
esbuild: {
supported: {
'top-level-await': true
},
}
}