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 react-native-calendars@1.1314.0 and Expo SDK 56:
- Before: the source map contained the complete
lodash/lodash.js source
(545,941 bytes).
- After:
lodash/lodash.js was 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.
CalendarProviderimportsincludesfrom the lodash package root:When building an Expo web application with Metro, this causes the complete
lodash/lodash.jsmodule to be included in the bundle.Suggested change
Import the individual method instead:
This preserves the existing behavior, including when
disableAutoDaySelectionis undefined.Measured impact
Tested with
react-native-calendars@1.1314.0and Expo SDK 56:lodash/lodash.jssource(545,941 bytes).
lodash/lodash.jswas absent.approximately 754 KB to 198 KB.
The Expo web export completed successfully after applying this change.