You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
650 B
TypeScript
23 lines
650 B
TypeScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const isDev = mode === 'development';
|
|
|
|
return {
|
|
plugins: [sveltekit()],
|
|
resolve: {
|
|
// En desarrollo, alias para usar better-sqlite3 (Vite/HMR no entiende 'bun:sqlite')
|
|
alias: isDev ? { 'bun:sqlite': 'better-sqlite3' } : {}
|
|
},
|
|
ssr: {
|
|
// En producción, evitar que Node intente resolver el esquema 'bun:'
|
|
external: isDev ? [] : ['bun:sqlite']
|
|
},
|
|
optimizeDeps: {
|
|
// No prebundlear 'bun:sqlite' (no aplica en dev si alias está activo, pero es inofensivo)
|
|
exclude: ['bun:sqlite']
|
|
}
|
|
};
|
|
});
|