From aaa939cf877fa01bb8b6ba39114772b390c460f7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 13 Feb 2017 14:57:04 +0800 Subject: [PATCH] refactor version import --- components/version/index.tsx | 4 ++-- typings/custom-typings.d.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/version/index.tsx b/components/version/index.tsx index efc6dd2241..be283a3e94 100644 --- a/components/version/index.tsx +++ b/components/version/index.tsx @@ -1,3 +1,3 @@ -import * as pkg from '../../package.json'; +import { version } from '../../package.json'; -export default (pkg as any).version; +export default version; diff --git a/typings/custom-typings.d.ts b/typings/custom-typings.d.ts index 94ac115e8e..7e1ecb056a 100644 --- a/typings/custom-typings.d.ts +++ b/typings/custom-typings.d.ts @@ -86,5 +86,6 @@ declare var process: { declare module "*.json" { const value: any; + export const version: string; export default value; }