import { defineConfig } from 'vite' // Custom Riot.js plugin for Vite function riotPlugin() { return { name: 'vite-plugin-riot', async transform(code, id) { if (!id.endsWith('.riot')) return null const { compile } = await import('@riotjs/compiler') const { code: compiled } = compile(code, { file: id }) return { code: compiled, map: null, } }, } } export default defineConfig({ plugins: [riotPlugin()], server: { port: 3000, proxy: { '/api': { target: 'http://localhost:3001', changeOrigin: true, }, '/ws': { target: 'ws://localhost:3001', ws: true, }, '/uploads': { target: 'http://localhost:3001', changeOrigin: true, }, }, }, })