How to use the @parcel/utils.prettifyTime function in @parcel/utils

To help you get started, we’ve selected a few @parcel/utils 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 parcel-bundler / parcel / packages / reporters / cli / src / BundleReport.js View on Github external
for (let asset of bundle.largestAssets) {
      // Add a row for the asset.
      rows.push(
        
          
            {asset == bundle.largestAssets[bundle.largestAssets.length - 1]
              ? '└── '
              : '├── '}
            {formatFilename(asset.filePath, {})}
          
          
            {prettifySize(asset.size)}
          
          
            
              {prettifyTime(asset.time)}
            
          
        
      );
    }

    // Show how many more assets there are
    if (bundle.totalAssets > bundle.largestAssets.length) {
      rows.push(
        
          
            └──{' '}
            
              + {bundle.totalAssets - bundle.largestAssets.length} more assets
github parcel-bundler / parcel / packages / reporters / cli / src / SimpleCLIReporter.js View on Github external
if (logLevelFilter < logLevels.info) {
        break;
      }

      let message = getProgressMessage(event);
      if (message != null) {
        writeOut(message);
      }
      break;
    }
    case 'buildSuccess':
      if (logLevelFilter < logLevels.info) {
        break;
      }

      writeOut(`Built in ${prettifyTime(event.buildTime)}`);
      if (options.mode === 'production') {
        render();
      }
      break;
    case 'buildFailure':
      if (logLevelFilter < logLevels.error) {
        break;
      }

      writeErr(event.error, options.logLevel);
      break;
    case 'log': {
      switch (event.level) {
        case 'warn':
        case 'error':
          if (logLevelFilter >= logLevels[event.level]) {
github parcel-bundler / parcel / packages / reporters / cli / src / UI.js View on Github external
case 'buildSuccess':
      if (logLevel < logLevels.info) {
        break;
      }

      return {
        ...state,
        progress: null,
        bundleGraph: event.bundleGraph,
        logs: [
          ...state.logs,
          {
            type: 'log',
            level: 'success',
            message: `Built in ${prettifyTime(event.buildTime)}.`
          }
        ]
      };

    case 'buildFailure':
      if (logLevel < logLevels.error) {
        break;
      }

      return {
        ...state,
        progress: null,
        logs: [
          ...state.logs,
          {
            type: 'log',