Created
August 17, 2016 18:13
-
-
Save pesterhazy/d05170f45e10b6916206583f28b21cae to your computer and use it in GitHub Desktop.
Set __DEV__ of RN packager output to false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# boot-react-native-no-dev.py | |
# | |
# Patch jsbundle to set __DEV__ to false | |
# | |
# The React Native packager often cannot handle Google Closure-generated JS files | |
# if `--dev false` is set, eventually running out of memory. As a workaround, | |
# use `--dev true` and patch the __DEV__ setting in the output bundle to | |
# false. | |
# | |
# Usage: | |
# | |
# python boot-react-native-no-dev.py < bundle.js > output.js | |
import sys, re | |
print(re.sub(r'__DEV__\s*=\s*true;', "__DEV__=false;", | |
sys.stdin.read())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment