build: add staging/prod scripts and env type definitions

update the default build script to use production mode
define TypeScript types for all supported Vite environment variables
This commit is contained in:
duanshuwen
2026-06-03 21:34:32 +08:00
parent d352fac2f1
commit 0f28cdcb48
2 changed files with 16 additions and 1 deletions

13
src/env.d.ts vendored
View File

@@ -1,5 +1,18 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_APP_ENV: "development" | "staging" | "production";
readonly VITE_API_BASE_URL: string;
readonly VITE_API_TIMEOUT_MS?: string;
readonly VITE_SOCKET_BASE_URL?: string;
readonly VITE_CLIENT_ID?: string;
readonly VITE_TOKEN?: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}
declare module "*.vue" {
import type { DefineComponent } from "vue";