A:调试构建
This commit is contained in:
1 parent
0f366cb82e
commit
15e7695ee2
1 file changed
+4
-9
@@ -10,18 +10,13 @@ import Components from 'unplugin-vue-components/vite'
|
|||||||
|
|
||||||
|
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
// 确保从正确的目录加载环境变量
|
|
||||||
const env = loadEnv(mode, process.cwd(), '')
|
const env = loadEnv(mode, process.cwd(), '')
|
||||||
|
|
||||||
// 调试信息
|
// 直接根据 mode 设置基础路径,确保在 GitHub Actions 中正确工作
|
||||||
console.log('Build mode:', mode)
|
const baseUrl = mode === 'demo' ? '/NetVizor/' : '/'
|
||||||
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)
|
|
||||||
|
|
||||||
const baseUrl = env.VITE_BASE_URL || (mode === 'demo' ? '/NetVizor/' : '/')
|
console.log('Build mode:', mode)
|
||||||
console.log('Final base URL:', baseUrl)
|
console.log('Base URL:', baseUrl)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// GitHub Pages 部署路径配置
|
// GitHub Pages 部署路径配置
|
||||||
|
|||||||
Reference in new issue
Block a user