Pular para o conteúdo
Skillpedia
APIs e servidores (backend)8,1 mil · #12581

api-bundle-size-limit

O que ela faz

Esta skill ajuda sua IA a alterar o limite de tamanho do build da API do Webiny. É para desenvolvedores cujo build da API falha porque o bundle é maior que o limite padrão.

Quando usar

  • ✓Quando seu build da API Webiny falha com um erro de limite de tamanho de asset.
  • ✓Quando seu bundle da API é maior que o limite padrão de 4,5 MB.
  • ✓Quando você quer um limite de tamanho mais rígido aplicado ao bundle da API.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api-bundle-size-limit/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Meu build do Webiny falha com um erro de limite de tamanho de asset. Aumente o limite do bundle da API para 6 MB.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A skill mostra como adicionar uma configuração no arquivo de configuração do Webiny, com o tamanho escrito em bytes. Também explica como ler a mensagem de erro do build.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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
Perguntas frequentes

Qual é o limite padrão?

O limite padrão do Lambda do bundle da API é 4,5 MB.

Qual unidade a configuração usa?

Ela usa bytes, então 6 MB é escrito como 6 vezes 1024 vezes 1024.

Posso tornar o limite mais rígido?

Sim. A skill diz que você pode definir um limite menor para impor um tamanho mais rigoroso.

Detalhes

Descrição original do 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

Popularidade

Estrelas no GitHub
8,1 mil
Posição no ranking
#12581
Licença
—
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas