How to use the @angular-devkit/build-angular/src/angular-cli-files/utilities/stats.statsErrorsToString function in @angular-devkit/build-angular

To help you get started, we’ve selected a few @angular-devkit/build-angular 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 just-jeb / electron-angular-native / custom-builders / src / custom-webpack / index.ts View on Github external
(stats, config, logger) => {
    // config.stats contains our own stats settings, added during buildWebpackConfig().
    const json = stats.toJson(config.stats);
    if (verbose) {
      logger.info(stats.toString(config.stats));
    } else {
      logger.info(statsToString(json, config.stats));
    }

    if (stats.hasWarnings()) {
      logger.warn(statsWarningsToString(json, config.stats));
    }
    if (stats.hasErrors()) {
      logger.error(statsErrorsToString(json, config.stats));
    }
  };
github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
// ...event,
      success,
      error,
      baseOutputPath,
      outputPath: baseOutputPath,
      outputPaths: outputPaths && Array.from(outputPaths.values()) || [baseOutputPath],
    } as BrowserBuilderOutput);

    if (!success && useBundleDownleveling) {
      // If using bundle downleveling then there is only one build
      // If it fails show any diagnostic messages and bail
      if (webpackStats && webpackStats.warnings.length > 0) {
        context.logger.warn(statsWarningsToString(webpackStats, { colors: true }));
      }
      if (webpackStats && webpackStats.errors.length > 0) {
        context.logger.error(statsErrorsToString(webpackStats, { colors: true }));
      }

      return finalize(success);
    } else if (success) {
      outputPaths = ensureOutputPaths(baseOutputPath, i18n);

      let noModuleFiles: EmittedFiles[] | undefined;
      let moduleFiles: EmittedFiles[] | undefined;
      let files: EmittedFiles[] | undefined;

      const scriptsEntryPointName = normalizeExtraEntryPoints(
        options.scripts || [],
        'scripts',
      ).map(x => x.bundleName);

      if (isDifferentialLoadingNeeded && options.watch) {
github enten / udk / angular / lib / udk-builder.js View on Github external
.join('\n');

      this.context.logger.info(statsTitle + jsonString);
    } else {
      const json = stats.toJson(statsConfig);
      const jsonString = statsToString(json, statsConfig)
        .split('\n')
        .map(line => '  ' + line)
        .join('\n');

      this.context.logger.info(statsTitle + jsonString);
      if (stats.hasWarnings()) {
        this.context.logger.warn(statsWarningsToString(json, statsConfig));
      }
      if (stats.hasErrors()) {
        this.context.logger.error(statsErrorsToString(json, statsConfig));
      }
    }
  }
}
github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
+ (options.verbose ? '\n' : '');
    }

    const statsString = options.verbose
      ? stats.toString(statsToOptions)
      : statsToString(getStatsJson(), statsToOptions);

    logger.info(statsTitle + statsString);

    if (!options.verbose) {
      if (stats.hasWarnings()) {
        logger.warn(statsWarningsToString(getStatsJson(), statsToOptions));
      }

      if (stats.hasErrors()) {
        logger.error(statsErrorsToString(getStatsJson(), statsToOptions));
      }
    }

    logger.info('');
  };
github enten / udk / angular / lib / ng-devkit.ts View on Github external
+ (options.verbose ? '\n' : '');
    }

    const statsString = options.verbose
      ? stats.toString(statsToOptions)
      : statsToString(getStatsJson(), statsToOptions);

    logger.info(statsTitle + statsString);

    if (!options.verbose) {
      if (stats.hasWarnings()) {
        logger.warn(statsWarningsToString(getStatsJson(), statsToOptions));
      }

      if (stats.hasErrors()) {
        logger.error(statsErrorsToString(getStatsJson(), statsToOptions));
      }
    }

    logger.info('');
  };

@angular-devkit/build-angular

Angular Webpack Build Facade

MIT
Latest version published 3 days ago

Package Health Score

100 / 100
Full package analysis

Popular @angular-devkit/build-angular functions