What problem does it solve?
Webiny enforces a default 4.5 MB limit on the built API Lambda bundle, and builds fail with an asset size limit error when the output exceeds it. This Skill explains how to raise or lower that limit so builds succeed or regressions are caught early.
Core Features & Use Cases
- Raise the limit: Add the Infra.Api.MaxBundleSize extension in webiny.config.tsx with a size in bytes to allow larger API bundles.
- Enforce stricter limits: Set a lower byte threshold to catch bundle size regressions during builds.
- Byte conversion reference: Provides a lookup table converting megabytes to exact byte expressions.
- Use Case: Your Webiny project build fails with "asset size limit: The following asset(s) exceed the recommended size limit (4.5 MiB)". Add <Infra.Api.MaxBundleSize size={6 * 1024 * 1024} /> to webiny.config.tsx to raise the limit to 6 MB and rebuild.
Quick Start
Add the Infra.Api.MaxBundleSize extension with a byte size to webiny.config.tsx to change the API bundle size limit.