-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
36 lines (32 loc) · 945 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
import * as react from "@vitejs/plugin-react";
import { defineConfig, mergeConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig as defineTestConfig } from "vitest/config";
import { compilerOptions } from "./tsconfig.json";
const { outDir } = compilerOptions;
const { PORT = "3000" } = process.env;
const baseConfig = defineConfig({
plugins: [react.default(), tsconfigPaths()],
server: { port: Number(PORT) },
build: {
outDir,
emptyOutDir: true,
},
});
const testConfig = defineTestConfig({
test: {
coverage: {
all: true,
clean: true,
cleanOnRerun: true,
reportsDirectory: "coverage",
reporter: ["lcov", "html", "text"],
include: ["src"],
},
env: { NODE_ENV: "test" },
environment: "jsdom",
passWithNoTests: true,
setupFiles: ["./tests/__setup/vitest.setup.ts"],
},
});
export default mergeConfig(baseConfig, testConfig);