ngcc.js 1.27 KB
Newer Older
CED SA's avatar
CED SA committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
const cp = require('child_process');
const ph = require('path');
const os = require('os');

const libraries = [
  /* ph.join(__dirname, `node_modules`, `@telerik`, `kendo-draggable`),
  ph.join(__dirname, `node_modules`, `@progress`, 'kendo-popup-common'),
  ph.join(__dirname, `node_modules`, `@progress`, `kendo-angular-common`),
  ph.join(__dirname, `node_modules`, `@progress`, `kendo-angular-l10n`),
  ph.join(__dirname, `node_modules`, `@progress`, `kendo-angular-popup`),
  ph.join(__dirname, `node_modules`, `@progress`, `kendo-angular-menu`), */
  ph.join(__dirname, `node_modules`, `@progress`, `kendo-angular-indicators`),
];

const CMD = os.platform() === 'win32' ? `pnpx.cmd` : `pnpx`;

// --loglevel debug --async false --create-ivy-entry-points --first-only

libraries.forEach(function (lib) {
  //  `--properties`, `es2015`, `browser`, `module`, `main`
  const ARGS = [`ngcc`, `--source`, lib, `--loglevel`, `debug`];

  const RES = cp.spawnSync(CMD, ARGS);

  console.log(`status -->`, RES.status);

  if (RES.status !== 0) {
    if (RES.error) {
      console.error(RES.error.toString());
    }

    if (RES.stderr) {
      console.error(RES.stderr.toString());
    }

    process.exit(1);
  } else {
    if (RES.stdout) {
      console.info(RES.stdout.toString());
    }
  }
});