feat(build): optionally build an ES2015 distro (#13471)

PR Close #13471
This commit is contained in:
Alex Eagle 2017-01-12 17:35:02 -08:00 committed by Miško Hevery
parent f816319e41
commit be6c95ad03
2 changed files with 18 additions and 2 deletions

View File

@ -112,6 +112,7 @@ do
PWD=`pwd`
SRCDIR=${PWD}/modules/@angular/${PACKAGE}
DESTDIR=${PWD}/dist/packages-dist/${PACKAGE}
ES2015_DESTDIR=${PWD}/dist/packages-dist-es2015/${PACKAGE}
UMD_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.js
UMD_TESTING_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-testing.umd.js
UMD_STATIC_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-static.umd.js
@ -131,6 +132,13 @@ do
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-build.json ====="
$TSC -p ${SRCDIR}/tsconfig-build.json
# ES2015 distro is not ready yet; don't slow down all builds for it
# TODO(alexeagle,igorminar): figure out ES2015 story and enable
if [[ -n "${EXPERIMENTAL_ES2015_DISTRO}" ]]; then
$TSC -p ${SRCDIR}/tsconfig-build.json --target es2015 --outDir ${ES2015_DESTDIR}
cp ${SRCDIR}/package.json ${ES2015_DESTDIR}/
cp ${PWD}/modules/@angular/README.md ${ES2015_DESTDIR}/
fi
if [[ -e ${SRCDIR}/tsconfig-upgrade.json ]]; then
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-upgrade.json ====="
@ -214,6 +222,10 @@ do
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_UPGRADE_ES5_MIN_PATH} ${UMD_UPGRADE_ES5_PATH}
fi
) 2>&1 | grep -v "as external dependency"
if [[ -n "${EXPERIMENTAL_ES2015_DISTRO}" ]]; then
cp -prv ${DESTDIR}/bundles ${ES2015_DESTDIR}
fi
fi
(

View File

@ -68,7 +68,11 @@ function publishRepo {
# Publish all individual packages from packages-dist.
function publishPackages {
for dir in dist/packages-dist/*/ dist/tools/@angular/tsc-wrapped
PKGS_DIST=dist/packages-dist
if [[ -n "${EXPERIMENTAL_ES2015_DISTRO}" ]]; then
PKGS_DIST=dist/packages-dist-es2015
fi
for dir in $PKGS_DIST/*/ dist/tools/@angular/tsc-wrapped
do
COMPONENT="$(basename ${dir})"