How to use the ng-packagr.ngPackagr function in ng-packagr

To help you get started, we’ve selected a few ng-packagr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scttcper / ngx-color / build.ts View on Github external
async function main() {
  // cleanup dist
  del.sync(join(process.cwd(), '/dist'));
  del.sync(join(process.cwd(), '/node_modules/ngx-color'));

  await ngPackagr()
    .forProject(join(process.cwd(), 'src/lib/common/package.json'))
    .build();

  // put it in node modules so the path resolves
  // proper path support eventually
  copySync(
    join(process.cwd(), '/dist/common'),
    join(process.cwd(), '/node_modules/ngx-color'),
  );
  copySync(
    join(process.cwd(), '/dist/common'),
    join(process.cwd(), '/dist/packages-dist'),
  );

  // build each package
  for (const m of MODULE_NAMES) {
github microsoft / angular-react / libs / fabric / build.ts View on Github external
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import * as path from 'path';
import { ngPackagr } from 'ng-packagr';

ngPackagr()
  .forProject(path.resolve(__dirname, 'package.json'))
  .withTsConfig(path.resolve(__dirname, 'tsconfig-custom.json'))
  .build();
github microsoft / angular-react / libs / semantic-ui / build.ts View on Github external
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import * as path from 'path';
import { ngPackagr } from 'ng-packagr';

ngPackagr()
  .forProject(path.resolve(__dirname, 'package.json'))
  .withTsConfig(path.resolve(__dirname, 'tsconfig-custom.json'))
  .build();
github angulartics / angulartics2 / build.ts View on Github external
.forProject(join(process.cwd(), 'src/lib/core/package.json'))
    .build();

  // put it in node modules so the path resolves
  // proper path support eventually
  copySync(
    join(process.cwd(), '/dist/core'),
    join(process.cwd(), '/node_modules/angulartics2'),
  );
  copySync(
    join(process.cwd(), '/dist/core'),
    join(process.cwd(), '/dist/packages-dist'),
  );

  for (const m of CORE_MODULE_NAMES) {
    await ngPackagr()
      .forProject(join(process.cwd(), `src/lib/${m}/package.json`))
      .build();
  }

  // build each provider
  for (const m of MODULE_NAMES) {
    await ngPackagr()
      .forProject(join(process.cwd(), `src/lib/providers/${m}/package.json`))
      .build();
  }

  copySync('README.md', join(process.cwd(), 'dist/packages-dist/README.md'));
  copySync('LICENSE', join(process.cwd(), 'dist/packages-dist/LICENSE'));
}
github angulartics / angulartics2 / build.ts View on Github external
async function main() {
  // cleanup dist
  rimraf.sync(join(process.cwd(), '/dist'));
  rimraf.sync(join(process.cwd(), '/node_modules/angulartics2'));

  await ngPackagr()
    .forProject(join(process.cwd(), 'src/lib/core/package.json'))
    .build();

  // put it in node modules so the path resolves
  // proper path support eventually
  copySync(
    join(process.cwd(), '/dist/core'),
    join(process.cwd(), '/node_modules/angulartics2'),
  );
  copySync(
    join(process.cwd(), '/dist/core'),
    join(process.cwd(), '/dist/packages-dist'),
  );

  for (const m of CORE_MODULE_NAMES) {
    await ngPackagr()
github TypeCtrl / ngx-emoji-mart / build.ts View on Github external
async function main() {
  // cleanup dist
  del.sync(join(process.cwd(), '/dist'));
  del.sync(join(process.cwd(), '/node_modules/@ctrl/ngx-emoji-mart'));

  // make emoi
  await ngPackagr()
    .forProject(join(process.cwd(), 'src/lib/emoji/package.json'))
    .build();

  // put it in node modules so the path resolves
  // proper path support eventually
  copySync(
    join(process.cwd(), '/dist/emoji'),
    join(process.cwd(), '/node_modules/@ctrl/ngx-emoji-mart/ngx-emoji'),
  );
  copySync(
    join(process.cwd(), '/dist/emoji'),
    join(process.cwd(), '/dist/packages-dist/ngx-emoji'),
  );

  await ngPackagr()
    .forProject(join(process.cwd(), 'src/lib/picker/package.json'))
github ngxs-labs / data / tools / build.ts View on Github external
async function buildPackage(): Promise {
    try {
        await ngPackagr()
            .forProject(join(__dirname, '../src/package.json'))
            .withTsConfig(join(__dirname, '../src/tsconfig.lib.json'))
            .build();
    } catch (e) {
        console.log(e);
    }
}
github fulls1z3 / ngx-cache / tools / build / packager.ts View on Github external
import { ngPackagr } from 'ng-packagr';

import { root } from './helpers';

ngPackagr()
  .forProject(root(`./packages/@ngx-cache/${process.argv[2]}/ng-package.json`))
  .withTsConfig(root('./tools/build/tsconfig.package.json'))
  .build()
  .catch(() => (process.exitCode = 1));
github fulls1z3 / ngx-config / tools / build / packager.ts View on Github external
import { ngPackagr } from 'ng-packagr';

import { root } from './helpers';

ngPackagr()
  .forProject(root(`./packages/@ngx-config/${process.argv[2]}/ng-package.json`))
  .withTsConfig(root('./tools/build/tsconfig.package.json'))
  .build()
  .catch(() => (process.exitCode = 1));