Skip to content

Commit aa4fb9d

Browse files
committed
更新 Vite 配置,修正路径解析以支持文件 URL
1 parent 17f8286 commit aa4fb9d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from "node:path";
2+
import { fileURLToPath } from "node:url";
23
import { defineConfig } from "vite";
34
import react from "@vitejs/plugin-react-swc";
45
import tailwindcss from "@tailwindcss/vite";
@@ -9,7 +10,7 @@ export default defineConfig({
910
base: "/app/",
1011
resolve: {
1112
alias: {
12-
"@": path.resolve(new URL(".", import.meta.url).pathname, "./src"),
13+
"@": path.resolve(path.dirname(fileURLToPath(import.meta.url)), "src"),
1314
},
1415
},
1516
server: {

0 commit comments

Comments
 (0)