Skip to content

Commit

Permalink
fix(compiler): run copy task after other output targets (#5902)
Browse files Browse the repository at this point in the history
* fix(compiler): run copy task after other output targets

* run secondary tasks in parallel
  • Loading branch information
christian-bromann committed Jul 29, 2024
1 parent f69460d commit c3d4e8b
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/compiler/output-targets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,30 @@ export const generateOutputTargets = async (
invalidateRollupCaches(compilerCtx);

await Promise.all([
outputCopy(config, compilerCtx, buildCtx),
outputCollection(config, compilerCtx, buildCtx, changedModuleFiles),
outputCustomElements(config, compilerCtx, buildCtx),
outputHydrateScript(config, compilerCtx, buildCtx),
outputLazyLoader(config, compilerCtx),
outputLazy(config, compilerCtx, buildCtx),
]);

// the www output target depends on the output of the lazy output target
// since it attempts to inline the lazy build entry point into `index.html`
// so we want to ensure that the lazy OT has already completed and written
// all of its files before the www OT runs.
await outputWww(config, compilerCtx, buildCtx);

// must run after all the other outputs
// since it validates files were created
await outputDocs(config, compilerCtx, buildCtx);
await outputTypes(config, compilerCtx, buildCtx);
await outputCustom(config, compilerCtx, buildCtx);
await Promise.all([
// the user may want to copy compiled assets which requires above tasks to
// have finished first
outputCopy(config, compilerCtx, buildCtx),

// the www output target depends on the output of the lazy output target
// since it attempts to inline the lazy build entry point into `index.html`
// so we want to ensure that the lazy OT has already completed and written
// all of its files before the www OT runs.
outputWww(config, compilerCtx, buildCtx),

// must run after all the other outputs
// since it validates files were created
outputDocs(config, compilerCtx, buildCtx),
outputTypes(config, compilerCtx, buildCtx),
outputCustom(config, compilerCtx, buildCtx),
]);

timeSpan.finish('generate outputs finished');
};
Expand Down

0 comments on commit c3d4e8b

Please sign in to comment.