This content originally appeared on DEV Community and was authored by Jen C.
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
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 "negotiator@0.6.2"
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 <pattern>
to filter the dependency list by pattern flag.
yarn list --pattern negotiator
We can then remove the unused packages.
This content originally appeared on DEV Community and was authored by Jen C.

Jen C. | Sciencx (2025-03-27T07:09:11+00:00) Optimize Core Web Vitals – FCP and LCP: Remove not need dependencies. Retrieved from https://www.scien.cx/2025/03/27/optimize-core-web-vitals-fcp-and-lcp-remove-not-need-dependencies/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.