feat(build): optionally build an ES2015 distro (#13471)
PR Close #13471
This commit is contained in:
parent
f816319e41
commit
be6c95ad03
14
build.sh
14
build.sh
|
@ -112,6 +112,7 @@ do
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
SRCDIR=${PWD}/modules/@angular/${PACKAGE}
|
SRCDIR=${PWD}/modules/@angular/${PACKAGE}
|
||||||
DESTDIR=${PWD}/dist/packages-dist/${PACKAGE}
|
DESTDIR=${PWD}/dist/packages-dist/${PACKAGE}
|
||||||
|
ES2015_DESTDIR=${PWD}/dist/packages-dist-es2015/${PACKAGE}
|
||||||
UMD_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.js
|
UMD_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.js
|
||||||
UMD_TESTING_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-testing.umd.js
|
UMD_TESTING_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-testing.umd.js
|
||||||
UMD_STATIC_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-static.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 ====="
|
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-build.json ====="
|
||||||
$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
|
if [[ -e ${SRCDIR}/tsconfig-upgrade.json ]]; then
|
||||||
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-upgrade.json ====="
|
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-upgrade.json ====="
|
||||||
|
@ -214,8 +222,12 @@ do
|
||||||
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_UPGRADE_ES5_MIN_PATH} ${UMD_UPGRADE_ES5_PATH}
|
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_UPGRADE_ES5_MIN_PATH} ${UMD_UPGRADE_ES5_PATH}
|
||||||
fi
|
fi
|
||||||
) 2>&1 | grep -v "as external dependency"
|
) 2>&1 | grep -v "as external dependency"
|
||||||
|
|
||||||
|
if [[ -n "${EXPERIMENTAL_ES2015_DISTRO}" ]]; then
|
||||||
|
cp -prv ${DESTDIR}/bundles ${ES2015_DESTDIR}
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
echo "====== VERSION: Updating version references"
|
echo "====== VERSION: Updating version references"
|
||||||
cd ${DESTDIR}
|
cd ${DESTDIR}
|
||||||
|
|
|
@ -68,7 +68,11 @@ function publishRepo {
|
||||||
|
|
||||||
# Publish all individual packages from packages-dist.
|
# Publish all individual packages from packages-dist.
|
||||||
function publishPackages {
|
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
|
do
|
||||||
COMPONENT="$(basename ${dir})"
|
COMPONENT="$(basename ${dir})"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue