@gpaucot/build-ng-packagr
TypeScript icon, indicating that this package has built-in type declarations

9.0.4 • Public • Published

Angular Build Architect for ng-packagr

This is a modified version of the official build-ng-packagr builder to include a post-processing.

Configuration

The post-build.js file must be in the same folder as ng-package.json Example to copy all scss files to output:

// The postBuild function MUST return a promise.

const { copyAssets } = require('@angular-devkit/build-angular/src/utils/copy-assets');
const path = require('path');

module.exports = async function postBuild(options, context) {
    let metadata = await context.getProjectMetadata(context.target.project);
    await copyAssets(
        [
            {
                glob: '**/*.scss',
                ignore: ['**/demo/*', '**/demo/**/*'],
                input: metadata.sourceRoot,
                output: '',
            },
        ],
        [path.resolve(context.workspaceRoot, 'dist', context.target.project)],
        context.workspaceRoot
    );
};

v9.0.2

  • Compatibility from v9 and up

v9.0.1

  • post-build.js support

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @gpaucot/build-ng-packagr

      Weekly Downloads

      1

      Version

      9.0.4

      License

      MIT

      Unpacked Size

      42.9 kB

      Total Files

      14

      Last publish

      Collaborators

      • gpaucot