-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathvite.config.js
More file actions
43 lines (39 loc) · 1.1 KB
/
vite.config.js
File metadata and controls
43 lines (39 loc) · 1.1 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
import { defineConfig } from "vite";
import viteReact from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import netlify from "@netlify/vite-plugin-tanstack-start";
import viteTsConfigPaths from "vite-tsconfig-paths";
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
const basePlugins = [
tanstackStart(),
netlify(),
TanStackRouterVite({
autoCodeSplitting: true,
appDirectory: 'src',
}),
viteReact(),
tailwindcss(),
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
];
// Add Sentry plugin only if auth token is available
if (process.env.SENTRY_AUTH_TOKEN) {
basePlugins.push(
sentryVitePlugin({
org: "org-name",
project: "project-name",
authToken: process.env.SENTRY_AUTH_TOKEN,
})
);
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: basePlugins,
build: {
// Only generate source maps if Sentry is enabled
sourcemap: !!process.env.SENTRY_AUTH_TOKEN,
},
});