Removed unused packages
Is there an easy way to determine if you have packages in your package.json file that are no longer needed?
Depcheck is a tool for analyzing the dependencies in a project to see: how each dependency is used, which dependencies are useless, and which dependencies are missing from package.json
.
The package can be installed and ran using the following commands:
npm install depcheck -g
yarn global add depcheck
depcheck
Or you can use npx (a package runner):
npx depcheck
One thing to note: be careful removing packages within the devDependencies
list. Although the packages in this list is not installed with the --production
flag, it is typically used for packages that are only needed for local development and testing.