React Native skips JavaScript minification in production builds because the Hermes engine compiles JS to bytecode and performs dead code elimination (DCE) at that level, making a separate minification step redundant. The difference in bundle size between minified and non-minified JS is minimal (21.79 MB vs 21.62 MB in a real-world test). To verify that dead code is actually eliminated, you can decompile Hermes bytecode back to readable JS using the hermes-dec tool, allowing direct inspection of the final bundle.

4m read timeFrom callstack.com
Post cover image
Table of contents
Hermes dead code eliminationVerifying the dead code eliminationQuick guide: Decompiling hermes bytecode with hermes-decConclusion

Sort: