env.d.ts 1.3 KB

1234567891011121314151617181920212223242526
  1. /// <reference types="vite/client" />
  2. export interface ImportMetaEnv {
  3. readonly VITE_GLOB_APP_TITLE: string // APP显示标题
  4. readonly VITE_GLOB_APP_NAME: string // APP名称
  5. readonly VITE_USER_NODE_ENV: string // 运行环境:"development" 或 "production"
  6. readonly VITE_PUBLIC_PATH: string // 公共基础路径
  7. readonly VITE_ROUTER_MODE: string // 路由模式 Optional: hash | history
  8. readonly VITE_API_URL: string // API接口基地址
  9. // 仅development环境生效
  10. readonly VITE_PORT?: string // APP调试运行端口号
  11. readonly VITE_OPEN?: string // 启动时自动打开浏览器 true or false
  12. readonly VITE_DEVTOOLS?: string // 开启 devTools 调试 true or false
  13. readonly VITE_CODEINSPECTOR?: string // 开启 CodeInspector 调试 true or false
  14. // 仅production打包
  15. readonly VITE_REPORT?: string // 打包后是否生成包分析文件 true or false
  16. readonly VITE_DROP_CONSOLE?: string // 打包时是否删除 console true or false
  17. readonly VITE_BUILD_COMPRESS?: string // 是否启用 gzip 或 brotli 压缩打包,如果需要多个压缩规则,可以使用 “,” 分隔 Optional: gzip | brotli | none
  18. readonly VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE?: string // 打包压缩后是否删除源文件 true or false
  19. }
  20. interface ImportMeta {
  21. readonly env: ImportMetaEnv
  22. }