[Angular]: Warning: No name was provided for external module '@clr/angular' in output.globals – guessing 'i1'

Viewed 239

I'm creating a library in Angular, and it requires dependency to @clr/angular. In my module.ts, I have imported ClarityModule.

import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ClarityModule } from '@clr/angular';

@NgModule({
  declarations: [CloseBtnComponent],
  imports: [
    CommonModule, FormsModule, ClarityModule
  ],
  exports: [CloseBtnComponent]
})

In my package.json, I've added both @clr/angular and @clr/icons.

{
  "name": "close-btn",
  "version": "0.0.1",
  "peerDependencies": {
    "@angular/common": "^11.2.6",
    "@angular/core": "^11.2.6",
    "@clr/angular": "^5.1.1",
    "@clr/icons": "^5.1.1"
  },
  "dependencies": {
    "tslib": "^2.0.0"    
  }
}

In my ng-package.json

{
  "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
  "dest": "../../dist/close-btn",
  "lib": {
    "entryFile": "src/public-api.ts"
  }
}

When I run command ng build close-btn, I got the following warning

enter image description here

It seems that I have to add something like this inside ng-package.json. But I'm not sure whether this is the right way, whether to put clr-angular or something else. Am I doing right or is there any best practice on this matter?

"umdModuleIds": {
  "@clr/angular": "clr-angular"
}
0 Answers
Related