-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
42 lines (39 loc) · 2.01 KB
/
Copy pathvite.config.ts
File metadata and controls
42 lines (39 loc) · 2.01 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
// @lovable.dev/vite-tanstack-config already includes the following — do NOT add them manually
// or the app will break with duplicate plugins:
// - tanstackStart, viteReact, tailwindcss, tsConfigPaths, cloudflare (build-only),
// componentTagger (dev-only), VITE_* env injection, @ path alias, React/TanStack dedupe,
// error logger plugins, and sandbox detection (port/host/strictPort).
// You can pass additional config via defineConfig({ vite: { ... } }) if needed.
import { defineConfig } from "@lovable.dev/vite-tanstack-config";
import { loadEnv } from "vite";
import path from "node:path";
// Force-inline Supabase publishable env into the client bundle.
const env = loadEnv(process.env.NODE_ENV || "production", process.cwd(), "");
// Populate process.env for server routes (needs non-VITE_ vars like SUPABASE_SERVICE_ROLE_KEY)
Object.assign(process.env, env);
const SUPABASE_URL = env.VITE_SUPABASE_URL || env.SUPABASE_URL || "https://ynxuotbjfxkcrfvkrltr.supabase.co";
const SUPABASE_PUBLISHABLE_KEY =
env.VITE_SUPABASE_PUBLISHABLE_KEY ||
env.SUPABASE_PUBLISHABLE_KEY ||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InlueHVvdGJqZnhrY3JmdmtybHRyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzgzODI2NjYsImV4cCI6MjA5Mzk1ODY2Nn0.NmGjLNtxcYfnmhpd6T7VwH5sO2R0K8D-4sv7ATvZezc";
export default defineConfig({
tanstackStart: {
server: { entry: "server" },
},
vite: {
define: {
"import.meta.env.VITE_SUPABASE_URL": JSON.stringify(SUPABASE_URL),
"import.meta.env.VITE_SUPABASE_PUBLISHABLE_KEY": JSON.stringify(SUPABASE_PUBLISHABLE_KEY),
"import.meta.env.VITE_SUPABASE_PROJECT_ID": JSON.stringify(
env.VITE_SUPABASE_PROJECT_ID || "ynxuotbjfxkcrfvkrltr",
),
},
resolve: {
alias: {
"entities/lib/decode.js": path.resolve(__dirname, "node_modules/entities/lib/decode.js"),
"entities/lib/encode.js": path.resolve(__dirname, "node_modules/entities/lib/encode.js"),
"entities": path.resolve(__dirname, "node_modules/entities"),
},
},
},
});