generated from netlify-templates/tanstack-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
32 lines (28 loc) · 820 Bytes
/
vite.config.js
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
import { defineConfig } from "vite";
import viteReact from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { sentryVitePlugin } from "@sentry/vite-plugin";
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
const basePlugins = [
TanStackRouterVite({ autoCodeSplitting: true }),
viteReact(),
tailwindcss(),
];
// 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,
},
});