33 lines
749 B
TypeScript
33 lines
749 B
TypeScript
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" },
|
|
test: {
|
|
include: ["./engine/**/*.test.ts"],
|
|
environment: "jsdom",
|
|
},
|
|
plugins: [solidPlugin(), devTools()],
|
|
resolve: {
|
|
alias: {
|
|
"#/": root,
|
|
},
|
|
},
|
|
});
|