build: parallelize engine builds with turbo#8716
Merged
Merged
Conversation
d9662a7 to
adc17e4
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR parallelizes the PlayCanvas engine build pipeline by moving build orchestration into Turbo, allowing independent Rollup targets (UMD/ESM/types and rel/dbg/prf/min variants) to run concurrently instead of being coordinated by a single serial build process.
Changes:
- Introduces
turbo.jsonto define build task graph (aggregate tasks + leaf targets) and adds Turbo as a dev dependency. - Refactors
build.mjsto a typed CLI (--type,--format,--watch,--sourcemaps, tree visualizer flags) and updates Rollup environment wiring accordingly. - Renames build types (
release/debug/profiler→rel/dbg/prf) across build utilities and example build config, and updates npm scripts/watch aliases.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/rollup-build-target.mjs | Renames build types and adds a bundleSource option to support minifying from a previously-generated rel bundle. |
| turbo.json | Adds Turbo task graph describing build aggregates and leaf build outputs for caching/parallelism. |
| rollup.config.mjs | Switches Rollup target selection to process.env.build / process.env.bundleSource and updates build-type naming. |
| package.json | Adds Turbo + packageManager, rewires build/watch scripts to Turbo and new build.mjs flags, updates build-type naming. |
| package-lock.json | Locks Turbo and its optional platform binaries. |
| examples/rollup.config.mjs | Updates example engine build targets to use rel/dbg/prf build type names. |
| build.mjs | Replaces legacy env-arg forwarding with a typed CLI + spawn-based Rollup runner and output “cleaning”. |
| .gitignore | Ignores the .turbo directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2724e78 to
f499bb2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #8357.
Important
Watch mode is intentionally out of scope for this PR. It remains on the existing single Rollup watcher (
node build.mjs --watch) and will be addressed in a follow-up build-system/watch PR.Summary
Parallelizes the engine build pipeline with Turbo for completed build tasks. Also simplifies Rollup target generation so minified builds no longer depend on generated release artifacts.
Changes
turbo.json--typeand--formatbuild optionsrel,dbg,prf,minHISTORYdependency flowcleanas an explicit utility script without making Turbo build tasks depend on itBuild timings
Clean sequential timings with
build/and.turbo/removed before each run.Public API changes
No engine runtime API changes.
Developer-facing npm script migrations:
build:releasebuild:rel:umd,build:rel:esmbuild:debugbuild:dbg:umd,build:dbg:esmbuild:profilerbuild:prf:umd,build:prf:esmbuild:umdbuild:rel:umd,build:dbg:umd,build:prf:umd,build:min:umdbuild:esmbuild:rel:esm,build:dbg:esm,build:prf:esm,build:min:esmbuild:esm:releasebuild:rel:esmbuild:esm:debugbuild:dbg:esmNew npm script:
clean.build.mjsnow accepts--type <rel|dbg|prf|min|types>and--format <esm|umd>, withrelandesmas the defaults for regular builds. Tree visualizer flags default to both formats when--formatis omitted.Manual tests
npm run build:treemap(verifiedtreemap.es.htmlandtreemap.umd.html)turbo.jsonand asserted no build task depends oncleannode --check build.mjsnpm run lint