How to use the @angular-devkit/build-webpack/src/utils.getEmittedFiles function in @angular-devkit/build-webpack

To help you get started, we’ve selected a few @angular-devkit/build-webpack 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 enten / udk / angular / lib / ng-devkit.ts View on Github external
(multiStats as { stats: webpack.Stats[] }).stats.forEach((stats, statsIndex) => {
    const config = (multiConfig as webpack.Configuration[])[statsIndex];

    // Collect server emitted files
    if (config.target === 'node') {
      result.serverEmittedFiles = getEmittedFiles(stats.compilation) as UdkBuilderEmittedFile[];
    // Collect browser es6 emitted files
    } else if (statsIndex === 0) {
      result.browserES6EmittedFiles = getEmittedFiles(stats.compilation) as UdkBuilderEmittedFile[];
    // Collect browser es5 emitted files
    } else if (statsIndex === 1) {
      result.browserES5EmittedFiles = getEmittedFiles(stats.compilation) as UdkBuilderEmittedFile[];
    // If code below run, it's mean that devkit has changed and generates more browser configs
    } else {
      throw new Error('BREAKING CHANGE DETECTED! Universal config must have 2 or 3 childs');
    }
  });
github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
) {
  const [ browserStats, serverStats ] = multiStats.stats;

  const success = !multiStats.hasErrors();
  const browserSuccess = !browserStats.hasErrors();
  const serverSuccess = !serverStats.hasErrors();

  return {
    success,
    hash: multiStats.hash,
    browserSuccess,
    browserStats,
    browserEmittedFiles: getEmittedFiles(browserStats.compilation),
    serverSuccess,
    serverStats,
    serverEmittedFiles: getEmittedFiles(serverStats.compilation),
  } as UniversalCompilationOutput;
}
github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
export function createUniversalCompilationOutput(
  multiStats: webpack.compilation.MultiStats & { hasErrors: () => boolean; },
) {
  const [ browserStats, serverStats ] = multiStats.stats;

  const success = !multiStats.hasErrors();
  const browserSuccess = !browserStats.hasErrors();
  const serverSuccess = !serverStats.hasErrors();

  return {
    success,
    hash: multiStats.hash,
    browserSuccess,
    browserStats,
    browserEmittedFiles: getEmittedFiles(browserStats.compilation),
    serverSuccess,
    serverStats,
    serverEmittedFiles: getEmittedFiles(serverStats.compilation),
  } as UniversalCompilationOutput;
}