Files
schoolNews/schoolNewsWeb/src/env.d.ts

27 lines
567 B
TypeScript
Raw Normal View History

2025-10-07 13:31:06 +08:00
/// <reference types="vite/client" />
2025-10-08 14:11:54 +08:00
// 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 写法(如果代码中有使用)
2025-10-07 13:31:06 +08:00
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 {}