Get the latest tech news

Cleaning house in Nx monorepo, how i removed unused deps safely


Real cleanup in a big Nx monorepo. I used Knip to flag unused deps, verified removals, handled false positives, and shaved about a minute off yarn install with lower CVE risk.

Short version, I ran Knip across our Nx repo, took the “unused” list as a hint, deleted candidates, built, tested, booted apps, and put a few back when they were secretly used. uninstall it build, test, lint, e2e, codegen/typegen, and then boot the owning app if something broke, put it back and document why in my Knip ignore list strings in config files, for example Jest preset or runner names CLI tools only used in scripts or CI plugin discovery patterns type-only or toolchain stuff

Get the Android app

Or read this on Hacker News

Read more on:

Photo of npm

npm

Photo of unused NPM

unused NPM

Photo of Nx monorepo

Nx monorepo

Related news:

News photo

NPM package caught using QR Code to fetch cookie-stealing malware

News photo

Show HN: Tips to stay safe from NPM supply chain attacks

News photo

Oh no, not again a meditation on NPM supply chain attacks