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

Function dist

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

* Minified build. Entry point for `amp dist`. * @return {Promise }

()

Source from the content-addressed store, hash-verified

104 * @return {Promise<void>}
105 */
106async function dist() {
107 const handlerProcess = createCtrlcHandler('dist');
108 process.env.NODE_ENV = 'production';
109 const options = {
110 fortesting: argv.fortesting,
111 minify: true,
112 watch: argv.watch,
113 };
114 printNobuildHelp();
115 printDistHelp(options);
116 await runPreDistSteps(options);
117
118 // These steps use closure compiler. Small ones before large (parallel) ones.
119 if (argv.core_runtime_only) {
120 await compileCoreRuntime(options);
121 } else {
122 await Promise.all([
123 writeVersionFiles(),
124 buildExperiments(),
125 buildLoginDone('0.1'),
126 buildWebPushPublisherFiles(),
127 buildCompiler(),
128 compileAllJs(options),
129 ]);
130 }
131
132 // This step internally parses the various extension* flags.
133 await buildExtensions(options);
134
135 // This step is to be run only during a full `amp dist`.
136 if (shouldBuildVendorConfigs()) {
137 await buildVendorConfigs(options);
138 }
139
140 // This step is required no matter which binaries are built.
141 await formatExtractedMessages();
142
143 if (!argv.watch) {
144 exitCtrlcHandler(handlerProcess);
145 }
146}
147
148/**
149 * Writes the verion.txt file.

Callers

nothing calls this directly

Calls 14

printNobuildHelpFunction · 0.85
printDistHelpFunction · 0.85
runPreDistStepsFunction · 0.85
compileCoreRuntimeFunction · 0.85
writeVersionFilesFunction · 0.85
buildExperimentsFunction · 0.85
buildLoginDoneFunction · 0.85
buildCompilerFunction · 0.85
compileAllJsFunction · 0.85
buildExtensionsFunction · 0.85
shouldBuildVendorConfigsFunction · 0.85

Tested by

no test coverage detected