Add build script to fix babelrc problems

This commit is contained in:
Jake Howard 2016-04-28 14:44:03 +01:00
parent a8648c9a14
commit 1794782c11

20
build Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
if [ -z "$NVM_DIR" ]
then
NVM_DIR="~/.nvm"
fi
. $NVM_DIR/nvm.sh
nvm install
nvm use
set -e
npm install
echo "Fixing the hacks..."
# React-Native doesnt like having .babelrc files in modules, and officially suggests not shipping react-native modules with them included.
# This script scans all sub-dirs of node_modules, and removes any it finds, except the ones inside react-native itself.
find node_modules -type f -name .babelrc | grep -v /react-native/ | xargs rm || echo "Already patched!"