fix: 修复 vite.config.js 中缺失的 base 路径配置
- 发现 Vite 优先使用 vite.config.js 而非 vite.config.ts - 在 vite.config.js 中添加相同的 base 路径配置 - 演示模式使用 '/NetVizor/' 基础路径 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
15e7695ee2
commit
92a1dd3ad4
1 file changed
+9
@@ -6,7 +6,16 @@ import { NaiveUiResolver } from 'unplugin-vue-components/resolvers';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
|
||||
// 直接根据 mode 设置基础路径,确保在 GitHub Actions 中正确工作
|
||||
const baseUrl = mode === 'demo' ? '/NetVizor/' : '/';
|
||||
|
||||
console.log('Build mode:', mode);
|
||||
console.log('Base URL:', baseUrl);
|
||||
|
||||
return {
|
||||
// GitHub Pages 部署路径配置
|
||||
base: baseUrl,
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
|
||||
Reference in new issue
Block a user