We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用tsc给js项目生成声明文件时(d.ts)抛出这个错误。 tsc --declaration lib/index.js --allowJs --emitDeclarationOnly --declarationDir dts
tsc --declaration lib/index.js --allowJs --emitDeclarationOnly --declarationDir dts
原因是commonjs模块,使用class声明两个类并导出了(exports):
class A {} class B {} module.exports = { A, B, }
两个方式可绕开这个问题: 改成
class A {} class B {} module.exports.A = A module.exports.B = B
或者改成
const A = class {} const B = class {} module.exports = { A, B, }
typescript版本: 4.1.3
相关issue microsoft/TypeScript#37832
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用tsc给js项目生成声明文件时(d.ts)抛出这个错误。
tsc --declaration lib/index.js --allowJs --emitDeclarationOnly --declarationDir dts
原因是commonjs模块,使用class声明两个类并导出了(exports):
两个方式可绕开这个问题:
改成
或者改成
typescript版本: 4.1.3
相关issue microsoft/TypeScript#37832
The text was updated successfully, but these errors were encountered: