-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
50 lines (47 loc) · 1.31 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 { sentryVitePlugin } from "@sentry/vite-plugin"
import vue from "@vitejs/plugin-vue"
import { fileURLToPath, URL } from "node:url"
import icons from "unplugin-icons/vite"
import { defineConfig } from "vite"
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
const enableSentry = mode === "production" && process.env.SENTRY_AUTH_TOKEN
console.info(
`Sentry plugin is ${enableSentry ? "enabled" : "disabled"} in ${mode} mode`,
)
return {
build: {
sourcemap: true,
target: ["edge127", "firefox115", "chrome127"],
},
plugins: [
vue(),
icons({
scale: 1.3333, // ~24px at the current default font size of 18px
compiler: "vue3",
}),
enableSentry &&
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "digitalservice",
project: "ris-norms",
telemetry: process.env.VITEST !== "true",
}),
],
server: {
proxy: {
"^/(api|oauth2|login|logout)": {
target: "http://localhost:8080",
changeOrigin: true,
secure: false,
},
},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
"@e2e": fileURLToPath(new URL("./e2e", import.meta.url)),
},
},
}
})