From ecd52fffb08956d3e46e1fd4d287d3042cb4343f Mon Sep 17 00:00:00 2001 From: Jay Fong Date: Tue, 2 Apr 2019 10:55:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(taro-cli):=20=E6=B7=BB=E5=8A=A0=20process.?= =?UTF-8?q?env.TARO=5FENV=20=E7=9A=84=20TypeScript=20=E5=AE=9A=E4=B9=89=20?= =?UTF-8?q?(#2663)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/templates/default/globaldts | 8 ++++++++ packages/taro-cli/templates/mobx/globaldts | 10 +++++++++- packages/taro-cli/templates/redux/globaldts | 8 ++++++++ packages/taro-cli/templates/wxcloud/client/globaldts | 8 ++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/taro-cli/templates/default/globaldts b/packages/taro-cli/templates/default/globaldts index 542ea72843cd..6e7bc51dcf1e 100644 --- a/packages/taro-cli/templates/default/globaldts +++ b/packages/taro-cli/templates/default/globaldts @@ -8,3 +8,11 @@ declare module "*.less"; declare module "*.scss"; declare module "*.sass"; declare module "*.styl"; + +// @ts-ignore +declare const process: { + env: { + TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt'; + [key: string]: any; + } +} diff --git a/packages/taro-cli/templates/mobx/globaldts b/packages/taro-cli/templates/mobx/globaldts index 8406dbdaa043..22d1e7775285 100644 --- a/packages/taro-cli/templates/mobx/globaldts +++ b/packages/taro-cli/templates/mobx/globaldts @@ -13,4 +13,12 @@ declare namespace JSX { interface IntrinsicElements { 'import': React.DetailedHTMLProps, HTMLEmbedElement> } -} \ No newline at end of file +} + +// @ts-ignore +declare const process: { + env: { + TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt'; + [key: string]: any; + } +} diff --git a/packages/taro-cli/templates/redux/globaldts b/packages/taro-cli/templates/redux/globaldts index 542ea72843cd..6e7bc51dcf1e 100644 --- a/packages/taro-cli/templates/redux/globaldts +++ b/packages/taro-cli/templates/redux/globaldts @@ -8,3 +8,11 @@ declare module "*.less"; declare module "*.scss"; declare module "*.sass"; declare module "*.styl"; + +// @ts-ignore +declare const process: { + env: { + TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt'; + [key: string]: any; + } +} diff --git a/packages/taro-cli/templates/wxcloud/client/globaldts b/packages/taro-cli/templates/wxcloud/client/globaldts index 542ea72843cd..6e7bc51dcf1e 100644 --- a/packages/taro-cli/templates/wxcloud/client/globaldts +++ b/packages/taro-cli/templates/wxcloud/client/globaldts @@ -8,3 +8,11 @@ declare module "*.less"; declare module "*.scss"; declare module "*.sass"; declare module "*.styl"; + +// @ts-ignore +declare const process: { + env: { + TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt'; + [key: string]: any; + } +}