Skip to content

Commit

Permalink
🏗 Parallelize dist steps (#35943)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg committed Sep 7, 2021
1 parent 971d0ac commit 1e2c808
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions build-system/tasks/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,18 @@ async function dist() {
await runPreDistSteps(options);

// These steps use closure compiler. Small ones before large (parallel) ones.
const steps = [];
if (argv.core_runtime_only) {
await compileCoreRuntime(options);
steps.push(compileCoreRuntime(options));
} else {
await buildExperiments();
await buildLoginDone('0.1');
await buildWebPushPublisherFiles();
await compileAllJs(options);
steps.push(buildExperiments());
steps.push(buildLoginDone('0.1'));
steps.push(buildWebPushPublisherFiles());
steps.push(compileAllJs(options));
}

// This step internally parses the various extension* flags.
await buildExtensions(options);
steps.push(buildExtensions(options));

// This step is to be run only during a full `amp dist`.
if (
Expand All @@ -132,9 +133,11 @@ async function dist() {
!argv.extensions_from &&
!argv.noextensions
) {
await buildVendorConfigs(options);
steps.push(buildVendorConfigs(options));
}

await Promise.all(steps);

// This step is required no matter which binaries are built.
await formatExtractedMessages();

Expand Down

0 comments on commit 1e2c808

Please sign in to comment.