Skip to content

Commit

Permalink
feat(taro-cli): 添加 process.env.TARO_ENV 的 TypeScript 定义 (#2663)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k authored and luckyadam committed Apr 2, 2019
1 parent 79a43c4 commit ecd52ff
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/taro-cli/templates/default/globaldts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
10 changes: 9 additions & 1 deletion packages/taro-cli/templates/mobx/globaldts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ declare namespace JSX {
interface IntrinsicElements {
'import': React.DetailedHTMLProps<React.EmbedHTMLAttributes<HTMLEmbedElement>, HTMLEmbedElement>
}
}
}

// @ts-ignore
declare const process: {
env: {
TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt';
[key: string]: any;
}
}
8 changes: 8 additions & 0 deletions packages/taro-cli/templates/redux/globaldts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
8 changes: 8 additions & 0 deletions packages/taro-cli/templates/wxcloud/client/globaldts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit ecd52ff

Please sign in to comment.