build: minify html and js and default to esm cdn.#27
Merged
knightedcodemonkey merged 3 commits intomainfrom Mar 22, 2026
Merged
build: minify html and js and default to esm cdn.#27knightedcodemonkey merged 3 commits intomainfrom
knightedcodemonkey merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the production build pipeline to generate smaller dist/ artifacts by adding JS + HTML minification steps, and it changes the default production CDN mode to ESM unless overridden via KNIGHTED_PRIMARY_CDN.
Changes:
- Add a new
scripts/build.jsorchestrator that runs prepare/css/importmap/js/html in order and defaultsKNIGHTED_PRIMARY_CDNtoesm. - Introduce
build:js(esbuild-based JS minification acrossdist/**/*.js+dist/**/*.mjs) andbuild:html(html-minifier-terser fordist/index.html). - Update npm scripts/docs/workflow to use the new build entrypoint and describe the new pipeline.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/build.js | New build orchestrator; sets default CDN mode and runs build steps in sequence. |
| scripts/build-js.js | New JS minification step for all JS/MJS in dist/ via esbuild transform. |
| scripts/build-html.js | New HTML minification step for dist/index.html via html-minifier-terser. |
| package.json | Adds build steps + dependencies; routes build through the new orchestrator; updates preview/e2e commands. |
| package-lock.json | Locks new devDependencies (esbuild + html-minifier-terser and transitive deps). |
| docs/build-and-deploy.md | Updates production build docs to reflect default ESM mode and the 5-step build pipeline. |
| .github/workflows/deploy.yml | Switches deploy build command from build:esm to build (now defaults to ESM). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.