import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { resolve } from 'path' import { fileURLToPath } from 'node:url' import tailwindcss from '@tailwindcss/vite' // https://vitejs.dev/config/ export default defineConfig({ base: '/static/', server: { // Django serves the HTML on a different origin than the Vite dev // server, so dev-mode asset URLs (e.g. @font-face url()s injected // via JS-imported CSS) must be absolute, not root-relative, or the // browser resolves them against Django's origin instead of Vite's. origin: 'http://localhost:5173', }, plugins: [ vue(), tailwindcss(), ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, build: { manifest: 'manifest.json', outDir: resolve("./static_source/vite"), rollupOptions: { input: { main: resolve('./src/main.ts'), error: resolve('./src/error.ts'), } } }, })