-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.ts
50 lines (49 loc) · 1.11 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
import { resolve } from "path";
import dts from "vite-plugin-dts";
import tsConfigPaths from "vite-tsconfig-paths";
import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [
tsConfigPaths(),
dts({
include: ["src"],
}),
],
build: {
sourcemap: true,
lib: {
entry: resolve("src", "main.ts"),
name: "vite-plugin-scope-tailwind",
formats: ["es", "cjs"],
fileName: (format) => {
switch (format) {
case "es":
return `${format}/index.mjs`;
case "cjs":
return `${format}/index.cjs`;
default:
return "index.js";
}
},
},
rollupOptions: {
external: ["fs", "path"],
},
},
test: {
globals: true,
coverage: {
provider: "v8",
reportsDirectory: "coverage",
enabled: true,
reporter: ["text", "cobertura", "html"],
statements: 91.21,
branches: 95.55,
functions: 91.66,
lines: 91.21,
exclude: ["**/src/test/**", "**/*.test.{ts,tsx}"],
},
reporters: ["default"],
testTimeout: 60000,
},
});