import { fileURLToPath, URL } from 'node:url' import tailwindcss from '@tailwindcss/vite' import vue from '@vitejs/plugin-vue' // vitest/config's defineConfig is vite's own, augmented with the `test` // field's types — importing from here (not 'vite') is what lets the // `test` block below type-check under vue-tsc -b without a separate // vitest.config.ts or a triple-slash type reference. import { defineConfig } from 'vitest/config' import { mockAdminApi } from './mock/server.ts' // MOCK=1 serves /admin/api/* from webui/mock (dev server only; apply: 'serve' keeps it out of vite build). const useMock = process.env.MOCK === '1' // https://vite.dev/config/ export default defineConfig({ // admin.go serves this build's index.html at GET /admin and every hashed // asset at GET /admin/assets/{hashedname} — the base must match so the // emitted index.html's own