build: 📦 定义vite全局常量替换

This commit is contained in:
cshaptx4869
2024-03-05 21:03:49 +08:00
parent ba384ab965
commit 4732c23767
3 changed files with 37 additions and 3 deletions

16
src/typings/env.d.ts vendored
View File

@@ -18,3 +18,19 @@ interface ImportMetaEnv {
interface ImportMeta {
readonly env: ImportMetaEnv;
}
/**
* 平台的名称、版本、运行所需的`node`版本、依赖、构建时间的类型提示
*/
declare const __APP_INFO__: {
pkg: {
name: string;
version: string;
engines: {
node: string;
};
dependencies: Record<string, string>;
devDependencies: Record<string, string>;
};
buildTimestamp: number;
};