No large unused dependencies in bundle
Why it matters
Unused production dependencies are dead weight with live consequences: they bloat the bundle, slow install times, expand the attack surface, and create maintenance debt for packages that will never receive targeted security updates. moment (60KB gzipped), full lodash (70KB gzipped), and date-fns without tree-shaking are common culprits found installed for a single date formatting call. Beyond bundle size, ISO 25010 performance-efficiency.resource-utilization counts every unnecessarily included module as a resource waste — and npm audit flags transitive vulnerabilities in packages you don't actually use.
Severity rationale
Medium because unused large dependencies directly add payload to the bundle and expand the vulnerability surface area, even when the package itself works correctly.
Remediation
Audit production dependencies against actual import usage. Remove packages that are never imported; replace heavy packages that are used for a single function with a lighter alternative or native implementation.
# Identify unused dependencies
npx depcheck
# Remove confirmed-unused packages
npm uninstall moment lodash
// Before — 60KB for one function
import moment from 'moment'
const formatted = moment(date).format('YYYY-MM-DD')
// After — native, zero bytes added
const formatted = new Date(date).toISOString().slice(0, 10)
// Or tree-shakeable alternative
import { format } from 'date-fns'
const formatted = format(date, 'yyyy-MM-dd')
// Before — 70KB lodash for one utility
import _ from 'lodash'
const result = _.debounce(fn, 300)
// After — tree-shakeable import
import debounce from 'lodash-es/debounce'
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Performance & Load Readiness Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · performance-efficiency.resource-utilization — Resource Utilization
Taxons
History
- 2026-04-18·v1.0.0·Initial import from performance-load·automated