Files
amayo/AmayoWeb/vite.config.js

53 lines
1.3 KiB
JavaScript
Raw Normal View History

2025-11-24 16:16:01 -06:00
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig({
plugins: [
vue(),
vueDevTools(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
base: process.env.NODE_ENV === 'production' ? '/' : '/',
build: {
outDir: 'dist',
assetsDir: 'assets',
rollupOptions: {
output: {
manualChunks: {
'vendor': ['vue', 'vue-router', 'vue-i18n'],
}
}
}
},
server: {
host: true,
port: 5173,
proxy: {
2025-12-01 18:59:48 +00:00
'/auth': {
target: 'http://localhost:3000',
changeOrigin: true,
secure: false,
// No hacer proxy de /auth/callback porque es manejado por Vue Router
bypass: (req, res, options) => {
if (req.url === '/auth/callback' || req.url?.startsWith('/auth/callback?')) {
return req.url // Deja que Vue Router lo maneje
}
}
},
2025-11-24 16:16:01 -06:00
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
2025-12-01 18:59:48 +00:00
secure: false,
2025-11-24 16:16:01 -06:00
}
}
}
})