- restructure from src/ + server/ to src/client/ + src/server/ + src/shared/ - switch backend runtime from Node (tsx) to Bun - merge server/package.json into root, remove @hono/node-server + tsx - convert server @/ imports to relative paths - standardize biome config (lineWidth 80, quoteStyle double) - add CLAUDE.md, .env.example at root - update vite.config, tsconfig, deploy.sh for new structure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
68 lines
1.6 KiB
TypeScript
68 lines
1.6 KiB
TypeScript
import { dirname, resolve } from "node:path"
|
|
import { fileURLToPath } from "node:url"
|
|
import tailwindcss from "@tailwindcss/vite"
|
|
import { tanstackRouter } from "@tanstack/router-plugin/vite"
|
|
import react from "@vitejs/plugin-react"
|
|
import { defineConfig } from "vite"
|
|
import { VitePWA } from "vite-plugin-pwa"
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
|
|
export default defineConfig({
|
|
base: "/agw/",
|
|
plugins: [
|
|
tanstackRouter({
|
|
routesDirectory: "src/client/routes",
|
|
generatedRouteTree: "src/client/routeTree.gen.ts",
|
|
}),
|
|
react(),
|
|
tailwindcss(),
|
|
VitePWA({
|
|
strategies: "injectManifest",
|
|
srcDir: "src/client",
|
|
filename: "sw.ts",
|
|
registerType: "prompt",
|
|
manifest: {
|
|
name: "Abgeordnetenwatch",
|
|
short_name: "AGW",
|
|
description:
|
|
"Track Bundestag and Landtag votes, follow topics and politicians.",
|
|
start_url: "/agw/",
|
|
scope: "/agw/",
|
|
display: "standalone",
|
|
orientation: "portrait-primary",
|
|
theme_color: "#1d4ed8",
|
|
background_color: "#f9fafb",
|
|
lang: "en",
|
|
icons: [
|
|
{
|
|
src: "/agw/icons/icon-192.png",
|
|
sizes: "192x192",
|
|
type: "image/png",
|
|
purpose: "any maskable",
|
|
},
|
|
{
|
|
src: "/agw/icons/icon-512.png",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
purpose: "any maskable",
|
|
},
|
|
],
|
|
},
|
|
injectManifest: {
|
|
globPatterns: ["**/*.{js,css,html,svg,png,woff2,wasm}"],
|
|
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve(__dirname, "src/client"),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
},
|
|
})
|