Files
mozimo.in/vite.config.ts
T
tanshu e0eb577e3e Google analytics integration.
Sentry.io integration.
Vince integration.
Region-scoped consent (denied-by-default in EU/EEA/UK/CH, granted elsewhere, DPDP-friendly notice)
2026-09-06 16:03:13 +00:00

42 lines
1.2 KiB
TypeScript

// vite.config.ts
import { defineConfig } from "vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { sentryTanstackStart } from "@sentry/tanstackstart-react/vite";
/**
* Sentry build-time integration (sourcemap generation + upload) only runs
* when SENTRY_AUTH_TOKEN is present — local and CI builds without
* credentials are completely unaffected.
*/
const sentryUpload = Boolean(process.env.SENTRY_AUTH_TOKEN);
export default defineConfig({
server: {
port: 3000,
},
resolve: {
tsconfigPaths: true,
},
...(sentryUpload ? { build: { sourcemap: true } } : {}),
plugins: [
tailwindcss(),
tanstackStart({
srcDirectory: "src", // This is the default
router: {
// Specifies the directory TanStack Router uses for your routes.
routesDirectory: "app", // Defaults to "routes", relative to srcDirectory
},
}),
viteReact(),
...(sentryUpload
? [
sentryTanstackStart({
sourcemaps: { filesToDeleteAfterUpload: ["dist/**/*.map"] },
}),
]
: []),
],
});