MCPcopy Create free account
hub / github.com/ampproject/amphtml / lazyBuildExtensions

Function lazyBuildExtensions

build-system/server/lazy-build.js:106–113  ·  view source on GitHub ↗

* Lazy builds the correct version of an extension when requested. * * @param {!Object} req * @param {!Object} _res * @param {function(): void} next * @return {Promise }

(req, _res, next)

Source from the content-addressed store, hash-verified

104 * @return {Promise<void>}
105 */
106async function lazyBuildExtensions(req, _res, next) {
107 const matcher = argv.minified
108 ? argv.esm
109 ? /\/dist\/v0\/([^\/]*)\.mjs/ // '/dist/v0/*.mjs'
110 : /\/dist\/v0\/([^\/]*)\.js/ // '/dist/v0/*.js'
111 : /\/dist\/v0\/([^\/]*)\.max\.js/; // '/dist/v0/*.max.js'
112 await lazyBuild(req.url, matcher, extensionBundles, doBuildExtension, next);
113}
114
115/**
116 * Lazy builds a non-extension JS file when requested.

Callers

nothing calls this directly

Calls 1

lazyBuildFunction · 0.85

Tested by

no test coverage detected