Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (58 loc) · 1.62 KB
/
Copy pathvite.config.ts
File metadata and controls
60 lines (58 loc) · 1.62 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
// Load env file based on `mode` in the current working directory.
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [react()],
server: {
port: 5173,
host: true,
hmr: {
timeout: 30000,
overlay: true
},
watch: {
usePolling: true,
interval: 1000
}
},
build: {
sourcemap: mode === 'development',
minify: mode === 'production',
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom', 'react-router-dom'],
ui: ['lucide-react'],
supabase: ['@supabase/supabase-js']
}
}
},
chunkSizeWarningLimit: 1000,
assetsInlineLimit: 4096
},
define: {
__DEV__: mode === 'development',
'process.env.NODE_ENV': JSON.stringify(mode),
'process.env.VITE_SUPABASE_URL': JSON.stringify(env.VITE_SUPABASE_URL),
'process.env.VITE_SUPABASE_ANON_KEY': JSON.stringify(env.VITE_SUPABASE_ANON_KEY)
},
resolve: {
alias: {
'@': resolve(__dirname, './src')
}
},
optimizeDeps: {
include: ['react', 'react-dom', 'react-router-dom', 'lucide-react', '@supabase/supabase-js'],
exclude: ['@supabase/supabase-js']
},
esbuild: {
logOverride: { 'this-is-undefined-in-esm': 'silent' },
jsxFactory: 'React.createElement',
jsxFragment: 'React.Fragment'
}
};
});