预设: aws_amplify
你可以使用 awsAmplify 选项配置该预设的高级选项。
import { defineNitroConfig } from "nitro/config";
export default defineNitroConfig({
awsAmplify: {
// catchAllStaticFallback: true,
// imageOptimization: { path: "/_image", cacheControl: "public, max-age=3600, immutable" },
// imageSettings: { ... },
// runtime: "nodejs18.x", // default: "nodejs18.x" | "nodejs16.x" | "nodejs20.x"
}
})
amplify.yml你可能需要一个自定义的 amplify.yml 文件用于高级配置。以下是两个模板示例:
version: 1
frontend:
phases:
preBuild:
commands:
- nvm use 18 && node --version
- corepack enable && npx --yes nypm install
build:
commands:
- pnpm build
artifacts:
baseDirectory: .amplify-hosting
files:
- "**/*"
version: 1
applications:
- frontend:
phases:
preBuild:
commands:
- nvm use 18 && node --version
- corepack enable && npx --yes nypm install
build:
commands:
- pnpm --filter website1 build
artifacts:
baseDirectory: apps/website1/.amplify-hosting
files:
- '**/*'
buildPath: /
appRoot: apps/website1