I am trying to create what I believe is called a secondary entry point into my angular npm package. I want the following two entry points
@scope/data-service
@sc
Example Folder Layout for Secondary Entrypoints
All you have to do is create a
package.json
file and put it where you want a secondary entry point to be created. One way this can be done is by mimicking the folder structure of the following example which has a testing entry point in addition to its main entry point.my_package ├── src | ├── public_api.ts | └── *.ts ├── ng-package.json ├── package.json └── testing ├── src | ├── public_api.ts | └── *.ts └── package.json
The contents of
my_package/testing/package.json
can be as simple as:{ "ngPackage": {} }
No, that is not a typo. No name is required. No version is required. It's all handled for you by ng-packagr! When built, the primary entry point is imported by
import {..} from '@my/library'
and the secondary entry point withimport {..} from '@my/library/testing'
Source - https://github.com/ng-packagr/ng-packagr/blob/master/docs/secondary-entrypoints.md