import { fileURLToPath, URL } from "node:url"; import solidPlugin from "vite-plugin-solid"; import { defineConfig, type Plugin } from "vitest/config"; import middleware from "#/engine/dev/server/middleware.ts"; export const host = "localhost"; export const port = 3080; export const root = fileURLToPath(new URL("./", import.meta.url)); function devTools(): Plugin { return { name: "dev-tools", configureServer(server) { server.middlewares.use("/api", middleware); }, }; } export default defineConfig({ server: { host, port, hmr: false }, build: { target: "esnext", main: `${root}index.html`, lib: { entry: `${root}worker.ts`, }, }, test: { include: ["./engine/**/*.test.ts"], environment: "jsdom", }, plugins: [solidPlugin(), devTools()], resolve: { alias: { "#/": root, }, }, });