Configuring ng-packagr in "package.json" is deprecated

Viewed 2595

While building an angular 13 package with sub entries, I'm getting the warning below.

Building Angular Package
WARNING: Found configuration in ...<PATH_TO_PACKAGE>/package.json.
Configuring ng-packagr in "package.json" is deprecated. Use "ng-package.json" instead.

All the relevant info derived from ng version

Angular CLI: 13.0.4
Node: 16.13.0
Package Manager: yarn 1.22.17
OS: linux x64

Angular: 13.0.3
... animations, cdk, common, compiler, compiler-cli, core
... elements, forms, language-service, material
... material-moment-adapter, platform-browser
... platform-browser-dynamic, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1300.3
@angular-devkit/build-angular   13.0.4
@angular-devkit/core            13.0.3
@angular-devkit/schematics      13.0.3
@angular/cli                    13.0.4
@schematics/angular             13.0.4
ng-packagr                      13.0.8
rxjs                            7.4.0
typescript                      4.4.4

Any idea if this is a false positive or how to tackle it since official ng-packagr documentation does not mention that usage of ng-packagr inside package.json is deprecated.

2 Answers

You need to extract this from package.json

{
  "ngPackage": {
    "lib": {
      "entryFile": "public-api.ts",
    }
  }
}

to a new file ng-package.json this:

{
  "lib": {
    "entryFile": "public-api.ts"
  }
}

Checked in my library, works for me!

Related