-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathvite.config.mjs
46 lines (45 loc) · 1.11 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
/// <reference types="vitest" />
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import liveReload from "vite-plugin-live-reload";
export default defineConfig(({ mode }) => ({
base: "/static/",
build: {
manifest: true,
rollupOptions: {
input: {
base: "assets/src/scripts/base.js",
builder: "assets/src/scripts/builder/index.jsx",
codelist: "assets/src/scripts/codelist.js",
tree: "assets/src/scripts/tree/index.jsx",
"codelists-version": "assets/src/scripts/codelists-version.js",
},
},
outDir: "assets/dist",
emptyOutDir: true,
},
server: {
origin: "http://localhost:5173",
},
clearScreen: false,
plugins: [
mode !== "test"
? liveReload(["templates/**/*.html", "assets/src/styles/base.css"], {
alwaysReload: true,
})
: undefined,
react(),
],
test: {
coverage: {
provider: "v8",
lines: 90,
functions: 90,
branches: 90,
statements: -10,
},
environment: "jsdom",
globals: true,
root: "./assets/src/scripts",
},
}));