Just nuked 120 unused NPM deps from a Nx monorepo
6 hours ago
- #dependency-management
- #performance-optimization
- #monorepo
- Used Knip to identify and remove unused dependencies in an Nx monorepo, reducing package count from 510 to 390.
- Knip was chosen over depcheck for its modern setup compatibility and monorepo understanding.
- Process involved scanning, verifying through builds and tests, and maintaining an ignore list for false positives.
- Yarn install time reduced by approximately a minute, and security alerts decreased.
- Knip's effectiveness varied, excelling in direct imports but less so with indirect usage like scripts or CI.
- Implemented a cautious merge strategy with preview deployments to ensure stability.
- Future plans include integrating Knip into CI for ongoing dependency management.