且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Visual Studio 2017 Office加载项TypeScript项目中实现Polyfill Promise

更新时间:2022-12-07 20:10:52

通过将以下lib属性添加到 tsconfig.json 文件的compilerOptions对象中,可以解决此类问题:

Seems like this can be resolved by adding the following lib property to the compilerOptions object your tsconfig.json file:

"lib": [ "es5", "dom", "es2015.promise" ]

换句话说,将您的 ts.config 文件的内容更新为如下所示:

In other words, update the contents of your ts.config file to look like this:

{
  "compilerOptions": {
    "skipLibCheck": true,
    "moduleResolution": "node",
    "lib": [ "es5", "dom", "es2015.promise" ]
  },
  "exclude": [
    "node_modules"
  ]
}