What is the right way to extract source maps?
alexmbp opened this issue · 1 comments
alexmbp commented
Hi there! I need a way to extract source maps for production build. To have good crash reporting. What is the right way to do it?
skellock commented
One way is to run this in your project's root directory:
react-native bundle \
--dev false \
--platform ios \
--entry-file index.js \
--bundle-output deleteme.jsbundle \
--sourcemap-output index.mapPress enter, and go grab a cup of coffee.
Some notes:
--dev falseensures you cut a production build.metrowill shake out unneeded imports and removeif (__DEV__)chunks o' code--platform ioshas aandroidoption too--entry-file index.jsis the default entry point... if you've changed this manually you'll know--bundle-outputis the giant js file that gets embedded in your app ... for straight up source map output (like what you're asking for), this is a byproduct you can delete (hence the name)--source-outputfinally what you're looking for!! heads up, there are different maps for ios and android (exactly why, i'm not sure), so mind the file name so you don't clobber yourself.