-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
61 lines (55 loc) · 1.09 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/// <reference types="vitest" />
import { defineConfig } from "vite";
import path from "path";
import Vue from "@vitejs/plugin-vue";
import VueJsx from "@vitejs/plugin-vue-jsx";
import Unocss from 'unocss/vite';
export default defineConfig(({ mode }) => ({
root: mode === "development" ? "./examples" : ".",
resolve: {
alias: {
"@": path.resolve(__dirname, ".", "src"),
},
},
plugins: [
Vue(),
VueJsx(),
Unocss()
],
build: {
minify: "esbuild",
cssCodeSplit: true,
lib: {
entry: "./src/index.ts",
name: "KunUI",
fileName: "kun-ui",
formats: ["es", "umd"],
},
rollupOptions: {
external: ["vue"],
output: {
globals: {
vue: "vue",
},
assetFileNames: "style.css",
exports: 'named'
}
}
},
test: {
// 这里root没有效果
// root: '.',
include: ["src/**/*.spec.ts"],
globals: true,
environment: "happy-dom",
transformMode: {
web: [/.[tj]sx$/],
},
coverage: {
reporter: ["json"]
}
},
server: {
port: 8000
}
}));