How to remove the unused dependencies of my dependencies in node_modules?

17 views Asked by At

I have a next.js 14 project that uses NextUI components, I built it and tested it with lighthouse, it pointed out some directories in the node_module under the "Reduce unused JavaScript":

enter image description here

Now are those directories safe to manually delete? I have checked nextUI components and it appears that @react-aria is dependency of it, however, as can be seen in the previous image, table directory is not used (and I don't use or will use tables in my app), so can I just remove it?

I tried using depcheck, but it didn't give what I expected:

`Unused dependencies

  • sharp Unused devDependencies
  • @types/node
  • @types/react-dom
  • autoprefixer
  • postcss Missing dependencies
  • @dnd-kit/utilities: ./app/components/CheckboxForm.tsx`

Those deps. are my direct dependencies not dependencies of my dependencies.

0

There are 0 answers