diff --git a/src/compiler/output-targets/index.ts b/src/compiler/output-targets/index.ts index e88d7641f04..2ef5aa5b622 100644 --- a/src/compiler/output-targets/index.ts +++ b/src/compiler/output-targets/index.ts @@ -28,7 +28,6 @@ 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), @@ -36,17 +35,23 @@ export const generateOutputTargets = async ( 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'); };