# Fumadocs (Framework Mode, TanStack Start): 靜態建置
URL: /zh-TW/docs/tanstack-start/deploying/static
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/deploying/static.zh-TW.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',
          },
        ],
      },
    }),
  ],
});
```