码迷,mamicode.com
首页 > 其他好文 > 详细

[Typescript] Installing Promise Type Definitions Using the lib Built-In Types

时间:2018-02-03 12:39:11      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:targe   uil   promise   init   es5   client   es6   null   back   

To fix Promise is not recolized in TypeScript, we can choose to use a lib:

npm i @types/es6-promise

 

we can also use built-in libs:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": true,
        "sourceMap": true,
        "strictNullChecks": true,
        "noEmitOnError": true,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "lib": ["es6"],
        "skipLibCheck": true
    },
    "exclude": [
      "client/node_modules"
    ]
}

Inside "es6" have Promise already, so that we don‘t need to install other devdependices.

 

[Typescript] Installing Promise Type Definitions Using the lib Built-In Types

标签:targe   uil   promise   init   es5   client   es6   null   back   

原文地址:https://www.cnblogs.com/Answer1215/p/8408483.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!