diff --git a/.gitignore b/.gitignore index 314cd33..c3388a6 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ dist-ssr .env .env.local +.env.*.local diff --git a/package.json b/package.json index feb68fd..25b5360 100644 --- a/package.json +++ b/package.json @@ -5,14 +5,15 @@ "type": "module", "scripts": { "dev": "vite", - "build": "vite build", + "build": "tsc && vite build", "lint": "eslint .", "preview": "vite preview" }, "dependencies": { "lucide-react": "^0.344.0", "react": "^18.3.1", - "react-dom": "^18.3.1" + "react-dom": "^18.3.1", + "@supabase/supabase-js": "^2.39.7" }, "devDependencies": { "@eslint/js": "^9.9.1", diff --git a/src/lib/supabase.ts b/src/lib/supabase.ts index 985bbbe..4bd834a 100644 --- a/src/lib/supabase.ts +++ b/src/lib/supabase.ts @@ -1,6 +1,10 @@ import { createClient } from '@supabase/supabase-js' -const supabaseUrl = 'https://bsjlbnyslxzsdwxvkaap.supabase.co' -const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJzamxibnlzbHh6c2R3eHZrYWFwIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MzQ2MzUzNzYsImV4cCI6MjA1MDIxMTM3Nn0.ygEUrAu2ZnCkfgS4-k4Puvk7ywkn3U7Bnzh7BSOQWFo' +const supabaseUrl = import.meta.env.VITE_SUPABASE_URL +const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY + +if (!supabaseUrl || !supabaseAnonKey) { + throw new Error('Supabase URL and Anon Key must be defined') +} export const supabase = createClient(supabaseUrl, supabaseAnonKey) \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 147380a..d16194a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,12 @@ import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], optimizeDeps: { - exclude: ['lucide-react'], + include: ['@supabase/supabase-js'] }, + build: { + commonjsOptions: { + include: [/node_modules/], + transformMixedEsModules: true + } + } });