Ai
1 Star 6 Fork 0

陈博华/BohuaUI框架(组件库)

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 677 Bytes
一键复制 编辑 原始数据 按行查看 历史
陈博华 提交于 2022-01-17 16:09 +08:00 . 1.0.0
// @ts-nocheck
import fs from 'fs'
import {baseParse} from '@vue/compiler-core'
export default {
base: './',
assetsDir: 'assets',
vueCustomBlockTransforms: {
demo: (options) => {
const { path } = options
const file = fs.readFileSync(path).toString()
const parsed = baseParse(file).children.find(n => n.tag === 'demo')
const title = parsed.children[0].content
const main = file.split(parsed.loc.source).join('').trim()
return `export default function (Component) {
Component.__sourceCode = ${
JSON.stringify(main)
}
Component.__sourceCodeTitle = ${JSON.stringify(title)}
}`.trim()
}
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/cbh111/bohua-ui.git
git@gitee.com:cbh111/bohua-ui.git
cbh111
bohua-ui
BohuaUI框架(组件库)
master

搜索帮助