-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
vite.config.ts
38 lines (37 loc) · 883 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
import { fileURLToPath, URL } from "node:url";
import path from "node:path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import dts from "vite-plugin-dts";
export default defineConfig({
plugins: [
vue(),
dts({
insertTypesEntry: true,
include: ["src/components/InfiniteLoading.vue", "src/types.ts"],
}),
],
build: {
outDir: "lib",
rollupOptions: {
external: ["vue"],
output: {
exports: "named",
globals: {
vue: "Vue",
},
},
},
lib: {
entry: path.resolve(__dirname, "src/components/InfiniteLoading.vue"),
name: "V3InfiniteLoading",
fileName: format => `v3-infinite-loading.${format}.js`,
formats: ["es", "umd"],
},
},
resolve: {
alias: {
"@root": fileURLToPath(new URL("./src", import.meta.url)),
},
},
});