cyrilletuzi / angular-async-local-storage

Efficient client-side storage for Angular: simple API + performance + Observables + validation
MIT License
676 stars 68 forks source link

WARNING: No name was provided for external module in Angular 9 #285

Closed ochibooh closed 4 years ago

ochibooh commented 4 years ago

Getting warning when building a library in Angular 9

WARNING: No name was provided for external module '@ngx-pwa/local-storage' in output.globals – guessing 'localStorage'

ochibooh commented 4 years ago

Fixed by adding umdModuleIds in ng-package.json

{
  "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
  "dest": "../../dist/my-lib",
  "lib": {
    "entryFile": "src/public-api.ts",
    "umdModuleIds": {
      "my-lib": "my-lib",
      "@ngx-pwa/local-storage": "@ngx-pwa/local-storage"
    }
  }
}
cyrilletuzi commented 4 years ago

Hi @ochibooh Thanks for your feedback.

While you found a workaround, this lib is strictly following Angular Package Format and is built with official Angular tooling (ie. CLI & ng-packagr). As it's just a warning, maybe it's not important (several warnings in ng-packagr build steps are false positives), but it doesn't seem right. So I encourage you to open an issue in ng-packagr repo.