2026-05-24 20:48:52 +08:00
|
|
|
import { defineConfig } from "vite";
|
2026-05-24 21:21:08 +08:00
|
|
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
2026-05-24 20:48:52 +08:00
|
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
|
|
|
|
|
|
const here = fileURLToPath(new URL(".", import.meta.url));
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
2026-05-24 21:21:08 +08:00
|
|
|
plugins: [vueJsx()],
|
2026-05-24 20:48:52 +08:00
|
|
|
build: {
|
|
|
|
|
target: "node22",
|
|
|
|
|
outDir: "dist",
|
|
|
|
|
emptyOutDir: true,
|
|
|
|
|
minify: false,
|
|
|
|
|
lib: {
|
2026-05-24 21:21:08 +08:00
|
|
|
entry: `${here}src/main.tsx`,
|
2026-05-24 20:48:52 +08:00
|
|
|
formats: ["es"],
|
|
|
|
|
fileName: () => "game.mjs",
|
|
|
|
|
},
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
external: (id) => !id.startsWith(".") && !id.startsWith("/") && !id.startsWith("\0"),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
});
|