1. 程式人生 > >Angular No name was provided for external module 'XXX' in output.globals 錯誤

Angular No name was provided for external module 'XXX' in output.globals 錯誤

Angular 7 開發自定義庫時,引用ngZorroAntd,build過程中出現

No name was provided for external module 'ng-zorro-antd' in output.globals – guessing 'ngZorroAntd' 錯誤 

解決方法: 

在庫所在目錄的ng-package.json中,填加紅色部分

{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/test-lib",
"lib": {
"entryFile": "src/public_api.ts",
"umdModuleIds": {

"ng-zorro-antd": "^7.0.0-rc.1"
}
}
}