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.
This PR introduces Vite as the build system for RGBDS Live.
I tried to do minimal changes to the code, so currently there’s still lots of globals and stuff, but the PR got big enough as it is. This already does some nice optimizations in that it bundles all the JavaScript and CSS files and minifies them, which should make the site load faster.
These are the changes introduced by this PR:
www
.package.json
to importvite
and to declarenpm run build
andnpm run dev
build scripts.-s EXPORT_ES6=1
to Wasm builds so that the output is a ES6 module. This makes it easier to use the Wasm builds with vite.-s ENVIRONMENT=web
to rgbds builds so that the JS files don’t contain references to Node runtimes.type="module"
which allows us to use ESM imports/exports in the code and will allow us to use top-level await in the future.globalThis
to declare globals as ES6 modules have an isolated global scope by default.