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

Function buildExtensions

build-system/tasks/extension-helpers.js:330–351  ·  view source on GitHub ↗

* Build all the AMP extensions * * @param {!Object} options * @return {!Promise}

(options)

Source from the content-addressed store, hash-verified

328 * @return {!Promise}
329 */
330async function buildExtensions(options) {
331 const startTime = Date.now();
332 maybeInitializeExtensions(EXTENSIONS);
333 const extensionsToBuild = getExtensionsToBuild();
334 const results = [];
335 for (const extension in EXTENSIONS) {
336 if (
337 options.compileOnlyCss ||
338 extensionsToBuild.includes(EXTENSIONS[extension].name)
339 ) {
340 results.push(doBuildExtension(EXTENSIONS, extension, options));
341 }
342 }
343 await Promise.all(results);
344 if (!options.compileOnlyCss && results.length > 0) {
345 endBuildStep(
346 options.minify ? 'Minified all' : 'Compiled all',
347 'extensions',
348 startTime
349 );
350 }
351}
352
353/**
354 * Builds a single extension after extracting its settings.

Callers 3

distFunction · 0.85
buildFunction · 0.85
compileCssFunction · 0.85

Calls 6

getExtensionsToBuildFunction · 0.85
doBuildExtensionFunction · 0.85
endBuildStepFunction · 0.85
nowMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected