> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # VercelDeployer 그만큼`VercelDeployer`Mastra 서버를 번들로 묶고 Vercel에 맞는 출력을 생성합니다.[출력 API 빌드](https://vercel.com/docs/build-output-api/v3). Vercel은 이 출력을 서버리스 기능으로 직접 배포합니다. ## 설치 `VercelDeployer`를 사용하려면 `@mastra/deployer-vercel` 패키지를 설치하세요. **npm**: ```bash npm install @mastra/deployer-vercel@latest ``` **pnpm**: ```bash pnpm add @mastra/deployer-vercel@latest ``` **Yarn**: ```bash yarn add @mastra/deployer-vercel@latest ``` **Bun**: ```bash bun add @mastra/deployer-vercel@latest ``` ## 사용예 `VercelDeployer`를 가져와 Mastra 구성의 배포자로 설정하세요. ```typescript import { Mastra } from '@mastra/core' import { VercelDeployer } from '@mastra/deployer-vercel' export const mastra = new Mastra({ deployer: new VercelDeployer(), }) ``` ## 생성자 옵션 배포자는 다음 옵션을 허용합니다. - `studio?: boolean`: API와 함께 [Studio](https://mastra.zisheng.pro/ko/docs/studio/overview)를 Vercel의 Edge CDN에서 제공되는 정적 자산으로 배포합니다. 기본값은 `false`입니다. - `maxDuration?: number`: 함수 실행 제한 시간(초) - `memory?: number`: 함수 Memory(MB) - `regions?: string[]`: 함수를 배포할 리전(예: `['sfo1','iad1']`) `maxDuration`, `memory`, `regions` 옵션은 기본 필드(`handler`, `launcherType`, `runtime`, `shouldAddHelpers`)를 보존하면서 `.vercel/output/functions/index.func/.vc-config.json`에 병합됩니다. ### 재정의 예시 ```typescript import { Mastra } from '@mastra/core' import { VercelDeployer } from '@mastra/deployer-vercel' export const mastra = new Mastra({ deployer: new VercelDeployer({ studio: true, maxDuration: 600, memory: 1536, regions: ['sfo1', 'iad1'], }), }) ``` ## 빌드 출력 `mastra build`를 실행하면 배포자가 Vercel의 [Build Output API (v3)](https://vercel.com/docs/build-output-api/v3)를 준수하는 `.vercel/output` 디렉터리를 생성합니다. 이 디렉터리에는 프레임워크 감지를 우회하여 Vercel이 직접 배포하는 라우팅 구성과 서버리스 함수 번들이 포함됩니다. 출력에는 다음이 포함됩니다. - **구성.json**: 요청을 적절한 핸들러로 전달하는 라우팅 구성 - **기능/**: 귀하의 Mastra 서버가 서버리스 기능으로 번들로 제공됩니다. - **공전/**: Studio SPA 자산(해당되는 경우에만)`studio: true`) 스튜디오가 없는 경우: ```bash .vercel/ └── output/ ├── config.json └── functions/ └── index.func/ ├── .vc-config.json ├── index.mjs └── node_modules/ ``` 와 함께`studio: true`: ```bash .vercel/ └── output/ ├── config.json ├── static/ │ ├── index.html │ └── assets/ │ ├── *.js │ └── *.css └── functions/ └── index.func/ ├── .vc-config.json ├── index.mjs └── node_modules/ ``` Studio가 활성화되면 `/api/*` 요청은 서버리스 함수에서 처리되고, 정적 자산(JS, CSS)은 함수 호출 없이 Vercel의 Edge CDN에서 제공되며, 그 밖의 모든 경로는 클라이언트 측 라우팅을 위해 `index.html`로 폴백하도록 라우팅이 구성됩니다. 이 폴더는 빌드 중에 생성되며 버전 제어에 커밋되어서는 안 됩니다.