MCPcopy Index your code
hub / github.com/ampproject/amphtml / preBuildWebPushPublisherFiles

Function preBuildWebPushPublisherFiles

build-system/tasks/dist.js:251–269  ·  view source on GitHub ↗

* Build amp-web-push publisher files HTML page. * @return {Promise }

()

Source from the content-addressed store, hash-verified

249 * @return {Promise<void>}
250 */
251async function preBuildWebPushPublisherFiles() {
252 for (const version of WEB_PUSH_PUBLISHER_VERSIONS) {
253 for (const fileName of WEB_PUSH_PUBLISHER_FILES) {
254 const srcPath = `extensions/amp-web-push/${version}`;
255 const destPath = `build/all/amp-web-push-${version}`;
256
257 // Build Helper Frame JS
258 const js = await fs.readFile(`${srcPath}/${fileName}.js`, 'utf8');
259 const builtName = `${fileName}.js`;
260 await fs.outputFile(`${destPath}/${builtName}`, js);
261 const jsFiles = await fastGlob(`${srcPath}/*.js`);
262 await Promise.all(
263 jsFiles.map((jsFile) => {
264 return fs.copy(jsFile, `${destPath}/${path.basename(jsFile)}`);
265 })
266 );
267 }
268 }
269}
270
271/**
272 * post Build amp-web-push publisher files HTML page.

Callers 1

prebuildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected