Tree-shaking enabled
Why it matters
Without "sideEffects": false in package.json, webpack and Rollup conservatively assume every module in your package has side effects and include all of it in every consumer bundle. Even if the consumer only calls one function, they get the entire package. ISO 25010 resource-utilization is directly impacted: consumers pay the full bundle cost regardless of actual usage. CJS-only output compounds this — tree-shaking is an ESM feature, so CJS packages cannot be tree-shaken at all, regardless of the sideEffects declaration.
Severity rationale
High because the absence of `sideEffects: false` causes all major bundlers to include the entire package in consumer builds, even when only a fraction of the API is used.
Remediation
Declare sideEffects: false in package.json and ensure the package outputs ESM.
{ "sideEffects": false }
If specific files have legitimate side effects (CSS imports, global polyfills), list only those:
{ "sideEffects": ["./dist/styles.css"] }
Tree-shaking requires three things together: ESM output format, named exports, and the sideEffects declaration. All three must be present. Verify with rollup --input dist/index.mjs --file out.js and check whether unused exports appear in the output.
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 SDK / Package Quality 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 utilisation — tree-shaking reduces consumer bundle size
- iso-25010:2011 · compatibility.interoperability — Interoperability — sideEffects declaration enables bundler optimisations
Taxons
History
- 2026-04-18·v1.0.0·Initial import from sdk-package-quality·automated