How to use the @angular-devkit/build-angular/src/angular-cli-files/utilities/stats.generateBundleStats 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 enten / udk / angular / lib / build / ng-devkit.ts View on Github external
if (result.downlevel) {
            bundleInfoText +=
              '\n' + generateBundleInfoStats(result.name, result.downlevel, chunk);
          }
        }

        if (webpackStats && webpackStats.chunks) {
          for (const chunk of webpackStats.chunks) {
            if (processedNames.has(chunk.id.toString())) {
              continue;
            }

            const asset =
              webpackStats.assets && webpackStats.assets.find(a => a.name === chunk.files[0]);
            bundleInfoText +=
              '\n' + generateBundleStats({ ...chunk, size: asset && asset.size }, true);
          }
        }

        bundleInfoText +=
          '\n' +
          generateBuildStats(
            (webpackStats && webpackStats.hash) || '',
            Date.now() - startTime,
            true,
          );
        context.logger.info(bundleInfoText);
        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 }));
github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
function generateBundleInfoStats(
          id: string | number,
          bundle: ProcessBundleFile,
          chunk: ArrayElement | undefined,
        ): string {
          return generateBundleStats(
            {
              id,
              size: bundle.size,
              files: bundle.map ? [bundle.filename, bundle.map.filename] : [bundle.filename],
              names: chunk && chunk.names,
              entry: !!chunk && chunk.names.includes('runtime'),
              initial: !!chunk && chunk.initial,
              rendered: true,
            },
            true,
          );
        }

@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