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

Function compileAllJs

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

* Compile and optionally minify the stylesheets and the scripts for the runtime * and drop them in the dist folder * * @param {!Object} options * @return {!Promise}

(options)

Source from the content-addressed store, hash-verified

142 * @return {!Promise}
143 */
144async function compileAllJs(options) {
145 const {minify} = options;
146 log(`Compiling ${cyan(minify ? 'minified' : 'unminified')} JS...`);
147
148 const startTime = Date.now();
149 await Promise.all([
150 minify ? Promise.resolve() : doBuildJs(jsBundles, 'polyfills.js', options),
151 doBuildJs(jsBundles, 'alp.max.js', options),
152 doBuildJs(jsBundles, 'integration.js', options),
153 doBuildJs(jsBundles, 'ampcontext-lib.js', options),
154 doBuildJs(jsBundles, 'iframe-transport-client-lib.js', options),
155 doBuildJs(jsBundles, 'recaptcha.js', options),
156 doBuildJs(jsBundles, 'amp-viewer-host.max.js', options),
157 doBuildJs(jsBundles, 'video-iframe-integration.js', options),
158 doBuildJs(jsBundles, 'amp-story-entry-point.js', options),
159 doBuildJs(jsBundles, 'amp-story-player.js', options),
160 doBuildJs(jsBundles, 'amp-inabox-host.js', options),
161 doBuildJs(jsBundles, 'amp-shadow.js', options),
162 doBuildJs(jsBundles, 'amp-inabox.js', options),
163 ]);
164 await compileCoreRuntime(options);
165 endBuildStep(
166 minify ? 'Minified' : 'Compiled',
167 'all runtime JS files',
168 startTime
169 );
170}
171
172/**
173 * Returns compiled file to prepend within wrapper and empty string if none.

Callers 2

distFunction · 0.85
buildFunction · 0.85

Calls 7

cyanFunction · 0.85
doBuildJsFunction · 0.85
compileCoreRuntimeFunction · 0.85
endBuildStepFunction · 0.85
nowMethod · 0.80
resolveMethod · 0.80
logFunction · 0.50

Tested by

no test coverage detected