api-bundle-size-limit
하는 일
이 스킬은 Webiny API 빌드의 크기 제한을 바꾸는 과정에서 AI를 돕습니다. 기본 제한보다 번들이 커서 API 빌드가 실패하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Webiny API 빌드가 자산 크기 제한 오류로 실패할 때.
- ✓API 번들이 기본 4.5 MB 제한보다 클 때.
- ✓API 번들에 더 엄격한 크기 제한을 적용하고 싶은 경우.
스킬 링크
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api-bundle-size-limit/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“Webiny 빌드가 자산 크기 제한 오류로 실패합니다. API 번들 제한을 6MB로 올려 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 Webiny 설정 파일에 설정을 추가하는 방법을 보여 줍니다. 크기는 바이트 단위로 씁니다. 빌드 오류 메시지를 읽는 방법도 설명합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
API Bundle Size Limit
TL;DR
The Infra.Api.MaxBundleSize extension enforces a maximum size on the built API Lambda bundle. The default limit is 4.5 MB. If the bundle exceeds the limit the build fails with a clear error; add the extension to webiny.config.tsx to raise (or lower) it.
Default Behavior
By default Webiny enforces a 4.5 MB limit on the API Lambda bundle (handler.mjs). If the built output exceeds this, the build fails:
error Build errors:
× asset size limit: The following asset(s) exceed the recommended size limit (4.5 MiB).
× entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (4.5 MiB).
error build failed
Raising the Limit
Add Infra.Api.MaxBundleSize to webiny.config.tsx with size in bytes:
// webiny.config.tsx
import { Infra } from "webiny/extensions";
export const Extensions = () => (
<>
{/* Raise the API bundle size limit to 6 MB */}
<Infra.Api.MaxBundleSize size={6 * 1024 * 1024} />
</>
);
Common byte values:
| MB | Bytes expression | Exact bytes |
|---|---|---|
| 4.5 | Math.round(4.5 * 1024 * 1024) |
4718592 (default) |
| 5 | 5 * 1024 * 1024 |
5242880 |
| 6 | 6 * 1024 * 1024 |
6291456 |
| 8 | 8 * 1024 * 1024 |
8388608 |
| 10 | 10 * 1024 * 1024 |
10485760 |
How It Works
The extension sets the WEBINY_INFRA_API_MAX_BUNDLE_SIZE environment variable (in bytes) which is read by the API bundler (@webiny/build-tools) at build time. The WEBINY_INFRA_ prefix ensures the variable is not automatically forwarded to the Lambda function's runtime environment.
Lowering the Limit
You can also enforce a stricter limit to catch bundle regressions early:
{
/* Enforce a strict 3 MB limit */
}
<Infra.Api.MaxBundleSize size={3 * 1024 * 1024} />;
Quick Reference
| Task | Snippet |
|---|---|
| Raise to 6 MB | <Infra.Api.MaxBundleSize size={6 * 1024 * 1024} /> |
| Raise to 10 MB | <Infra.Api.MaxBundleSize size={10 * 1024 * 1024} /> |
| Restore default (4.5 MB) | Remove the extension |
| Convert MB to bytes | Math.round(N * 1024 * 1024) |
Related Skills
infra-env-var-- setting arbitrary environment variables in the project contextapi-lambda-function-- adding custom Lambda functions to the API
자주 묻는 질문
기본 제한은 얼마인가요?
API Lambda 번들의 기본 제한은 4.5 MB입니다.
설정은 어떤 단위를 쓰나요?
바이트 단위를 쓰므로 6 MB는 6 × 1024 × 1024로 씁니다.
제한을 더 엄격하게 할 수 있나요?
네. 더 낮은 제한을 설정해 더 엄격한 크기를 강제할 수 있다고 스킬이 설명합니다.
상세 정보
작성자의 원본 설명
Covers how to configure the maximum allowed size of the Webiny API Lambda bundle using the Infra.Api.MaxBundleSize extension in webiny.config.tsx. Use when a project's API bundle exceeds the default 4.5 MB limit or when you want to enforce a stricter limit. Handles the extension syntax, byte calculations, and interpreting the build error message.
repo: webiny/webiny-js
인기도
- GitHub 스타
- 8.1k
- 순위
- #12581
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
prd-to-plan
8.1k에이전트가 제품 요구사항 문서를 작고 끝까지 이어지는 조각들로 된 단계별 계획으로 바꿔 Markdown 파일로 저장하도록 돕습니다.
webiny-admin-architect
8.1k에이전트에게 Webiny 플랫폼의 관리자 화면을 비즈니스 로직 계층과 프레젠터 패턴으로 만드는 방법을 가르칩니다.
webiny-admin-permissions
8.1k에이전트에게 Webiny 관리자 화면에 권한 제어를 추가하는 법을 가르칩니다. 스키마에서 권한 양식을 자동 생성하고 표시 여부를 확인합니다.
webiny-form-model
8.1k에이전트에게 선언형 필드 빌더, 레이아웃, 검증, 조건부 규칙으로 Webiny 양식을 만드는 법을 가르칩니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.