Background
The project imports entire Expo modules but uses only a small subset of exports. Enable tree-shaking in metro config and webpack to eliminate unused code. This requires proper ES6 module exports and sideEffect: false configuration.
Description
Many Expo modules are imported in full even when only specific exports are used. By configuring Metro bundler and package.json correctly, we can enable tree-shaking to remove unused exports, reducing output size by 8-12%.
Current Behavior
Unused Expo module code bundled in production (~200KB of unused code)
Expected Behavior
Only used Expo exports included in bundle. Unused code automatically stripped by bundler.
Impact
📦 Direct bundle size reduction of 8-12%
⚡ Faster app startup
💡 Improved performance on low-bandwidth networks
Acceptance Criteria
Implementation Hints
Update metro.config.js with inlineRequires: true. Set optimization: true in production. Use expo build:web --analyze to identify removable code.
Performance Metrics
Before:
After (Target):
- bundleSize: 2.45 MB (-12%)
Related Issues
Background
The project imports entire Expo modules but uses only a small subset of exports. Enable tree-shaking in metro config and webpack to eliminate unused code. This requires proper ES6 module exports and sideEffect: false configuration.
Description
Many Expo modules are imported in full even when only specific exports are used. By configuring Metro bundler and package.json correctly, we can enable tree-shaking to remove unused exports, reducing output size by 8-12%.
Current Behavior
Unused Expo module code bundled in production (~200KB of unused code)
Expected Behavior
Only used Expo exports included in bundle. Unused code automatically stripped by bundler.
Impact
📦 Direct bundle size reduction of 8-12%
⚡ Faster app startup
💡 Improved performance on low-bandwidth networks
Acceptance Criteria
Implementation Hints
Update metro.config.js with inlineRequires: true. Set optimization: true in production. Use expo build:web --analyze to identify removable code.
Performance Metrics
Before:
After (Target):
Related Issues