-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathvite.config.mjs
61 lines (60 loc) · 1.82 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
57
58
59
60
61
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import liveReload from "vite-plugin-live-reload";
import { viteStaticCopy } from "vite-plugin-static-copy";
export default defineConfig(({ mode }) => ({
base: "/static/",
build: {
manifest: true,
rollupOptions: {
input: {
"analysis-request-detail":
"./assets/src/scripts/analysis-request-detail.js",
"application-form": "./assets/src/scripts/application-form.js",
"outputs-viewer": "./assets/src/scripts/outputs-viewer/index.jsx",
"sign-off-repo": "./assets/src/scripts/sign-off-repo.js",
"staff-base": "./assets/src/scripts/staff-base.js",
base: "./assets/src/scripts/base.js",
components: "./assets/src/scripts/components.js",
interactive: "assets/src/scripts/interactive/main.jsx",
job_request_create: "./assets/src/scripts/job_request_create.js",
multiselect: "./templates/_components/multiselect/multiselect.js",
workspace_create: "./assets/src/scripts/workspace_create.js",
},
},
outDir: "assets/dist",
emptyOutDir: true,
},
server: {
origin: "http://localhost:5173",
},
clearScreen: false,
plugins: [
mode !== "test" ? liveReload("templates/**/*.html") : undefined,
mode !== "test"
? viteStaticCopy({
targets: [
{
src: "node_modules/htmx.org/dist/htmx.min.js",
dest: "vendor",
},
],
})
: undefined,
react(),
],
test: {
env: "test",
globals: true,
environment: "jsdom",
root: "./assets/src/scripts/outputs-viewer/",
setupFiles: ["__tests__/test-setup.js"],
coverage: {
provider: "v8",
lines: 90,
functions: 90,
branches: 90,
statements: -10,
},
},
}));