-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
36 lines (30 loc) · 1.16 KB
/
Copy pathvite.config.js
File metadata and controls
36 lines (30 loc) · 1.16 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
// @ts-check
import { defineConfig } from 'vite';
import path from 'path';
import fs from 'fs';
import { mitaHmrPlugin } from 'mita-dom';
import legacy from '@vitejs/plugin-legacy';
import mitaTelemetryPlugin from './vite-plugin-mita-telemetry.js';
export default defineConfig({
plugins: [
mitaTelemetryPlugin(),
mitaHmrPlugin(),
// Fallback inteligente para navegadores que no soportan ES Modules o Web Components
legacy({
targets: ['defaults', 'not IE 11'], // Navegadores antiguos (Excepto IE11 que ya murió)
polyfills: ['es.promise.finally', 'es/map', 'es/set'], // Inyección automática de Core-JS
})
],
// Resolve removido porque la sincronización es explícita
// Evitar que Vite limpie la consola constantemente, así podemos leer advertencias/errores
clearScreen: false,
server: {
// Esencial para SPAs: Si recargas /perfil, redirige a index.html en vez de dar 404 de servidor
historyApiFallback: true,
},
build: {
// Minificamos el código, pero NO destruimos los logs porque nuestro Logger
// maneja internamente la Telemetría (envío asíncrono al backend) en Producción.
minify: 'terser'
}
});