import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' import { defineConfig } from 'vite' const __dirname = fileURLToPath(new URL('.', import.meta.url)) /** * The engine is plain TypeScript with no runtime dependencies: Vite only serves * and bundles it. Two entries: the real campaign scene (`acts.html`) and the * combat math arena (`arena.html`). `samples/` is served in dev so all of them can * be smoke-tested over HTTP (`?sample=samples/spawn.mpq`, * `?data=samples/fixtures`). */ export default defineConfig({ server: { host: '127.0.0.1', port: 5173, strictPort: true, }, plugins: [ { name: 'root-redirect', configureServer(server) { server.middlewares.use((req, res, next) => { if (req.url === '/' || req.url === '/index.html') { res.writeHead(302, { Location: '/acts.html' }) res.end() return } next() }) }, generateBundle() { this.emitFile({ type: 'asset', fileName: 'index.html', source: '