From aa4fb9dd51c08333c240ad8defe648611e84cd70 Mon Sep 17 00:00:00 2001 From: LeaderOnePro Date: Tue, 3 Jun 2025 12:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Vite=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=AD=A3=E8=B7=AF=E5=BE=84=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E6=96=87=E4=BB=B6=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/vite.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index b549029..521bd2a 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,4 +1,5 @@ import path from "node:path"; +import { fileURLToPath } from "node:url"; import { defineConfig } from "vite"; import react from "@vitejs/plugin-react-swc"; import tailwindcss from "@tailwindcss/vite"; @@ -9,7 +10,7 @@ export default defineConfig({ base: "/app/", resolve: { alias: { - "@": path.resolve(new URL(".", import.meta.url).pathname, "./src"), + "@": path.resolve(path.dirname(fileURLToPath(import.meta.url)), "src"), }, }, server: {