packages/workbox-cli/src/app.js
async function runBuildCommand({command, config, watch}) {
  try {
    const {size, count, warnings} = await workboxBuild[command](config);

    for (const warning of warnings) {
      logger.warn(warning);
    }

    logger.log(`The service worker was written to ${config.swDest}\n` +
      `${count} files will be precached, totalling ${prettyBytes(size)}.`);

    if (watch) {
      logger.log(`\nWatching for changes...`);
    }
  } catch (error) {
    // See https://github.com/hapijs/joi/blob/v11.3.4/API.md#errors
    if (typeof error.annotate === 'function') {
      throw new Error(
          `${errors['config-validation-failed']}\n${error.annotate()}`);
    }
    logger.error(errors['workbox-build-runtime-error']);
    throw error;
  }
}
async function runBuildCommand({command, config, watch}) {
  try {
    const {size, count, warnings} = await workboxBuild[command](config);

    for (const warning of warnings) {
      logger.warn(warning);
    }

    logger.log(`The service worker was written to ${config.swDest}\n` +
      `${count} files will be precached, totalling ${prettyBytes(size)}.`);

    if (watch) {
      logger.log(`\nWatching for changes...`);
    }
  } catch (error) {
    // See https://github.com/hapijs/joi/blob/v11.3.4/API.md#errors
    if (typeof error.annotate === 'function') {
      throw new Error(
          `${errors['config-validation-failed']}\n${error.annotate()}`);
    }
    logger.error(errors['workbox-build-runtime-error']);
    throw error;
  }
}
async function runBuildCommand ( { command , config , watch } ) { try { const { size , count , warnings } = await workboxBuild [ command ] ( config ) ; for ( const warning of warnings ) { logger . warn ( warning ) ; } logger . log ( ` ${ config . swDest } \n ` + ` ${ count } ${ prettyBytes ( size ) } ` ) ; if ( watch ) { logger . log ( ` \n ` ) ; } } catch ( error ) { // See https://github.com/hapijs/joi/blob/v11.3.4/API.md#errors if ( typeof error . annotate === 'function' ) { throw new Error ( ` ${ errors [ 'config-validation-failed' ] } \n ${ error . annotate ( ) } ` ) ; } logger . error ( errors [ 'workbox-build-runtime-error' ] ) ; throw error ; } }
Runs the specified build command with the provided configuration.

@param {Object} options
Runs the specified build command with the provided configuration .