-
-
Save devxom/1b16f3c470663a649c58f1d848e2585f to your computer and use it in GitHub Desktop.
Monkeypatch yarn issue #761
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
#!/bin/bash | |
# Monkeypatching yarn issue #761 installing with --production flag without devDependencies | |
if [ -n $NODE_ENV ] && [ "$NODE_ENV" == "production" ] || [ "$NODE_ENV" == "staging" ] | |
then | |
# Backup package.json and remove devDep | |
cp package.json original_package.json | |
jq 'del(.devDependencies)' package.json > tmp.json && mv tmp.json package.json | |
#Install | |
yarn --production | |
#Restore package.json | |
mv original_package.json package.json | |
else | |
yarn | |
fi | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment