为了尝试驯服Vannila TypeScript,我创建了一个暴露接口的npm包:
https://github.com/quantumjs/vanilla-typescript/blob/master/interfaces/IComponent.ts(A)
现在我也在其他npm模块中使用此接口:
https://github.com/quantumjs/smart-terminal/blob/master/src/SmartTerminal.ts#L1(B)
最后我有另一个依赖于B的项目(C)。但是,如果我使用C和typescript,如果我尝试导入B,它会抱怨模块A丢失:
https://github.com/quantumjs/quantumjs.github.io/blob/master/package.json#L48 https://github.com/quantumjs/quantumjs.github.io/blob/master/src/index.ts#L3
不导入模块A:
https://github.com/quantumjs/quantumjs.github.io/blob/master/package.json#L42
有比这更好的解决方案吗?