✏️ 修复 import.meta.env 引用

This commit is contained in:
BTMuli
2023-10-09 01:05:52 +08:00
parent 7841ea4a79
commit 1ad3506f66
6 changed files with 30 additions and 6 deletions

26
src/vite-env.d.ts vendored
View File

@@ -2,7 +2,7 @@
* @file vite-env.d.ts
* @description vite-env.d.ts
* @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.1.3
* @since Beta v0.3.3
*/
declare module "*.vue" {
@@ -26,3 +26,27 @@ declare module "vue-json-viewer" {
}>;
export default component;
}
/**
* @description import.meta.env
* @package vite
* @description 只写了用到的属性
*/
interface ImportMetaEnv {
TAURI_ARCH: string;
TAURI_DEBUG: boolean;
TAURI_FAMILY: string;
TAURI_KEY_PASSWORD: string;
TAURI_PLATFORM: string;
TAURI_PLATFORM_TYPE: string;
BASE_URL: string;
MODE: string;
DEV: boolean;
PROD: boolean;
SSR: boolean;
}
declare interface ImportMeta {
readonly env: ImportMetaEnv;
readonly glob: (path: string) => Record<string, () => Promise<any>>;
}