fix(config): 配置相对路径解决生产构建资源加载问题

更新vite配置添加base: './'以使用相对路径,避免部署到子目录时资源加载失败。同时更新README.md记录该修复。
This commit is contained in:
2025-08-29 13:05:23 +08:00
parent 76a2552852
commit c2a95227c5
2 changed files with 4 additions and 1 deletions

View File

@@ -3,7 +3,8 @@ import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
base: './', // 使用相对路径,避免部署到子目录时资源加载失败
server: {
port: 3000
}
})
})