fix(build): fix build error

This commit is contained in:
Vben 2021-04-01 01:03:00 +08:00
parent b54b794264
commit 6d6e0a1bfe
3 changed files with 12 additions and 12 deletions

View File

@ -26,7 +26,7 @@
name: 'AboutPage',
components: { Description, PageWrapper },
setup() {
const { pkg, lastBuildTime } = window.__APP_INFO__;
const { pkg, lastBuildTime } = __APP_INFO__;
const { dependencies, devDependencies, name, version } = pkg;

19
types/global.d.ts vendored
View File

@ -7,19 +7,18 @@ import type {
} from 'vue';
declare global {
declare interface __APP_INFO__ {
pkg: {
name: string;
version: string;
dependencies: Recordable<string>;
devDependencies: Recordable<string>;
};
lastBuildTime: string;
}
declare interface Window {
// Global vue app instance
__APP__: App<Element>;
__APP_INFO__: {
pkg: {
name: string;
version: string;
dependencies: Recordable<string>;
devDependencies: Recordable<string>;
};
lastBuildTime: string;
};
}
// vue

View File

@ -12,8 +12,9 @@ import { OUTPUT_DIR } from './build/constant';
import pkg from './package.json';
import moment from 'moment';
const { dependencies, devDependencies, name, version } = pkg;
const APP_INFO = {
pkg,
pkg: { dependencies, devDependencies, name, version },
lastBuildTime: moment().format('YYYY-MM-DD HH:mm:ss'),
};