build: migrate examples to vite#8729
Merged
Merged
Conversation
cc9e4b7 to
b8fe330
Compare
c74e4d9 to
7d6f947
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.
Description
Migrate the examples browser build from Rollup/concurrently/serve to Vite and esbuild, while keeping the examples build commands routed through a single
examples/build.mjsentry point.examples/utilswith clearer names and typed JSDoc.npm run devfor reload-enabled Vite development./share/misc_hello-worldand/share/misc_hello-world/.npm scripts
buildcross-env NODE_ENV=production node build.mjs.build:metadatanode build.mjs --metadata.build:thumbnailsnode build.mjs --thumbnails.cleannode build.mjs --clean.devdevelopservevite preview.type:checktype:check:apptsconfig.app.json.type:check:examplestsconfig.examples.json.The old Rollup watch flow was removed; Vite now handles development rebuilds.
Notes
examples/dist./,/playcanvas.d.ts,/iframe/*.html, and/share/*routes are preserved for preview output.examples/scriptsis removed; reusable build logic now lives inexamples/utils.npm run developdisables Vite HMR and suppresses the custom examples iframe reload event; manual browser refresh still serves updated files.npm run devkeeps the reload-enabled Vite development behavior.build:thumbnailsis still available but continues to launch Puppeteer and write thumbnail output.Build comparison
dist/playcanvas.d.ts.Manual validation
cd examples && npm run build:metadata.cd examples && npm run lint.cd examples && npm run type:check.cd examples && npm run build.cd examples && npm run dev -- --version.cd examples && npm run develop -- --version.vite.config.mjswithEXAMPLES_AUTO_RELOAD=falseand without it to confirm reloads default on and disable when requested.examples/distoutput frommainand this branch in detached worktrees; no files present onmainwere missing on this branch./,/playcanvas.d.ts,/iframe/misc_hello-world.html,/static/lib/basis/basis.wasm.js,/share/misc_hello-world,/share/misc_hello-world/, and/share/misc_hello-world/index.html.mainafter the engine build PR merged and force-pushed with lease.Checklist