提交 6d6e0a1b 作者: Vben

fix(build): fix build error

上级 b54b7942
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
name: 'AboutPage', name: 'AboutPage',
components: { Description, PageWrapper }, components: { Description, PageWrapper },
setup() { setup() {
const { pkg, lastBuildTime } = window.__APP_INFO__; const { pkg, lastBuildTime } = __APP_INFO__;
const { dependencies, devDependencies, name, version } = pkg; const { dependencies, devDependencies, name, version } = pkg;
......
...@@ -7,11 +7,7 @@ import type { ...@@ -7,11 +7,7 @@ import type {
} from 'vue'; } from 'vue';
declare global { declare global {
declare interface Window { declare interface __APP_INFO__ {
// Global vue app instance
__APP__: App<Element>;
__APP_INFO__: {
pkg: { pkg: {
name: string; name: string;
version: string; version: string;
...@@ -19,7 +15,10 @@ declare global { ...@@ -19,7 +15,10 @@ declare global {
devDependencies: Recordable<string>; devDependencies: Recordable<string>;
}; };
lastBuildTime: string; lastBuildTime: string;
}; }
declare interface Window {
// Global vue app instance
__APP__: App<Element>;
} }
// vue // vue
......
...@@ -12,8 +12,9 @@ import { OUTPUT_DIR } from './build/constant'; ...@@ -12,8 +12,9 @@ import { OUTPUT_DIR } from './build/constant';
import pkg from './package.json'; import pkg from './package.json';
import moment from 'moment'; import moment from 'moment';
const { dependencies, devDependencies, name, version } = pkg;
const APP_INFO = { const APP_INFO = {
pkg, pkg: { dependencies, devDependencies, name, version },
lastBuildTime: moment().format('YYYY-MM-DD HH:mm:ss'), lastBuildTime: moment().format('YYYY-MM-DD HH:mm:ss'),
}; };
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论