MCPcopy
hub / github.com/ampproject/amphtml / doBuildJs

Function doBuildJs

build-system/tasks/helpers.js:80–94  ·  view source on GitHub ↗

* @param {!Object} jsBundles * @param {string} name * @param {!Object} extraOptions * @return {!Promise}

(jsBundles, name, extraOptions)

Source from the content-addressed store, hash-verified

78 * @return {!Promise}
79 */
80function doBuildJs(jsBundles, name, extraOptions) {
81 const target = jsBundles[name];
82 if (target) {
83 return compileJs(
84 target.srcDir,
85 target.srcFilename,
86 extraOptions.minify ? target.minifiedDestDir : target.destDir,
87 {...target.options, ...extraOptions}
88 );
89 } else {
90 return Promise.reject(
91 [red('Error:'), 'Could not find', cyan(name)].join(' ')
92 );
93 }
94}
95
96/**
97 * Generates frames.html

Callers 4

buildExtensionFunction · 0.85
compileCoreRuntimeFunction · 0.85
compileAllJsFunction · 0.85

Calls 3

compileJsFunction · 0.85
redFunction · 0.85
cyanFunction · 0.85

Tested by

no test coverage detected