Optimize Core Web Vitals - FCP and LCP: Remove not need dependencies

Check if any dependencies use this package

For example, use yarn to check glob

yarn why glob

Output

Image description

This package is already used by another package

For example, when seeing

info Has been hoisted to "glob"
info Reasons this module exists
   - Specified in "dependencies"
   - Hoisted from "@next#eslint-plugin-next#glob"
info Disk size without dependencies: "68KB"
info Disk size with unique dependencies: "208KB"
info Disk size with transitive dependencies: "300KB"
info Number of shared dependencies: 8
...

The package is not used by other packages

For example, when seeing

=> Found "[email protected]"
info Has been hoisted to "negotiator"
info This module exists because it's specified in "dependencies".
info Disk size without dependencies: "48KB"
info Disk size with unique dependencies: "48KB"
info Disk size with transitive dependencies: "48KB"
info Number of shared dependencies: 0

Run yarn list --pattern to filter the dependency list by pattern flag.

yarn list --pattern negotiator

We can then remove the unused packages.