-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (59 loc) · 1.66 KB
/
vite.config.ts
File metadata and controls
60 lines (59 loc) · 1.66 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
import { reactRouter } from "@react-router/dev/vite";
import {
type SentryReactRouterBuildOptions,
sentryReactRouter,
} from "@sentry/react-router";
import tailwindcss from "@tailwindcss/vite";
import { type PluginOption, defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig((config) => {
const sentryConfig: SentryReactRouterBuildOptions = {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
};
let plugins: PluginOption[] = [tailwindcss(), reactRouter(), tsconfigPaths()];
if (
process.env.SENTRY_ORG &&
process.env.SENTRY_PROJECT &&
process.env.SENTRY_AUTH_TOKEN
) {
plugins = [...plugins, sentryReactRouter(sentryConfig, config)];
}
return {
server: {
allowedHosts: true,
watch: {
ignored: [
"**/*.spec.ts",
"**/*.test.ts",
"**/tests/**",
"**/playwright-report/**",
"**/test-results/**",
],
},
},
build: {
sourcemap: Boolean(process.env.SENTRY_DSN),
rollupOptions: {
output: {
manualChunks(id) {
// Only apply to client build (node_modules)
if (id.includes("node_modules")) {
// FullCalendar packages - separate chunk for lazy loading
if (id.includes("@fullcalendar")) {
return "vendor-fullcalendar";
}
// Radix UI components
if (id.includes("@radix-ui")) {
return "vendor-ui";
}
}
},
},
},
},
plugins,
sentryConfig,
};
});