Background
Currently, our ESLint rules force lodash-es to use namespace imports (import * as _ from "lodash-es"), which prevents effective tree shaking and increases bundle size.
Proposed Change
Switch to named imports (import { get, map } from "lodash-es") to enable better tree shaking optimization.
Benefits
- ✅ Reduced bundle size through tree shaking
- ✅ Only include actually used lodash functions
- ✅ Better build optimization with modern bundlers
Impact
- Need to update ESLint rules (lodash-imports.js, lodash-ramda-imports.js)
- Codebase migration from
_.method() to method()
- Potential bundle size reduction
Considerations
- Trade-off between bundle optimization vs code consistency
- Migration effort across the codebase
Background
Currently, our ESLint rules force lodash-es to use namespace imports (
import * as _ from "lodash-es"), which prevents effective tree shaking and increases bundle size.Proposed Change
Switch to named imports (
import { get, map } from "lodash-es") to enable better tree shaking optimization.Benefits
Impact
_.method()tomethod()Considerations