feat: migrate from Next.js to Vite and React Router, updating routing and environment variable handling

This commit is contained in:
HouYunFei
2026-06-26 16:41:32 +08:00
parent ef7a218ba6
commit e635ec6908
24 changed files with 314 additions and 238 deletions
+24
View File
@@ -0,0 +1,24 @@
import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import { parseChangelog } from "./src/lib/release";
const webDir = dirname(fileURLToPath(import.meta.url));
const localVersion = readFileSync(resolve(webDir, "../VERSION"), "utf8").trim() || "dev";
const localChangelog = readFileSync(resolve(webDir, "../CHANGELOG.md"), "utf8");
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": resolve(webDir, "src"),
},
},
define: {
__APP_VERSION__: JSON.stringify(localVersion),
__APP_RELEASES__: JSON.stringify(parseChangelog(localChangelog)),
},
});