Files
schoolNews/schoolNewsWeb/src/env.d.ts
2025-10-08 14:11:54 +08:00

27 lines
567 B
TypeScript

/// <reference types="vite/client" />
// Vite 环境变量类型定义
interface ImportMetaEnv {
readonly VITE_API_BASE_URL: string
readonly VITE_APP_TITLE: string
readonly VITE_APP_MODE?: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}
// 兼容旧的 process.env 写法(如果代码中有使用)
declare global {
namespace NodeJS {
interface ProcessEnv {
readonly BASE_URL?: string
readonly VITE_API_BASE_URL?: string
readonly VITE_APP_TITLE?: string
readonly VITE_APP_MODE?: string
}
}
}
export {}