-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
41 lines (40 loc) · 979 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { defineConfig } from "vite";
import { resolve } from "path";
import copy from "rollup-plugin-copy";
import dts from "vite-plugin-dts";
import vue from "@vitejs/plugin-vue";
import libInjectCss from "./libInjectCss";
export default defineConfig({
plugins: [
dts({
include: "src/*.d.ts",
}),
copy({
targets: [{ src: "./src/index.d.ts", dest: "./dist" }],
}),
vue(),
{
name: "copy-index-dts",
writeBundle: async () => {
const { promises } = require("fs");
await promises.copyFile("./src/index.d.ts", "./dist/index.d.ts");
},
},
// https://github.com/vitejs/vite/issues/4345
// chenyueban
// libInjectCss(),
],
build: {
lib: {
entry: resolve(__dirname, "src/index.ts"),
name: "VueFormGenerator",
fileName: (format) => `index.${format}.js`,
},
rollupOptions: {
external: ["vue"],
output: {
exports: "named",
},
},
},
});