Skip to content

build: minify html and js and default to esm cdn.#27

Merged
knightedcodemonkey merged 3 commits intomainfrom
bananas
Mar 22, 2026
Merged

build: minify html and js and default to esm cdn.#27
knightedcodemonkey merged 3 commits intomainfrom
bananas

Conversation

@knightedcodemonkey
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 22, 2026 17:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.js orchestrator that runs prepare/css/importmap/js/html in order and defaults KNIGHTED_PRIMARY_CDN to esm.
  • Introduce build:js (esbuild-based JS minification across dist/**/*.js + dist/**/*.mjs) and build:html (html-minifier-terser for dist/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.

@knightedcodemonkey knightedcodemonkey merged commit 4b5f2df into main Mar 22, 2026
1 check passed
@knightedcodemonkey knightedcodemonkey deleted the bananas branch March 22, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants