Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): run copy task after other output targets #5902

Merged
merged 3 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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