Skip to content

CodeGuard v1

A tighter build.
A clear receipt.

Minify JavaScript and CSS, leave public source maps behind, and record exactly what went into your build. Processing runs in your own build pipeline.

Build lab

Interactive example
dist/app.jsOriginal
function formatLabel(name) {
  return "Hello, " + name;
}

console.log(formatLabel("Zenith"));
//# sourceMappingURL=app.js.map
  1. Remove the source map referenceWaiting
  2. Minify with esbuildWaiting
  3. Hash the outputWaiting
codeshield-manifest.jsonNot written yet
path
app.js
bytesBefore → bytesAfter
—
sha256Before
—
sha256After
—

What runs on your build.

  • Minify JavaScript and CSS

    esbuild removes whitespace and comments and shortens local names. Your original build folder is never changed.

  • Leave source maps behind

    Source map files and the comments that point to them stay out of the processed folder, so your readable source isn’t published with it.

  • Keep a build receipt

    A manifest lists every asset with its size and SHA-256 hash, before and after. Import it into Zenith to keep a history.

From build to receipt.

Three steps, once per site. After that it’s one command per release.

  1. Verify your site

    Add your site to Zenith, verify ownership, and save the build settings you want to apply.

  2. Run CodeGuard locally

    Save the CLI as scripts/codeshield.mjs. It writes a separate output folder. Run your usual browser tests on it before you deploy.

    Terminal
    npm install --save-dev esbuild
    npm pkg set scripts.codeshield="node scripts/codeshield.mjs"
    npm run build
    npm run codeshield -- dist dist-protected
    Download the CLI
  3. Import the receipt

    Upload codeshield-manifest.json from the output folder. Zenith records the asset paths, sizes and hashes. Your source and processed files stay with you.

Good to know.

Does my code leave my machine?

No. The CLI runs in your own build environment and never uploads source or deploys anything. Zenith only receives the manifest you import: paths, sizes and hashes.

What does build protection cover?

Minifying makes code smaller and harder to skim, but browser-delivered code stays inspectable. Keep credentials and sensitive logic on the server. The receipt documents the output that was processed; deploying it is a separate step.

How does the Cloudflare gateway work?

The optional gateway is for a dedicated static-asset hostname. Deploy it in your Cloudflare account and check its verification status in Zenith.

Protect your next build.

CodeGuard works with any Zenith account. Start with a verified site.