Saltar al contenido
Skillpedia
APIs y servidores (backend)8,1 mil · #12581

api-bundle-size-limit

Qué hace

Esta habilidad ayuda a tu IA a cambiar el límite de tamaño de la compilación de la API de Webiny. Es para desarrolladores cuya compilación de la API falla porque el paquete supera el límite por defecto.

Cuándo usarla

  • ✓Cuando tu compilación de la API de Webiny falla con un error de límite de tamaño de activos.
  • ✓Cuando el paquete de la API supera el límite por defecto de 4,5 MB.
  • ✓Cuando quieres aplicar un límite de tamaño más estricto al paquete de la API.

Link de la skill

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api-bundle-size-limit/SKILL.md

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api-bundle-size-limit/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Mi compilación de Webiny falla con un error de límite de tamaño de activos. Sube el límite del paquete de la API a 6 MB.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

La habilidad muestra cómo añadir un ajuste en el archivo de configuración de Webiny, con el tamaño escrito en bytes. También explica cómo leer el mensaje de error de la compilación.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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 context
  • api-lambda-function -- adding custom Lambda functions to the API
Preguntas frecuentes

¿Cuál es el límite por defecto?

El límite por defecto para el paquete Lambda de la API es de 4,5 MB.

¿Qué unidad usa el ajuste?

Usa bytes, así que 6 MB se escribe como 6 por 1024 por 1024.

¿Puedo hacer el límite más estricto?

Sí. La habilidad indica que puedes poner un límite más bajo para exigir un tamaño más estricto.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
8,1 mil
Posición en el ranking
#12581
Licencia
—
Actualizada
2/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas