Avoid minify in react-native in release mode
Asked Answered
C

2

6

I'm Generating the release APK for Android and want to test it without minifying the code.

How can I generate a release version for Android or iOS without minify the code?

Thanks.

Counterweight answered 22/2, 2017 at 19:59 Comment(2)
Have you checked app/build.gradle file for buildTypes?Diagenesis
I checked but seems nothing related with React-native bundleCounterweight
S
3

If you are using the default react-native cli you just need to use --minify false.

e.g.

node node_modules/react-native/local-cli/cli.js bundle --entry-file index.js --platform ios  --minify false --dev false --reset-cache --bundle-output './ios/MobileTravelAdvisor/main.jsbundle' --assets-dest './ios' 
Sincere answered 12/9, 2019 at 3:38 Comment(0)
C
1

Haul to the rescue,

Finally I found a solution, it seems that using Haul to generate the bundle is possible with the flag --minify false, use it with the command haul bundle

Counterweight answered 7/4, 2017 at 20:49 Comment(2)
It's not possible to disable minification in production bundle.Munger
Check --minify github.com/callstack/haul/blob/master/docs/CLI%20Commands.mdCounterweight

© 2022 - 2024 — McMap. All rights reserved.