: dts 文件生成

*dts 生成
*tag自动计算颜色
This commit is contained in:
sight
2022-09-15 00:53:26 +08:00
parent 007b94914a
commit 0db18d8a86
9 changed files with 172 additions and 150 deletions

View File

@@ -1,7 +1,8 @@
import { UserConfigExport } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { resolve } from "path";
import dts from "vite-plugin-dts";
import path, { resolve } from "path";
export default (): UserConfigExport => {
return {
@@ -14,7 +15,26 @@ export default (): UserConfigExport => {
},
],
},
plugins: [vue(), vueJsx()],
plugins: [
vue(),
vueJsx(),
dts({
outputDir: ["types"],
insertTypesEntry: true,
cleanVueFileName: true,
copyDtsFiles: true,
include: ["src"],
beforeWriteFile: (filePath: string, content: string) => {
return {
filePath: filePath.replace(
`${path.sep}package${path.sep}component${path.sep}src`,
""
),
content: content,
};
},
}),
],
build: {
cssCodeSplit: false,
outDir: "lib",