A dependency is an external software component required to build or operate another component. Dependencies accumulate as packages are added, while indirect dependencies can grow the artifact without being obvious in application code. section 8.2.2
Dependency growth affects downloads, deployments, startup, and runtime artifact size. Development-only packages such as testing, linting, and debugging tools should not remain production dependencies. section 8.2.2 section 8.6
Manage dependencies as a measurable build concern:
- List installed and declared packages, then compare them with the imports or code that actually uses them. section 8.2.2
- Separate development dependencies from production dependencies so package managers can exclude unnecessary tools from production builds. section 8.2.2
- Inspect indirect dependencies and measure which packages consume the most space in the final artifact. section 8.2.2 section 8.6
- Repeat the audit over time because unused packages accumulate after features and tools are removed. section 8.2.2
Checkout API dependency audit
A checkout API reduced its container image from 2.1GB to 340MB, then used pipreqs to compare source imports with 23 declared dependencies. Eight unused or development-only packages were removed, along with their indirect dependencies, cutting another 40MB. section 8.2.2
pipreqs /path/to/your/project --savepath requirements-actual.txt
Run pipreqs to generate a requirements file from actual imports, then compare it with the declared dependency file. section 8.2.2


































