
# 预设选项

> 使用对应的[部署预设](/deploy)时生效的平台专属选项。

::note
本页所有示例都假设已在 `nitro.config.ts` 中导入以下内容：

```ts
import { defineConfig } from "nitro";
```
::

### `awsAmplify`

AWS Amplify 预设的选项。主要字段包括 `catchAllStaticFallback`、`imageOptimization`（`path`、`cacheControl`）、`imageSettings` 和 `runtime`（`nodejs20.x`、`nodejs22.x` 或 `nodejs24.x`，默认值为 `nodejs22.x`）。参见[预设文档](/deploy/providers/aws-amplify)。

```ts
export default defineConfig({
  awsAmplify: {
    runtime: "nodejs22.x",
    imageOptimization: { path: "/_image", cacheControl: "public, max-age=3600" },
  },
});
```

### `awsLambda`

AWS Lambda 预设的选项。将 `streaming` 设为 `true` 可启用响应流。参见[预设文档](/deploy/providers/aws)。

```ts
export default defineConfig({
  awsLambda: {
    streaming: true,
  },
});
```

### `azure`

Azure Static Web Apps 预设的选项。使用 `config` 自定义生成的 `staticwebapp.config.json`（例如 `platform.apiRuntime`、`navigationFallback`）。参见[预设文档](/deploy/providers/azure)。

```ts
export default defineConfig({
  azure: {
    config: { platform: { apiRuntime: "node:20" } },
  },
});
```

### `firebase`

Firebase App Hosting 预设的选项。使用 `appHosting` 自定义生成的运行配置。参见[预设文档](/deploy/providers/firebase#run-configuration)。

```ts
export default defineConfig({
  firebase: {
    appHosting: {
      memoryMiB: 512,
      maxInstances: 10,
    },
  },
});
```

### `iis`

IIS 预设的选项。使用 `mergeConfig` 将生成的 `web.config` 与现有配置合并，或使用 `overrideConfig` 完全替换现有配置。参见[预设文档](/deploy/providers/iis)。

```ts
export default defineConfig({
  iis: {
    mergeConfig: true,
  },
});
```

### `netlify`

Netlify 预设的选项。使用 `config` 提供 Netlify[部署配置](https://docs.netlify.com/build/frameworks/frameworks-api/)（`headers`、`redirects`、`functions`、`edge_functions`、`images` 等）。参见[预设文档](/deploy/providers/netlify)。

```ts
export default defineConfig({
  netlify: {
    config: {
      redirects: [{ from: "/old", to: "/new", status: 301 }],
    },
  },
});
```

### `vercel`

Vercel 预设的选项。参见[预设文档](/deploy/providers/vercel)。

```ts
export default defineConfig({
  vercel: {
    config: { runtime: "nodejs20.x" },
  },
});
```

### `cloudflare`

Cloudflare 预设的选项。参见[预设文档](/deploy/providers/cloudflare)。

```ts
export default defineConfig({
  cloudflare: {
    wrangler: { compatibility_date: "2025-01-01" },
  },
});
```

### `zephyr`

Zephyr 预设的选项。参见[预设文档](/deploy/providers/zephyr#options)。
