Skip to content

Commit c3d4e8b

Browse files
authoredJul 29, 2024
fix(compiler): run copy task after other output targets (#5902)
* fix(compiler): run copy task after other output targets * run secondary tasks in parallel
1 parent f69460d commit c3d4e8b

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed
 

‎src/compiler/output-targets/index.ts

+17-12
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,30 @@ export const generateOutputTargets = async (
2828
invalidateRollupCaches(compilerCtx);
2929

3030
await Promise.all([
31-
outputCopy(config, compilerCtx, buildCtx),
3231
outputCollection(config, compilerCtx, buildCtx, changedModuleFiles),
3332
outputCustomElements(config, compilerCtx, buildCtx),
3433
outputHydrateScript(config, compilerCtx, buildCtx),
3534
outputLazyLoader(config, compilerCtx),
3635
outputLazy(config, compilerCtx, buildCtx),
3736
]);
3837

39-
// the www output target depends on the output of the lazy output target
40-
// since it attempts to inline the lazy build entry point into `index.html`
41-
// so we want to ensure that the lazy OT has already completed and written
42-
// all of its files before the www OT runs.
43-
await outputWww(config, compilerCtx, buildCtx);
44-
45-
// must run after all the other outputs
46-
// since it validates files were created
47-
await outputDocs(config, compilerCtx, buildCtx);
48-
await outputTypes(config, compilerCtx, buildCtx);
49-
await outputCustom(config, compilerCtx, buildCtx);
38+
await Promise.all([
39+
// the user may want to copy compiled assets which requires above tasks to
40+
// have finished first
41+
outputCopy(config, compilerCtx, buildCtx),
42+
43+
// the www output target depends on the output of the lazy output target
44+
// since it attempts to inline the lazy build entry point into `index.html`
45+
// so we want to ensure that the lazy OT has already completed and written
46+
// all of its files before the www OT runs.
47+
outputWww(config, compilerCtx, buildCtx),
48+
49+
// must run after all the other outputs
50+
// since it validates files were created
51+
outputDocs(config, compilerCtx, buildCtx),
52+
outputTypes(config, compilerCtx, buildCtx),
53+
outputCustom(config, compilerCtx, buildCtx),
54+
]);
5055

5156
timeSpan.finish('generate outputs finished');
5257
};

0 commit comments

Comments
 (0)