Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(script): fix compile-to-es5 script (#4676)
Browse files Browse the repository at this point in the history
make compile-to-es5 script rely on native es6-promise typing
  • Loading branch information
qiyigg authored Jan 25, 2018
1 parent 964baba commit a62a154
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions scripts/compile_to_es5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,15 @@ if [ "$#" -gt 0 ]; then
exit 1
fi

echo "Getting types for es6 promises..."
npm install @types/es6-promise
if [ $? -ne 0 ]; then
echo -e "\033[0;31m" 1>&2 # Red
echo "Couldn't get types for es6 promises."
echo -e "\033[0m" 1>&2 # Normal Color
exit 1
fi

echo "Compiling down to es5..."
node node_modules/typescript/bin/tsc --target es5
node node_modules/typescript/bin/tsc --target es5 --lib DOM,ES5,ScriptHost,ES2015.Promise
if [ $? -ne 0 ]; then
echo -e "\033[0;31m" 1>&2 # Red
echo "Couldn't compile for es5."
echo -e "\033[0m" 1>&2 # Normal Color
npm remove @types/es6-promise
exit 1
fi

echo "Uninstalling types for es6 promises..."
npm remove @types/es6-promise
if [ $? -ne 0 ]; then
echo -e "\033[0;33m" 1>&2 # Yellow
echo "Warning: couldn't uninstall types for es6 promises"
echo -e "\033[0m" 1>&2 # Normal Color
fi

echo -e "\033[0;32m" # Green
echo "Compiled to es5"
echo -e "\033[0m" 1>&2 # Normal Color

0 comments on commit a62a154

Please sign in to comment.