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

Aperta
#238 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

@unrevised6419 ci sta già lavorando.

Dal 24/9/2026.

  • #239 di @unrevised6419 — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
24
Fork
13
Merge medio
5g 3h
PR unite (30g)
5

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di strapi/sdk-plugin

Tutte le issue di strapi/sdk-plugin

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.