Skip to content

Build & Preview

A Nebari docs pack is a static Astro site. Building it produces a dist/ directory of HTML, CSS, JS, and a prebuilt Pagefind search index that you can host anywhere.

  1. Install dependencies (once):

    Terminal window
    npm install
  2. Produce the production build:

    Terminal window
    npm run build
  3. Preview the built site locally — this serves dist/ exactly as production will, including working search:

    Terminal window
    npm run preview
  • Directorydist
    • index.html
    • Directorygetting-started/
    • Directoryguides/
    • Directory_astro/ hashed CSS/JS and self-hosted fonts
    • Directorypagefind/ prebuilt search index

If your pack is served from a subpath, build with the matching base so every asset URL is prefixed. This site’s build:base script does exactly that:

package.json
{
"scripts": {
"build:base": "astro build --base /demo-pack"
}
}

Once the build and preview look right, continue to Deploy to Production.