65 lines
1.4 KiB
TypeScript
65 lines
1.4 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
// Base path otimizado para Netlify
|
|
base: '/',
|
|
|
|
// Otimizações de build para Netlify
|
|
build: {
|
|
minify: true,
|
|
emptyOutDir: true,
|
|
},
|
|
|
|
// Otimizações de desenvolvimento
|
|
server: {
|
|
host: true,
|
|
port: 5173,
|
|
},
|
|
|
|
// Configurações de preview otimizadas
|
|
preview: {
|
|
port: 4173,
|
|
strictPort: true,
|
|
host: true
|
|
},
|
|
|
|
// Otimizações de dependências para melhor performance
|
|
optimizeDeps: {
|
|
include: [
|
|
'react',
|
|
'react-dom',
|
|
'react-router-dom',
|
|
'@tanstack/react-query',
|
|
'@supabase/supabase-js',
|
|
'zustand',
|
|
'lucide-react',
|
|
'framer-motion',
|
|
'sonner',
|
|
'react-hook-form',
|
|
'@hookform/resolvers',
|
|
'zod',
|
|
'dexie',
|
|
'clsx',
|
|
'tailwind-merge'
|
|
],
|
|
exclude: [
|
|
'@tanstack/react-query-devtools' // Excluir devtools em produção
|
|
],
|
|
force: process.env.FORCE_OPTIMIZE === 'true'
|
|
},
|
|
|
|
// Configurações específicas para Netlify
|
|
define: {
|
|
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development'),
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production')
|
|
},
|
|
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
],
|
|
});
|