import { fileURLToPath, URL } from 'node:url' import vue from '@vitejs/plugin-vue' import { defineConfig } from 'vite' export default defineConfig({ plugins: [vue()], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, server: { port: 5173, proxy: { '/api': { target: process.env.API_ORIGIN ?? 'http://127.0.0.1:3000', changeOrigin: true, }, '/images/tmdb': { target: 'https://image.tmdb.org', changeOrigin: true, rewrite: (requestPath) => requestPath.replace(/^\/images\/tmdb/, '/t/p'), }, }, }, worker: { format: 'es', }, test: { environment: 'jsdom', globals: true, setupFiles: ['./src/test/setup.ts'], css: false, }, })