修复:添加 Vite 路径别名配置

问题:Docker 构建时 Vite 无法解析 @/ 路径别名
原因:vite.config.ts 缺少 resolve.alias 配置
解决:添加 @ 别名指向 ./src 目录

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Cheng Zhou
2026-05-14 09:31:40 +08:00
parent 77b16ffa82
commit 7b397640b9
+6
View File
@@ -1,5 +1,6 @@
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { fileURLToPath } from "node:url";
export default defineConfig({
plugins: [
@@ -20,6 +21,11 @@ export default defineConfig({
},
},
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
server: {
host: true,
port: 5173,