WARNING: No name was provided for external module 'moment' in output.globals – guessing 'momentImported'
WARNING: No name was provided for external module 'odata-parser' in output.globals – guessing 'parser'
I receive this message when I try to bundle my library to Universal Module Definition. The warning can be fixed by adding umdModuleIds in ng-package.json.
The documentation gives us the following explanation:
When writing the UMD bundle, ng-packagr does its best to provide common default values for the UMD module identifiers. Also, rollup will do its best to guess the module ID of an external dependency. Even then, you should make sure that the UMD module identifiers of the external dependencies are correct. In case ng-packagr doesn't provide a default and rollup is unable to guess the correct identifier, you should explicitly provide the module identifier by using umdModuleIds in the library's package file section like so: ...
umdModuleIds
:
A map of external dependencies and their correspondent UMD module identifiers. Map keys are TypeScript / EcmaScript module identifiers. Map values are UMD module ids. The purpose of this map is to correctly bundle an UMD module file (with
rollup
). By default,rxjs
,tslib
and@angular/*
dependency symbols are supported.
How can I find or check for correctness the UMD ID of moment, odata-parser or any other module that must be added to the umdModuleIds?
@mycompany/product-name/ui-module-name
as I've tried"@mycompany/product-name/ui-module-name": "mycompany['product-name']['ui-module-name']
to no avail, with the warning beingNo name was provided for external module '@mycompany/product-name/ui-module-name' in output.globals – guessing 'uiModuleName'
– Maria