debug: 添加调试信息排查路径配置问题
- 增强 vite.config.ts 调试输出 - 添加 GitHub Actions 构建调试信息 - 检查环境变量加载和文件存在 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
4f3b06b686
commit
0f366cb82e
2 files changed
+12
-2
No files matched your search
@@ -41,11 +41,18 @@ jobs:
|
||||
working-directory: src/NetVizor.Frontend
|
||||
run: |
|
||||
rm -rf node_modules package-lock.json pnpm-lock.yaml
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Files in current directory: $(ls -la)"
|
||||
echo "Environment files: $(ls -la .env*)"
|
||||
npm install --force
|
||||
|
||||
- name: 构建演示版本
|
||||
working-directory: src/NetVizor.Frontend
|
||||
run: npm run build:demo
|
||||
run: |
|
||||
echo "Building with mode: demo"
|
||||
echo "Checking .env.demo file:"
|
||||
cat .env.demo || echo "No .env.demo found"
|
||||
npm run build:demo
|
||||
|
||||
- name: 上传构建产物
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
|
||||
@@ -10,10 +10,13 @@ import Components from 'unplugin-vue-components/vite'
|
||||
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
// 确保从正确的目录加载环境变量
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
|
||||
// 调试信息
|
||||
console.log('Build mode:', mode)
|
||||
console.log('Process CWD:', process.cwd())
|
||||
console.log('All env vars:', Object.keys(env).filter(key => key.startsWith('VITE_')))
|
||||
console.log('VITE_BASE_URL:', env.VITE_BASE_URL)
|
||||
console.log('VITE_DEMO_MODE:', env.VITE_DEMO_MODE)
|
||||
|
||||
|
||||
Reference in new issue
Block a user