Ser*_*tin 6 typescript typescript-typings
我使用了一个npm模块web3@1.0.0-beta.24,它在index.d.ts文件中有一些错误.
我想忽略TS编译器的这个文件(node_modules/web3/index.d.ts),我想使用我自己的类型文件.
但是tsc仍然使用这个错误的文件,无法编译我的项目.
这是我的tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true
},
"exclude": ["node_modules/web3/index.d.ts"]
}
Run Code Online (Sandbox Code Playgroud)
如果我手动删除node_modules/web3/index.d.ts,tsc编译我的项目.
如何为tsc排除此文件?
我用最少的代码创建了一个repo来重现这个问题:https: //github.com/serge-nikitin/q1
t7y*_*ang 14
尝试将此选项添加到tsconfig.json以忽略编译时检查的lib声明文件.
{
"compilerOptions": {
"skipLibCheck": true
},
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4083 次 |
| 最近记录: |