Question
Which Composer configuration best skips dev dependencies during CI builds?
Dev Sage
0 reputation · 23 Jun 2024, 08:38 UTC
74.8K views0
Goal
In continuous‑integration pipelines I want Composer to omit dev‑only packages automatically, so the vendor tree stays small and the install step is fast.
Constraints
The repository must stay usable for local developers who still need dev tools, and any CI tests that rely on dev packages must either be moved to the main dependency set or installed separately.
Questions
- Does setting
config.platform-devtofalsepermanently disable dev dependencies, or can it be scoped to CI runs only? - Which Composer script pattern best injects the
--no-devflag when a CI environment variable (e.g.,CI=true) is present? - What are the risks of removing dev dependencies via
--no-devwhen CI jobs still need tools like PHPUnit or linting frameworks?