[feat]: build a subset of bundles with --bundle, for per-bundle task caching

Abierto
#238 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 6 días

@unrevised6419 ya está trabajando en esto.

Desde el 24/9/2026.

  • #239 de @unrevised6419 — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Review the build, watch, and verify command entry points alongside package.json exports. Exercise --bundle with single, repeated, comma-separated, omitted, unknown, duplicate, and empty selections. Done means each command can target exact export keys while the default behavior remains unchanged.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

A clear and concise description of what the feature is

strapi-plugin build always builds every bundle declared in package.json exports. A --bundle <name> flag would restrict the run to a subset, where a name is an export key such as ./strapi-admin, ./strapi-server or a custom one.

strapi-plugin build --bundle ./strapi-admin
strapi-plugin build --bundle ./strapi-server,./shared
Why should this feature be included?

Task runners with caching (Nx, Turborepo) key a cache entry on a task's inputs and outputs. Each bundle already has its own output directory (dist/admin, dist/server), but because one command produces all of them, they can only be declared as a single task with dist as its output. Touching a server file therefore invalidates the admin bundle too, and the admin build re-runs for nothing.

With --bundle, each bundle becomes its own task with its own inputs and outputs, so a change in one does not invalidate the cache of the others:

"build-admin":  { "command": "strapi-plugin build --bundle ./strapi-admin",  "outputs": ["{projectRoot}/dist/admin"] },
"build-server": { "command": "strapi-plugin build --bundle ./strapi-server", "outputs": ["{projectRoot}/dist/server"] }

The same argument applies to watch (watch only the bundle being worked on) and to verify (check the files of a plugin built one bundle at a time).

Please provide an example for how this would work

Omitting the flag keeps today's behaviour. The flag is repeatable and accepts a comma-separated list, and names are matched exactly against the export keys, so an unknown, duplicated or empty selection fails rather than silently building everything.

I have a working implementation for build, watch and verify and am happy to open a PR if this is something you would consider.

Lenguaje dominante
TypeScript
Estrellas
24
Forks
13
Merge medio
5 d 3 h
PR fusionados (30 d)
5

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de strapi/sdk-plugin

Todos los issues de strapi/sdk-plugin

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.