A production dependency is a package required by an application in its deployed runtime environment. Unlike testing frameworks, linters, and debugging utilities, it contributes directly to the running application and belongs in the production dependency set. section 8.2.2
Keep production dependencies accurate and bounded:
- List installed packages and compare them with imports used by application code. section 8.2.2
- Remove unused packages and recategorize development tools so package managers can exclude them from production builds. section 8.2.2
- Pin resolved versions and repeat the analysis over time to prevent dependency accumulation. section 8.2.2
Checkout API cleanup
After reducing its container image to 340MB, a checkout API team used pipreqs to compare 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

