How to use the @angular-devkit/build-angular/src/angular-cli-files/utilities/stats.statsToString 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 / udk-builder.js View on Github external
const statsConfig = getWebpackStatsConfig(verbose);
    statsConfig.colors = supportsColor.stdout;

    const statsTitle = 'Child: ' + stats.compilation.name + (verbose ? '\n' : '');

    if (verbose) {
      const jsonString = stats.toString(statsConfig)
        .split('\n')
        .map(line => '  ' + line)
        .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 / ng-devkit.ts View on Github external
}

      return statsJson;
    };

    const configName = stats.compilation.compiler.name;
    let statsTitle = '';
    if (configName) {
      statsTitle = 'Name: '
        + (options.colors ? terminal.bold(configName) : configName)
        + (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 / build / ng-devkit.ts View on Github external
}

      return statsJson;
    };

    const configName = stats.compilation.compiler.name;
    let statsTitle = '';
    if (configName) {
      statsTitle = 'Name: '
        + (options.colors ? terminal.bold(configName) : configName)
        + (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 2 days ago

Package Health Score

94 / 100
Full package analysis

Popular @angular-devkit/build-angular functions