# Fumadocs (Framework Mode, TanStack Start): 静的ビルド
URL: /ja/docs/tanstack-start/deploying/static
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/deploying/static.ja.mdx

Fumadocs で静的サイトを出力します。

## セットアップ [#setup]

Fumadocs はデフォルトでサーバーファーストのアプローチを採用しているため、稼働中のサーバーが必要です。
TanStack Start を設定すれば、静的ビルドを出力できます。

静的ビルドにはサーバーが存在しないため、次の機能は動作しません。

* 検索サーバー。代わりに[静的検索](#search)を使用してください。
* [AIに質問](/docs/tanstack-start/integrations/llms#ask-ai)。チャットルートから AI モデルを呼び出す必要があるためです。
* [MCP サーバー](/docs/tanstack-start/integrations/llms#mcp-server)。

また、ミドルウェアも実行されないため、[`Accept` ヘッダーに応じた Markdown](/docs/tanstack-start/integrations/llms#accept) の配信も行われません。

### 検索 [step] [#search]

#### 組み込み検索 [#built-in-search]

1. [検索サーバーを設定します](/docs/headless/search/orama#static-export)。
2. [検索 UI/クライアントを設定します](/docs/tanstack-start/search/orama#static)。

設定が完了すると、検索インデックスがアプリに静的に保存され、検索処理はブラウザ側で行われるようになります。

#### クラウドソリューション [#cloud-solutions]

検索機能はリモートサーバーで動作するため、静的エクスポートでも追加の設定なしで利用できます。

### デプロイ [step] [#deployment]

SPA モードとプリレンダリングを設定します。詳細については、[SPA Mode](https://tanstack.com/start/latest/docs/framework/react/guide/spa-mode) を参照してください。

```ts title="vite.config.ts"
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [
    // ...その他のプラグイン
    tanstackStart({
      spa: {
        enabled: true,
        // TanStack Router がページを自動的にクロールします [!code ++:4]
        prerender: {
          enabled: true,
        },
        // UI 上に表示されない隠れたパスがある場合は、明示的に追加できます。 [!code highlight:6]
        pages: [
          {
            path: '/docs/test',
          },
        ],
      },
    }),
  ],
});
```