* Minified build. Entry point for `amp dist`. * @return {Promise }
()
| 104 | * @return {Promise<void>} |
| 105 | */ |
| 106 | async 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. |
nothing calls this directly
no test coverage detected