How to find unused package exports
In a monorepo
- Add the
check-exports
script in thepackage.json
of the package that needs to be checked
"scripts": { "check-exports": "pure-index"}
- Run
npm run check-exports
- Depending on the project, you may need to configure Pure Index.
In different repositories
- Use the findUnusedExports function from JavaScript API.