How to use ng-packagr - 10 common examples

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 scttcper / ngx-trend / build.ts View on Github external
async function main() {
  // make common
  await build({
    project: join(process.cwd(), 'src/lib/package.json'),
  });

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

  // build packages
  await build({
    project: join(process.cwd(), 'src/lib/package.json'),
  });

  // copy everything else
  copySync('README.md', join(process.cwd(), 'dist/README.md'));
  copySync('LICENSE', join(process.cwd(), 'dist/LICENSE'));
  copySync(
    join(process.cwd(), 'src/lib/toastr-bs4-alert.scss'),
    join(process.cwd(), 'dist/toastr-bs4-alert.scss'),
  );
  copySync(
    join(process.cwd(), 'src/lib/toastr.css'),
    join(process.cwd(), 'dist/toastr.css'),
  );
  copySync(
    join(process.cwd(), 'src/lib/toastr-old.css'),
github scttcper / ng2-adsense / build.ts View on Github external
async function main() {
  // build package
  await build({
    project: join(process.cwd(), 'src/lib/package.json'),
  });

  // copy everything else
  copySync('README.md', join(process.cwd(), 'dist/README.md'));
  copySync('LICENSE', join(process.cwd(), 'dist/LICENSE'));
}
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);
    }
}