当一个模块没有默认导出

allowSyntheticDefaultImports

tsconfig.json

"esModuleInterop": true, // 发出额外的JavaScript以缓解对导入CommonJS模块的支持。这使得允许SyntheticDefaultImports的类型兼容。
"allowSyntheticDefaultImports": true // 当一个模块没有默认导出时,允许 "import x from y"。

see

https://www.typescriptlang.org/tsconfig#esModuleInterop

posted @ 2021-10-29 16:43  develon  阅读(499)  评论(0编辑  收藏  举报