2026-03-10 23:35:33 -07:00
|
|
|
import { sentryReactRouter } from "@sentry/react-router";
|
2025-10-10 23:04:50 -07:00
|
|
|
import { reactRouter } from "@react-router/dev/vite";
|
|
|
|
|
import tailwindcss from "@tailwindcss/vite";
|
2026-02-19 11:54:32 -08:00
|
|
|
import path from "node:path";
|
|
|
|
|
import { fileURLToPath } from "node:url";
|
2025-10-10 23:04:50 -07:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
|
import tsconfigPaths from "vite-tsconfig-paths";
|
|
|
|
|
|
2026-02-19 11:54:32 -08:00
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
|
2026-03-10 23:35:33 -07:00
|
|
|
export default defineConfig((env) => ({
|
2025-10-10 23:04:50 -07:00
|
|
|
build: {
|
2026-03-10 23:35:33 -07:00
|
|
|
rollupOptions: env.isSsrBuild
|
2025-10-10 23:04:50 -07:00
|
|
|
? {
|
|
|
|
|
input: "./server/app.ts",
|
|
|
|
|
}
|
|
|
|
|
: undefined,
|
|
|
|
|
},
|
2026-03-10 23:35:33 -07:00
|
|
|
|
|
|
|
|
plugins: [{
|
|
|
|
|
name: "database-context-alias",
|
|
|
|
|
enforce: "pre" as const,
|
|
|
|
|
resolveId(id, _importer, options) {
|
|
|
|
|
if (id === "~/database/context") {
|
|
|
|
|
return options?.ssr
|
|
|
|
|
? path.resolve(__dirname, "database/context.ts")
|
|
|
|
|
: path.resolve(__dirname, "database/context.browser-stub.ts");
|
|
|
|
|
}
|
2026-02-20 16:10:22 -08:00
|
|
|
},
|
2026-03-10 23:35:33 -07:00
|
|
|
}, tailwindcss(), reactRouter(), tsconfigPaths(), sentryReactRouter({
|
|
|
|
|
org: "chris-parsons",
|
|
|
|
|
project: "brackt",
|
|
|
|
|
authToken: process.env.SENTRY_AUTH_TOKEN
|
|
|
|
|
}, env)],
|
|
|
|
|
|
2025-10-14 21:46:55 -07:00
|
|
|
server: {
|
|
|
|
|
allowedHosts: true,
|
|
|
|
|
},
|
2026-03-10 23:35:33 -07:00
|
|
|
|
|
|
|
|
optimizeDeps: {
|
|
|
|
|
exclude: ["@sentry/react-router"]
|
|
|
|
|
}
|
2025-10-10 23:04:50 -07:00
|
|
|
}));
|