3

I'm using the Angular CLI to build/package my component library, and I wanted to include the README.md from the root of the project instead of the file from the projects folder.

So I wanted to see if the builder had any configuration options, but there aren't any published on the wiki.

This is what I found: https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_ng_packagr/README.md

I want to add options to my angular.json for building the library.

        "build": {
          "builder": "@angular-devkit/build-ng-packagr:build",
          "options": {
            "tsConfig": "library/tsconfig.lib.json",
            "project": "library/ng-package.json",
            // add options here!
          }
        },

There is no wiki on documentation on the packagr repo.

https://github.com/ng-packagr/ng-packagr

My other option was to look at the JSON schema for this builder, but I do not know how to read it.

Does the ngPackagr have configurable options for the builder?

Reactgular
  • 52,335
  • 19
  • 158
  • 208

1 Answers1

0

It only appears to support a watch parameter for the configuration. The schema is located here:

https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_ng_packagr/src/build/schema.json

Looking at the source code there aren't any other options either (watch isn't use in the code).

async function initialize(
  options: NgPackagrBuilderOptions,
  root: string,
): Promise<import ('ng-packagr').NgPackagr> {
  const packager = (await import('ng-packagr')).ngPackagr();

  packager.forProject(resolve(root, options.project));

  if (options.tsConfig) {
    packager.withTsConfig(resolve(root, options.tsConfig));
  }

  return packager;
}

https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_ng_packagr/src/build/index.ts

Reactgular
  • 52,335
  • 19
  • 158
  • 208