diff --git a/.gitignore b/.gitignore index b6ce6d4..d93df3f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ __pycache__/ # Output of `make verify` (root Makefile). /frontend/screenshots/ +*.tsbuildinfo diff --git a/frontend/vite.config.d.ts b/frontend/vite.config.d.ts new file mode 100644 index 0000000..340562a --- /dev/null +++ b/frontend/vite.config.d.ts @@ -0,0 +1,2 @@ +declare const _default: import("vite").UserConfig; +export default _default; diff --git a/frontend/vite.config.js b/frontend/vite.config.js new file mode 100644 index 0000000..b72d283 --- /dev/null +++ b/frontend/vite.config.js @@ -0,0 +1,25 @@ +import path from "node:path"; +import tailwindcss from "@tailwindcss/vite"; +import { tanstackRouter } from "@tanstack/router-plugin/vite"; +import react from "@vitejs/plugin-react-swc"; +import { defineConfig } from "vite"; +// https://vitejs.dev/config/ +export default defineConfig({ + // A portal serves this bundle under a path of its own and caches one copy + // for every installation, so asset URLs have to be absolute under that + // prefix. Unset — every ordinary build — this stays "/". + base: process.env.VITE_BASE || "/", + resolve: { + alias: { + "@": path.resolve(__dirname, "./src"), + }, + }, + plugins: [ + tanstackRouter({ + target: "react", + autoCodeSplitting: true, + }), + react(), + tailwindcss(), + ], +});