chore: configure landing base path

This commit is contained in:
2026-07-10 09:42:25 +08:00
parent 6b7135a7c8
commit ecbdffcea4
3 changed files with 14 additions and 8 deletions
+1
View File
@@ -0,0 +1 @@
VITE_BASE_PATH=/
+1 -1
View File
@@ -2,7 +2,7 @@
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png" /> <link rel="icon" type="image/png" href="%BASE_URL%favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta <meta
name="description" name="description"
+7 -2
View File
@@ -1,12 +1,17 @@
import { defineConfig } from "vite"; import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react"; import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite"; import tailwindcss from "@tailwindcss/vite";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, ".", "");
return {
base: env.VITE_BASE_PATH || "/",
plugins: [react(), tailwindcss()], plugins: [react(), tailwindcss()],
server: { server: {
port: 5273, port: 5273,
open: true, open: true,
}, },
};
}); });