Skip to content

Commit

Permalink
feat(build): optionally build an ES2015 distro (angular#13471)
Browse files Browse the repository at this point in the history
PR Close angular#13471
  • Loading branch information
alexeagle authored and wKoza committed Feb 12, 2017
1 parent 711ff82 commit 174bd09
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 13 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ====="
Expand Down Expand Up @@ -214,8 +222,12 @@ 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

(
echo "====== VERSION: Updating version references"
cd ${DESTDIR}
Expand Down
6 changes: 5 additions & 1 deletion scripts/publish/publish-build-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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})"

Expand Down

0 comments on commit 174bd09

Please sign in to comment.