docs: use vitepress

This commit is contained in:
braks
2022-08-01 21:10:14 +02:00
committed by Braks
parent bd36253cd0
commit e6bef4a9f1
140 changed files with 8166 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { existsSync, readFileSync } from 'fs'
import { resolve } from 'path'
import type { Plugin } from 'vite'
export function copyVueFlowPlugin(): Plugin {
return {
name: 'copy-vue-flow',
generateBundle() {
const filePath = resolve(__dirname, '../../node_modules/@braks/vue-flow/dist/vue-flow.es.js')
if (!existsSync(filePath)) {
throw new Error(`@braks/vue-flow/dist/vue-flow.es.js not built. ` + `Run "pnpm -w build" first.`)
}
this.emitFile({
type: 'asset',
fileName: 'vue-flow.es.js',
source: readFileSync(filePath, 'utf-8'),
})
},
}
}