-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mjs
56 lines (55 loc) · 1.5 KB
/
vite.config.mjs
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
import { codecovVitePlugin } from "@codecov/vite-plugin";
import path from "path";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
export default defineConfig({
base: "./",
plugins: [
dts(),
codecovVitePlugin({
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
bundleName: "@smallstack/utils",
uploadToken: process.env.CODECOV_TOKEN,
}),
],
build: {
lib: {
name: "@smallstack/utils",
entry: {
main: path.resolve(__dirname, "lib/main.ts"),
string: path.resolve(__dirname, "lib/modules/string/index.ts"),
number: path.resolve(__dirname, "lib/modules/number/index.ts"),
object: path.resolve(__dirname, "lib/modules/object/index.ts"),
},
fileName: (format, entryName) => {
if (format === "cjs") return `utils.${entryName}.cjs`;
return `utils.${entryName}.${format}.js`;
},
},
},
test: {
globals: true,
environment: "node",
include: ["lib/**/*.test.ts"],
reporters: ["default", "junit"],
outputFile: { junit: "test-results/junit.xml" },
coverage: {
provider: "v8",
include: ["lib/**"],
exclude: [
"node_modules/**",
"lib/main.ts",
"lib/**/index.ts",
"lib/**/*.test.ts",
],
reporter: ["lcov", "clover", "text-summary"],
reportsDirectory: "coverage",
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
},
});