-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathvite.config.ts
More file actions
82 lines (77 loc) · 2.14 KB
/
Copy pathvite.config.ts
File metadata and controls
82 lines (77 loc) · 2.14 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { defineConfig } from "vite";
import checker from "vite-plugin-checker";
import react from "@vitejs/plugin-react";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import svgr from "vite-plugin-svgr";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
base: "/typey-type",
build: {
cssMinify: "esbuild",
sourcemap: true,
outDir: "build",
},
test: {
dir: "src",
environment: "jsdom",
setupFiles: "./src/setupTests.ts",
globals: true,
typecheck: {
enabled: true,
},
tags: [
{
name: "ui",
description: "Tests written for UI, e.g. using Testing Library.",
},
{
name: "unit",
description: "Tests written for TS logic.",
},
],
},
resolve: {
tsconfigPaths: true,
},
plugins: [
!process.env.VITEST
? checker({
typescript: true,
eslint: {
// This should match `package.json` lint script:
lintCommand: "eslint 'src/**/*.{js,jsx,ts,tsx}'",
watchPath: "src",
useFlatConfig: true,
},
overlay: {
initialIsOpen: false,
},
})
: undefined,
react(),
// svgr options: https://react-svgr.com/docs/options/
// svgr({ svgrOptions: { icon: true } }),
svgr(),
// Put the Sentry vite plugin after all other plugins
!process.env.TYPEY_TYPE_RELEASE
? undefined
: sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: "di-does-digital",
project: "typey-type-for-stenographers",
telemetry: false,
release: {
name: process.env.TYPEY_TYPE_RELEASE,
deploy: {
env: mode,
},
},
// Enable debug information logs during build-time. Defaults to false.
debug: false,
// Completely disables all functionality of the plugin. Defaults to false.
disable: false,
}),
],
};
});