Browse Source

OPS: fixed patch for latest react

pulltorefresh
Overtorment 6 years ago
parent
commit
ee2b2a5096
  1. 2
      package.json
  2. 1
      patches/fix_mangle.sh
  3. 16
      patches/minifier.js.patch

2
package.json

@ -17,7 +17,7 @@
"rn-nodeify": "github:tradle/rn-nodeify"
},
"scripts": {
"prepare": "./patches/fix_mangle.sh; git apply patches/minifier.js.patch; git apply patches/minify.js.patch; git apply patches/transaction_builder.js.patch; git apply ./patches/transaction.js.patch; test -f sentry.sh && ./sentry.sh || true",
"prepare": "./patches/fix_mangle.sh; git apply patches/minifier.js.patch; git apply patches/minify.js.patch; git apply patches/transaction_builder.js.patch; git apply ./patches/transaction.js.patch",
"clean": "cd android/; ./gradlew clean; cd ..; rm -r -f /tmp/metro-cache/; rm -r -f node_modules/; npm cache clean --force; npm i; npm start -- --reset-cache",
"start": "node node_modules/react-native/local-cli/cli.js start",
"android": "react-native run-android",

1
patches/fix_mangle.sh

@ -2,3 +2,4 @@
grep -rl "mangle: { toplevel: true }" ./node_modules/ | xargs sed -i '' -e "s/mangle: { toplevel: true }/mangle: false/g" || true
grep -rl "mangle: {toplevel: true}" ./node_modules/ | xargs sed -i '' -e "s/mangle: {toplevel: true}/mangle: false/g" || true
grep -rl "BASE_MAP.fill(255)" ./node_modules/ | xargs sed -i '' -e "s/BASE_MAP.fill(255)/for (let c = 0 ; c< 256; c++) BASE_MAP[c] = 255;/g" || true
echo fix_mangle.sh done

16
patches/minifier.js.patch

@ -1,15 +1,15 @@
diff --git a/node_modules/metro-minify-uglify/src/minifier.js b/node_modules/metro-minify-uglify/src/minifier.js
index 021df4c..dcea186 100644
index b703ee4..fadc077 100644
--- a/node_modules/metro-minify-uglify/src/minifier.js
+++ b/node_modules/metro-minify-uglify/src/minifier.js
@@ -44,9 +44,7 @@ function minify(_ref) {
reserved = _ref.reserved,
@@ -67,9 +67,7 @@ function minify(_ref) {
config = _ref.config;
const options = _extends({}, config, {
- mangle: _extends({}, config.mangle, {
const options = _objectSpread({}, config, {
- mangle: _objectSpread({}, config.mangle, {
- reserved
- }),
+ mangle: false, // !!!!!!!!!!!!!!!!
sourceMap: _extends({}, config.sourceMap, {
+ mangle: false, // !!!!!!!!!!!!!!!!!!!!!!!!
sourceMap: _objectSpread({}, config.sourceMap, {
content: map
})

Loading…
Cancel
Save