Share an Astro build

astro build produces a dist/ folder that is genuinely static — and genuinely awkward to hand to someone. Open dist/index.html from disk and you get unstyled markup, because Astro references its bundles absolutely under /_astro/…, which at a file:// origin resolves against your filesystem root.

The usual answer is astro preview, which helps exactly one person: you.

Build

npm run build          # → dist/

If you deploy under a subpath, set it so the build's references match:

// astro.config.mjs
export default defineConfig({ base: "/docs" });

Publish dist/

Drag dist/ (or a zip of it) into the app:

  • index.html becomes the report body.
  • The _astro/ CSS and JS bundles, images and fonts upload as assets, and their references are rewritten to the uploaded copies — which is the step that makes it render at all.
  • Scripts run inside a sandboxed iframe (allow-scripts, no allow-same-origin), so islands hydrate and view transitions behave.

A shareable preview with no host, no deploy, and no preview environment to tear down afterwards.

One preview per PR

npm run build

curl -fsS -X PATCH "https://commareports.com/api/v1/reports/$REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html dist/index.html \
        --arg title "Preview — $GITHUB_HEAD_REF" '{title: $title, html: $html}')"

PATCH the same report id on each push: the PR's preview link never changes, and every build is kept as a revision so "what did it look like before the last commit?" is answerable.

What review adds

  • Anchored threads on the rendered page — the difference between "the hero spacing is off" and a comment attached to the hero. See commenting on HTML.
  • Revisions, so applied feedback is verifiable rather than asserted.
  • Access per report — private, team, domain-gated, or named reviewers, so an unreleased marketing page stays unreleased. See the sharing model.

Limits

  • Entry HTML: 5 MB. Assets: 25 MB per file, 250 MB and 500 files total. Image-heavy marketing builds are the case to watch — publish the page under review rather than the whole site.
  • 60 requests/minute per token.

Try it

Comma is free — unlimited reports, unlimited commenters, unlimited revision history.

Publish a site preview →

Related