# Fumadocs (Framework Mode, React Router): Static Build
URL: /docs/react-router/deploying/static
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/deploying/static.mdx

Output static website with Fumadocs.

## Setup [#setup]

By default, Fumadocs uses a server-first approach, which requires a running server.
You can output a static build by configuring React Router.

A static build has no server, so these features don't work:

- The search server. Use [static search](#search) instead.
- [Ask AI](/docs/react-router/integrations/llms#ask-ai), whose chat route calls the AI model.
- The [MCP server](/docs/react-router/integrations/llms#mcp-server).

Middleware doesn't run either, so pages don't serve [Markdown for the `Accept` header](/docs/react-router/integrations/llms#accept).

### Search [step] [#search]

#### Built-in Search [#built-in-search]

1. [Configure Search Server](/docs/headless/search/orama#static-export).
2. [Configure Search UI/Client](/docs/react-router/search/orama#static).

After the configurations, your app will statically store the search indexes, and search will be computed on browser instead.

#### Cloud Solutions [#cloud-solutions]

Since the search functionality is powered by remote servers, static export works without configuration.

### Deployment [step] [#deployment]

With SPA mode, you can serve the `build/client` directory as a static website.

<Callout type="warning" title="Don't forget to pre-render">
On SPA mode, all your server-side loaders must be pre-rendered.

See [React Router Docs](https://reactrouter.com/how-to/spa) for details.
</Callout>

```ts title="react-router.config.ts"
import type { Config } from '@react-router/dev/config';
import { glob } from 'node:fs/promises';
import { createGetUrl, getSlugs } from 'fumadocs-core/source';

const getUrl = createGetUrl('/docs');

export default {
  // disable SSR [!code highlight:2]
  ssr: false,

  // [!code ++:9]
  async prerender({ getStaticPaths }) {
    const paths: string[] = [...getStaticPaths()];

    for await (const entry of glob('**/*.{md,mdx}', { cwd: 'content/docs' })) {
      paths.push(getUrl(getSlugs(entry)));
    }

    return paths;
  },
} satisfies Config;
```