Angular 9构建错误自定义命名导出



我有一个Angular 9.0项目。

我用这个命令创建新的库:

CCD_ 2。

当我为构建执行命令ng b @scope/xxx时,我遇到了以下错误:

[error] Error: Custom named exports were specified for E:...distscopexxxfesm5scope-xxx.js but it does not appear to be a CommonJS module

如何修复这个错误?

这很奇怪,但这个解决方案很有用。

我将"module": "es2015"添加到tsconfig.lib.json文件库的compilerOptions部分。

并修复了错误。

最新更新