build-system/tasks/helpers.js
/**
 * Compile and optionally minify the stylesheets and the scripts for the runtime
 * and drop them in the dist folder
 *
 * @param {!Object} options
 * @return {!Promise}
 */
Compile and optionally minify the stylesheets and the scripts for the runtime
and drop them in the dist folder

@param {!Object} options
@return {!Promise}
Compile and optionally minify the stylesheets and the scripts for the runtime and drop them in the dist folder @param { !Object } options @return { !Promise }
async function compileAllJs(options) {
  const {minify} = options;
  if (minify) {
    log('Minifying multi-pass JS with', cyan('closure-compiler') + '...');
  } else {
    log('Compiling JS with', cyan('esbuild'), 'and', cyan('babel') + '...');
  }
  const startTime = Date.now();
  await Promise.all([
    minify ? Promise.resolve() : doBuildJs(jsBundles, 'polyfills.js', options),
    compileBentoRuntime(options),
    doBuildJs(jsBundles, 'alp.max.js', options),
    doBuildJs(jsBundles, 'integration.js', options),
    doBuildJs(jsBundles, 'ampcontext-lib.js', options),
    doBuildJs(jsBundles, 'iframe-transport-client-lib.js', options),
    doBuildJs(jsBundles, 'recaptcha.js', options),
    doBuildJs(jsBundles, 'amp-viewer-host.max.js', options),
    doBuildJs(jsBundles, 'video-iframe-integration.js', options),
    doBuildJs(jsBundles, 'amp-story-entry-point.js', options),
    doBuildJs(jsBundles, 'amp-story-player.js', options),
    doBuildJs(jsBundles, 'amp-inabox-host.js', options),
    doBuildJs(jsBundles, 'amp-shadow.js', options),
    doBuildJs(jsBundles, 'amp-inabox.js', options),
  ]);
  await compileCoreRuntime(options);
  endBuildStep(
    minify ? 'Minified' : 'Compiled',
    'all runtime JS files',
    startTime
  );
}
async function compileAllJs ( options ) { const { minify } = options ; if ( minify ) { log ( 'Minifying multi-pass JS with' , cyan ( 'closure-compiler' ) + '...' ) ; } else { log ( 'Compiling JS with' , cyan ( 'esbuild' ) , 'and' , cyan ( 'babel' ) + '...' ) ; } const startTime = Date . now ( ) ; await Promise . all ( [ minify ? Promise . resolve ( ) : doBuildJs ( jsBundles , 'polyfills.js' , options ) , compileBentoRuntime ( options ) , doBuildJs ( jsBundles , 'alp.max.js' , options ) , doBuildJs ( jsBundles , 'integration.js' , options ) , doBuildJs ( jsBundles , 'ampcontext-lib.js' , options ) , doBuildJs ( jsBundles , 'iframe-transport-client-lib.js' , options ) , doBuildJs ( jsBundles , 'recaptcha.js' , options ) , doBuildJs ( jsBundles , 'amp-viewer-host.max.js' , options ) , doBuildJs ( jsBundles , 'video-iframe-integration.js' , options ) , doBuildJs ( jsBundles , 'amp-story-entry-point.js' , options ) , doBuildJs ( jsBundles , 'amp-story-player.js' , options ) , doBuildJs ( jsBundles , 'amp-inabox-host.js' , options ) , doBuildJs ( jsBundles , 'amp-shadow.js' , options ) , doBuildJs ( jsBundles , 'amp-inabox.js' , options ) , ] ) ; await compileCoreRuntime ( options ) ; endBuildStep ( minify ? 'Minified' : 'Compiled' , 'all runtime JS files' , startTime ) ; }
Compile and optionally minify the stylesheets and the scripts for the runtime
 and drop them in the dist folder
Compile and optionally minify the stylesheets and the scripts for the runtime and drop them in the dist folder