# Share an Astro Build — Preview dist/ Without a Deploy

Canonical: https://commareports.com/share-astro-site
Published: 2026-08-31

> astro build writes dist/ with absolute /_astro/ asset paths. Publish the folder to Comma for a preview URL where the islands hydrate and reviewers can comment.

# 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

```bash
npm run build          # → dist/
```

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

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

## Publish dist/

Drag `dist/` (or a zip of it) into [the app](https://commareports.com/):

- `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

```bash
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](/comment-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](/docs/sharing).

## 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 →](https://commareports.com/)**

### Related

- [Share a Jekyll build](/share-jekyll-site) · [Share an Eleventy site](/share-eleventy-site)
- [Share a VitePress site](/share-vitepress-site) · [Share a Hugo site](/share-hugo-site)
- [Why report CSS breaks](/html-report-broken-css) · [Interactive HTML reports](/interactive-html-reports)
