AkurAI Build
Menu

AkurAI-Build

public

Latest change 0cf28150faedd8c150474a4f16be4c9922c04f56 - feat: add Ponytail UI design system by Olafur Bui

{% extends "layouts/docs.html" %} {% block title %}Framework static exports ·
Bunfork docs{% endblock %} {% block description %}Serve verified Svelte,
SvelteKit, Next.js, Vue, Nuxt, and Vite static exports through Bunfork.{%
endblock %} {% block breadcrumb %}Framework exports{% endblock %} {% block
docs_title %}Framework static exports{% endblock %} {% block docs_summary
%}Bunfork accepts the finished browser directory. Pick MPA or SPA routing
deliberately, write a strict manifest, verify it, then serve the same bytes.{%
endblock %} {% block docs_content %}
<section class="doc-section" aria-labelledby="verified-producers">
  <h2 id="verified-producers">Verified producers</h2>
  <div class="table-wrap">
    <table>
      <thead>
        <tr>
          <th>Producer</th>
          <th>Output</th>
          <th>Admission</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>Svelte + Vite</td>
          <td><code>dist</code></td>
          <td>SPA with fallback for client routing; otherwise MPA</td>
        </tr>
        <tr>
          <td>Vue + Vite</td>
          <td><code>dist</code></td>
          <td>SPA with fallback for client routing; otherwise MPA</td>
        </tr>
        <tr>
          <td>SvelteKit + adapter-static</td>
          <td><code>build</code></td>
          <td>MPA; SPA only with an explicit adapter fallback</td>
        </tr>
        <tr>
          <td>Next.js <code>output: 'export'</code></td>
          <td><code>out</code></td>
          <td>MPA with directory trailing slashes recommended</td>
        </tr>
        <tr>
          <td>Nuxt generate/prerender</td>
          <td><code>.output/public</code></td>
          <td>MPA, or explicit SPA for a client-only fallback export</td>
        </tr>
        <tr>
          <td>Vite</td>
          <td><code>dist</code></td>
          <td>Match the application's actual router</td>
        </tr>
      </tbody>
    </table>
  </div>
</section>

<section class="doc-section" aria-labelledby="build-admit">
  <h2 id="build-admit">Build and admit in one command</h2>
  <p>
    <code>bunfork build</code> runs only the program and argv you provide, with
    a reduced environment, then admits the output. It performs no framework
    detection and refuses to pass Bunfork's key or API token variables to the
    build.
  </p>
  <pre><code>./target/release/bunfork build \
  --run npm \
  --arg run \
  --arg build \
  --cwd frontend \
  --output dist \
  --manifest bunfork-static.json \
  --mode spa \
  --fallback index.html \
  --trailing-slash ignore</code></pre>
  <p class="code-caption">
    For SvelteKit use <code>--output build --mode mpa</code>. For Next use
    <code>--output out --mode mpa --trailing-slash directory</code>. For Nuxt,
    run its generate script and admit <code>.output/public</code>.
  </p>
</section>

<section class="doc-section" aria-labelledby="manifest-contract">
  <h2 id="manifest-contract">The manifest is the contract</h2>
  <p>
    The <code>bunfork-static-v1</code> document records the route mode, base
    path, optional fallback, trailing-slash policy, precompression flag, and the
    SHA-256 digest plus byte length of every file.
  </p>
  <pre><code>{
  "schema": "bunfork-static-v1",
  "root": ".",
  "mode": "mpa",
  "base": "/",
  "fallback": null,
  "trailing_slash": "directory",
  "precompressed": true,
  "immutable": true,
  "files": { "index.html": { "sha256": "…", "bytes": 1234 } }
}</code></pre>
  <p>
    Admission rejects symlinks, hard links, special files, hidden or sensitive
    paths, duplicate/unknown manifest fields, and unsafe URL structure. Serving
    re-hashes and preloads the artifact before the listener binds.
  </p>
</section>

<section class="doc-section" aria-labelledby="http-behavior">
  <h2 id="http-behavior">Static HTTP behavior</h2>
  <ul class="check-list">
    <li>Base paths, directory routes, and <code>.html</code> exports</li>
    <li>Explicit SPA fallback with asset and API exclusions</li>
    <li>
      <code>GET</code>, <code>HEAD</code>, <code>405</code>, ETags, and
      <code>304</code>
    </li>
    <li>
      Immutable caching for semantic SvelteKit <code>_app/immutable/</code> and
      Next <code>_next/static/</code> namespaces; uncertain assets revalidate
    </li>
    <li>Negotiated, admitted <code>.br</code> and <code>.gz</code> sidecars</li>
  </ul>
  <aside class="doc-note">
    <strong>Reserved paths:</strong> <code>/_bunfork/health</code> and
    <code>/_bunfork/ready</code> cannot be supplied by an artifact.
  </aside>
</section>

<aside class="doc-callout warning" aria-labelledby="not-supported">
  <h2 id="not-supported">Export output only</h2>
  <p>
    <code>.next/server</code>, Next standalone, SvelteKit adapter-node, Vite
    SSR, and Nuxt/Nitro server output are rejected scope. The verified claim is
    static deployment compatibility, including browser hydration—not source or
    server-runtime compatibility.
  </p>
</aside>

<nav class="docs-pagination" aria-label="Documentation pagination">
  <a href="/docs/getting-started"
    ><small>Previous</small><span aria-hidden="true">←</span> Getting started</a
  >
  <a href="/docs/cli"
    ><small>Next</small>CLI &amp; operations
    <span aria-hidden="true">→</span></a
  >
</nav>
{% endblock %}