Avoid bundling the full lodash package for a single `includes` import
Author: bogdanalexe90Created Jun 19, 2026Updated Jun 19, 2026
CalendarProvider imports includes from the lodash package root:
import { includes } from 'lodash';When building an Expo web application with Metro, this causes the complete
lodash/lodash.js module to be included in the bundle.
Suggested change
Import the individual method instead:
-import { includes } from 'lodash';
+import includes from 'lodash/includes';This preserves the existing behavior, including when
disableAutoDaySelection is undefined.
Measured impact
Tested with [email protected] and Expo SDK 56:
- Before: the source map contained the complete
lodash/lodash.jssource (545,941 bytes). - After:
lodash/lodash.jswas absent. - Total lodash source represented in the source map decreased from approximately 754 KB to 198 KB.
The Expo web export completed successfully after applying this change.
Source: wix/react-native-calendars