Skip to content

Commit de795ea

Browse files
jasonadenIgorMinar
authored andcommitted
perf: distrubute smaller bundled code and include es2015 bundle
TypeScript compiler will now build to ES2015 code and modules. Babili is used to minify ES2015 code, providing an initial optimization that we couldn't previously get just from Uglify. Uses Babel to convert ES2015 to UMD/ES5 code, and Uglify to minimize the output.
1 parent 738d93c commit de795ea

File tree

175 files changed

+2515
-1246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+2515
-1246
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"plugins": ["transform-es2015-modules-umd"],
3+
"presets": ["es2015"]
4+
}

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env:
3434
- secure: "MPx3UM77o5IlhT75PKHL0FXoB5tSXDc3vnCXCd1sRy4XUTZ9vjcV6nNuyqEf+SOw659bGbC1FI4mACGx1Q+z7MQDR85b1mcA9uSgHDkh+IR82CnCVdaX9d1RXafdJIArahxfmorbiiPPLyPIKggo7ituRm+2c+iraoCkE/pXxYg="
3535
matrix:
3636
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
37-
- CI_MODE=e2e EXPERIMENTAL_ES2015_DISTRO=1
37+
- CI_MODE=e2e
3838
- CI_MODE=js
3939
- CI_MODE=saucelabs_required
4040
- CI_MODE=browserstack_required

build.sh

Lines changed: 197 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ PACKAGES=(core
2020
compiler-cli
2121
language-service
2222
benchpress)
23+
2324
BUILD_ALL=true
2425
BUNDLE=true
2526
VERSION_PREFIX=$(node -p "require('./package.json').version")
2627
VERSION_SUFFIX="-$(git log --oneline -1 | awk '{print $1}')"
2728
ROUTER_VERSION_PREFIX=$(node -p "require('./package.json').version.replace(/^2/, '3')")
2829
REMOVE_BENCHPRESS=false
30+
BUILD_EXAMPLES=true
2931

3032
for ARG in "$@"; do
3133
case "$ARG" in
@@ -41,20 +43,53 @@ for ARG in "$@"; do
4143
VERSION_SUFFIX=""
4244
REMOVE_BENCHPRESS=true
4345
;;
46+
--examples=*)
47+
BUILD_EXAMPLES=${ARG#--examples=}
48+
;;
4449
*)
4550
echo "Unknown option $ARG."
4651
exit 1
4752
;;
4853
esac
4954
done
5055

56+
getPackageContents() {
57+
echo "{\"typings\": \"../typings/${2}/${2}.d.ts\", \"main\": \"../bundles/${1}-${2}.umd.js\", \"module\": \"../@angular/${1}/${2}.es5.js\", \"es2015\": \"../@angular/${1}/${2}.js\"}"
58+
}
59+
60+
containsElement () {
61+
local e
62+
for e in "${@:2}"; do
63+
[[ "$e" == "$1" ]] && return 0;
64+
done
65+
return 1
66+
}
67+
68+
NON_MODULE=(
69+
platform-browser
70+
)
71+
72+
moveTypings() {
73+
# $1 == Source copy root (/src or /testing)
74+
# $2 == Final destination directory
75+
rsync -a --exclude=*.js* ${1} ${2}
76+
}
77+
78+
cleanTypings() {
79+
# $1 == Source root (where index.d.ts file is, for instance)
80+
# $2 == Source copy root (/src or /typings)
81+
rm -f ${1}/index.*
82+
rm -rf ${2}
83+
}
5184
VERSION="${VERSION_PREFIX}${VERSION_SUFFIX}"
5285
ROUTER_VERSION="${ROUTER_VERSION_PREFIX}${VERSION_SUFFIX}"
5386
echo "====== BUILDING: Version ${VERSION} (Router ${ROUTER_VERSION})"
5487

5588
export NODE_PATH=${NODE_PATH}:$(pwd)/dist/all:$(pwd)/dist/tools
5689
TSC="node --max-old-space-size=3000 dist/tools/@angular/tsc-wrapped/src/main"
5790
UGLIFYJS=`pwd`/node_modules/.bin/uglifyjs
91+
BABELJS=`pwd`/node_modules/.bin/babel
92+
BABILI=`pwd`/node_modules/.bin/babili
5893
TSCONFIG=./tools/tsconfig.json
5994
echo "====== (tools)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} ====="
6095
rm -rf ./dist/tools/
@@ -111,16 +146,30 @@ fi
111146
for PACKAGE in ${PACKAGES[@]}
112147
do
113148
PWD=`pwd`
149+
ROOTDIR=${PWD}/modules/@angular
114150
SRCDIR=${PWD}/modules/@angular/${PACKAGE}
115151
DESTDIR=${PWD}/dist/packages-dist/${PACKAGE}
116-
ES2015_DESTDIR=${PWD}/dist/packages-dist-es2015/${PACKAGE}
117-
UMD_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.js
118-
UMD_TESTING_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-testing.umd.js
119-
UMD_STATIC_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-static.umd.js
120-
UMD_UPGRADE_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-upgrade.umd.js
121-
UMD_ES5_MIN_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.min.js
122-
UMD_STATIC_ES5_MIN_PATH=${DESTDIR}/bundles/${PACKAGE}-static.umd.min.js
123-
UMD_UPGRADE_ES5_MIN_PATH=${DESTDIR}/bundles/${PACKAGE}-upgrade.umd.min.js
152+
DEST_MODULE=${DESTDIR}/@angular
153+
DEST_BUNDLES=${DESTDIR}/bundles
154+
155+
# ESM/ES6
156+
JS_PATH=${DEST_MODULE}/${PACKAGE}.js
157+
JS_PATH_ES5=${DEST_MODULE}/${PACKAGE}.es5.js
158+
JS_TESTING_PATH=${DEST_MODULE}/${PACKAGE}/testing.js
159+
JS_TESTING_PATH_ES5=${DEST_MODULE}/${PACKAGE}/testing.es5.js
160+
JS_STATIC_PATH=${DEST_MODULE}/${PACKAGE}/static.js
161+
JS_STATIC_PATH_ES5=${DEST_MODULE}/${PACKAGE}/static.es5.js
162+
JS_UPGRADE_PATH=${DEST_MODULE}/${PACKAGE}/upgrade.js
163+
JS_UPGRADE_PATH_ES5=${DEST_MODULE}/${PACKAGE}/upgrade.es5.js
164+
165+
# UMD/ES5
166+
UMD_ES5_PATH=${DEST_BUNDLES}/${PACKAGE}.umd.js
167+
UMD_TESTING_ES5_PATH=${DEST_BUNDLES}/${PACKAGE}-testing.umd.js
168+
UMD_STATIC_ES5_PATH=${DEST_BUNDLES}/${PACKAGE}-static.umd.js
169+
UMD_UPGRADE_ES5_PATH=${DEST_BUNDLES}/${PACKAGE}-upgrade.umd.js
170+
UMD_ES5_MIN_PATH=${DEST_BUNDLES}/${PACKAGE}.umd.min.js
171+
UMD_STATIC_ES5_MIN_PATH=${DEST_BUNDLES}/${PACKAGE}-static.umd.min.js
172+
UMD_UPGRADE_ES5_MIN_PATH=${DEST_BUNDLES}/${PACKAGE}-upgrade.umd.min.js
124173

125174
if [[ ${PACKAGE} != router ]]; then
126175
LICENSE_BANNER=${PWD}/modules/@angular/license-banner.txt
@@ -131,34 +180,51 @@ do
131180

132181
rm -rf ${DESTDIR}
133182

134-
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-build.json ====="
135-
$TSC -p ${SRCDIR}/tsconfig-build.json
136-
# ES2015 distro is not ready yet; don't slow down all builds for it
137-
# TODO(alexeagle,igorminar): figure out ES2015 story and enable
138-
if [[ -n "${EXPERIMENTAL_ES2015_DISTRO}" ]]; then
139-
$TSC -p ${SRCDIR}/tsconfig-build.json --target es2015 --outDir ${ES2015_DESTDIR}
140-
cp ${SRCDIR}/package.json ${ES2015_DESTDIR}/
141-
cp ${PWD}/modules/@angular/README.md ${ES2015_DESTDIR}/
183+
echo "====== [${PACKAGE}]: COMPILING: ${TSC} --skipImportRename -p ${SRCDIR}/tsconfig-build.json"
184+
if [[ -e ${SRCDIR}/.babelrc || ${PACKAGE} == "compiler" ]]; then
185+
$TSC --skipImportRename -p ${SRCDIR}/tsconfig-build.json -outDir ${DEST_MODULE}
186+
else
187+
$TSC --skipImportRename -p ${SRCDIR}/tsconfig-build.json
142188
fi
143189

144-
if [[ -e ${SRCDIR}/tsconfig-upgrade.json ]]; then
145-
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-upgrade.json ====="
146-
$TSC -p ${SRCDIR}/tsconfig-upgrade.json
190+
echo "====== Move ${PACKAGE} typings"
191+
if [[ -e ${SRCDIR}/.babelrc || -d ${DEST_MODULE} ]]; then
192+
rsync -a --exclude=*.js --exclude=*.js.map ${DEST_MODULE}/ ${DESTDIR}/typings
193+
mv ${DESTDIR}/typings/index.d.ts ${DESTDIR}/typings/${PACKAGE}.d.ts
194+
mv ${DESTDIR}/typings/index.metadata.json ${DESTDIR}/typings/${PACKAGE}.metadata.json
195+
else
196+
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/ ${DESTDIR}/typings
197+
find ${DESTDIR} -name "*.d.ts" -not -path "${DESTDIR}/typings/*" -exec rm -f {} \;
198+
fi
199+
200+
if [[ -e ${SRCDIR}/tsconfig-es5.json ]]; then
201+
echo "====== [${PACKAGE}]: COMPILING (ES5): ${TSC} -p ${SRCDIR}/tsconfig-es5.json"
202+
$TSC -p ${SRCDIR}/tsconfig-es5.json
147203
fi
148204

149205
cp ${SRCDIR}/package.json ${DESTDIR}/
206+
if [[ -e ${SRCDIR}/.babelrc ]]; then
207+
cp ${SRCDIR}/.babelrc ${DESTDIR}/
208+
fi
150209
cp ${PWD}/modules/@angular/README.md ${DESTDIR}/
151210

211+
if [[ -e ${SRCDIR}/tsconfig-upgrade.json ]]; then
212+
echo "====== [${PACKAGE}]: COMPILING (UPGRADE): ${TSC} -p ${SRCDIR}/tsconfig-upgrade.json"
213+
$TSC -p ${SRCDIR}/tsconfig-upgrade.json
214+
fi
215+
152216
if [[ -e ${SRCDIR}/tsconfig-testing.json ]]; then
153-
echo "====== COMPILING TESTING: ${TSC} -p ${SRCDIR}/tsconfig-testing.json"
217+
echo "====== [${PACKAGE}]: COMPILING (TESTING): ${TSC} -p ${SRCDIR}/tsconfig-testing.json"
154218
$TSC -p ${SRCDIR}/tsconfig-testing.json
155-
if [[ -n "${EXPERIMENTAL_ES2015_DISTRO}" ]]; then
156-
$TSC -p ${SRCDIR}/tsconfig-testing.json --target es2015 --outDir ${ES2015_DESTDIR}
157-
fi
219+
fi
220+
221+
if [[ -e ${SRCDIR}/tsconfig-static.json ]]; then
222+
echo "====== [${PACKAGE}]: COMPILING (STATIC): ${TSC} -p ${SRCDIR}/tsconfig-static.json"
223+
$TSC -p ${SRCDIR}/tsconfig-static.json
158224
fi
159225

160226
if [[ -e ${SRCDIR}/tsconfig-2015.json ]]; then
161-
echo "====== COMPILING ESM: ${TSC} -p ${SRCDIR}/tsconfig-2015.json"
227+
echo "====== [${PACKAGE}]: COMPILING (ES2015): ${TSC} -p ${SRCDIR}/tsconfig-2015.json"
162228
${TSC} -p ${SRCDIR}/tsconfig-2015.json
163229
fi
164230

@@ -170,69 +236,150 @@ do
170236
if [[ ${BUNDLE} == true && ${PACKAGE} != compiler-cli && ${PACKAGE} != benchpress ]]; then
171237

172238
echo "====== BUNDLING: ${SRCDIR} ====="
173-
mkdir ${DESTDIR}/bundles
239+
mkdir ${DEST_BUNDLES}
174240

175241
(
176242
cd ${SRCDIR}
177243
echo "====== Rollup ${PACKAGE} index"
178-
../../../node_modules/.bin/rollup -c rollup.config.js
179-
cat ${LICENSE_BANNER} > ${UMD_ES5_PATH}.tmp
180-
cat ${UMD_ES5_PATH} >> ${UMD_ES5_PATH}.tmp
181-
mv ${UMD_ES5_PATH}.tmp ${UMD_ES5_PATH}
182-
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_PATH}
244+
../../../node_modules/.bin/rollup -i ${DEST_MODULE}/index.js -o ${JS_PATH}
245+
cat ${LICENSE_BANNER} > ${JS_PATH}.tmp
246+
cat ${JS_PATH} >> ${JS_PATH}.tmp
247+
mv ${JS_PATH}.tmp ${JS_PATH}
248+
249+
if ! [[ ${PACKAGE} == 'benchpress' ]]; then
250+
cleanTypings ${DEST_MODULE} ${DEST_MODULE}/src
251+
fi
252+
253+
if [[ -e ${DESTDIR}/.babelrc ]]; then
254+
255+
echo "====== Downleveling ${PACKAGE} to ES5/UMD"
256+
$BABELJS ${JS_PATH} -o ${UMD_ES5_PATH}
183257

184-
if [[ -e rollup-testing.config.js ]]; then
258+
### Minification ###
259+
echo "====== Minifying JavaScript"
260+
$BABILI ${JS_PATH} -o ${UMD_ES5_MIN_PATH}
261+
echo "====== Downleveling min JavaScript to ES5/UMD"
262+
$BABELJS ${UMD_ES5_MIN_PATH} -o ${UMD_ES5_MIN_PATH}
263+
264+
echo "====== Minifying ${PACKAGE}"
265+
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_MIN_PATH}
266+
### END Minification ###
267+
else
268+
# For packages not running through babel, use the es5/umd config
269+
echo "====== Rollup ${PACKAGE} index to UMD"
270+
../../../node_modules/.bin/rollup -c rollup-umd.config.js
271+
[[ -d ${DESTDIR}/es5 ]] && rm -rf ${DESTDIR}/es5
272+
echo "====== Minifying UMD ${PACKAGE}"
273+
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_PATH}
274+
fi
275+
276+
rm -f ${DISTDIR}/.babelrc
277+
cp ${ROOTDIR}/.babelrc ${DEST_MODULE}/.babelrc
278+
$BABELJS ${JS_PATH} -o ${JS_PATH_ES5}
279+
280+
if [[ -d testing ]]; then
185281
echo "====== Rollup ${PACKAGE} testing"
186-
../../../node_modules/.bin/rollup -c rollup-testing.config.js
187-
echo "{\"main\": \"../bundles/${PACKAGE}-testing.umd.js\"}" > ${DESTDIR}/testing/package.json
282+
../../../node_modules/.bin/rollup -i ${DESTDIR}/testing/index.js -o ${DESTDIR}/testing.tmp.js
283+
284+
echo "====== Downleveling ${PACKAGE} TESTING to ES5/UMD"
285+
[[ -e ${SRCDIR}/.babelrc-testing ]] && cp ${SRCDIR}/.babelrc-testing ${DESTDIR}/.babelrc
286+
$BABELJS ${DESTDIR}/testing.tmp.js -o ${UMD_TESTING_ES5_PATH}
287+
rm -f ${DESTDIR}/.babelrc
288+
289+
echo "====== Move ${PACKAGE} testing typings"
290+
rsync -a --exclude=*.js --exclude=*.js.map ${DESTDIR}/testing/ ${DESTDIR}/typings/testing
291+
mv ${DESTDIR}/typings/testing/index.d.ts ${DESTDIR}/typings/testing/testing.d.ts
292+
mv ${DESTDIR}/typings/testing/index.metadata.json ${DESTDIR}/typings/testing/testing.metadata.json
293+
294+
rm -rf ${DESTDIR}/testing
295+
296+
mkdir ${DESTDIR}/testing && [[ -d ${DEST_MODULE}/${PACKAGE} ]] || mkdir ${DEST_MODULE}/${PACKAGE}
297+
298+
getPackageContents "${PACKAGE}" "testing" > ${DESTDIR}/testing/package.json
299+
300+
mv ${DESTDIR}/testing.tmp.js ${JS_TESTING_PATH}
301+
$BABELJS ${JS_TESTING_PATH} -o ${JS_TESTING_PATH_ES5}
188302
cat ${LICENSE_BANNER} > ${UMD_TESTING_ES5_PATH}.tmp
189303
cat ${UMD_TESTING_ES5_PATH} >> ${UMD_TESTING_ES5_PATH}.tmp
190304
mv ${UMD_TESTING_ES5_PATH}.tmp ${UMD_TESTING_ES5_PATH}
191305
fi
192306

193-
if [[ -e rollup-static.config.js ]]; then
307+
if [[ -e static.ts ]]; then
194308
echo "====== Rollup ${PACKAGE} static"
195-
../../../node_modules/.bin/rollup -c rollup-static.config.js
196-
# create dir because it doesn't exist yet, we should move the src code here and remove this line
197-
mkdir ${DESTDIR}/static
198-
echo "{\"main\": \"../bundles/${PACKAGE}-static.umd.js\"}" > ${DESTDIR}/static/package.json
309+
rm -f ${DEST_MODULE}/static.*
310+
../../../node_modules/.bin/rollup -i ${DESTDIR}/static/static.js -o ${DESTDIR}/static.tmp.js
311+
312+
echo "====== Downleveling ${PACKAGE} STATIC to ES5/UMD"
313+
[[ -e ${SRCDIR}/.babelrc-static ]] && cp ${SRCDIR}/.babelrc-static ${DESTDIR}/.babelrc
314+
$BABELJS ${DESTDIR}/static.tmp.js -o ${UMD_STATIC_ES5_PATH}
315+
rm -f ${DESTDIR}/.babelrc
316+
317+
echo "====== Move ${PACKAGE} static typings"
318+
rsync -a --exclude=*.js ${DESTDIR}/static/ ${DESTDIR}/typings/static
319+
rm -f ${DESTDIR}/typings/static/index.d.ts
320+
rm -rf ${DESTDIR}/static
321+
322+
mkdir ${DESTDIR}/static && [[ -d ${DEST_MODULE}/${PACKAGE} ]] || mkdir ${DEST_MODULE}/${PACKAGE}
323+
324+
getPackageContents "${PACKAGE}" "static"> ${DESTDIR}/static/package.json
325+
326+
mv ${DESTDIR}/static.tmp.js ${JS_STATIC_PATH}
327+
$BABELJS ${JS_STATIC_PATH} -o ${JS_STATIC_PATH_ES5}
199328
cat ${LICENSE_BANNER} > ${UMD_STATIC_ES5_PATH}.tmp
200329
cat ${UMD_STATIC_ES5_PATH} >> ${UMD_STATIC_ES5_PATH}.tmp
201330
mv ${UMD_STATIC_ES5_PATH}.tmp ${UMD_STATIC_ES5_PATH}
202331
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_STATIC_ES5_MIN_PATH} ${UMD_STATIC_ES5_PATH}
203332
fi
204333

205-
if [[ -e rollup-upgrade.config.js ]]; then
334+
if [[ -e upgrade.ts ]]; then
206335
echo "====== Rollup ${PACKAGE} upgrade"
207-
../../../node_modules/.bin/rollup -c rollup-upgrade.config.js
208-
# create dir because it doesn't exist yet, we should move the src code here and remove this line
209-
mkdir ${DESTDIR}/upgrade
210-
echo "{\"main\": \"../bundles/${PACKAGE}-upgrade.umd.js\"}" > ${DESTDIR}/upgrade/package.json
336+
rm -f ${DEST_MODULE}/upgrade.*
337+
../../../node_modules/.bin/rollup -i ${DESTDIR}/upgrade/upgrade.js -o ${DESTDIR}/upgrade.tmp.js
338+
339+
echo "====== Downleveling ${PACKAGE} UPGRADE to ES5/UMD"
340+
[[ -e ${SRCDIR}/.babelrc-upgrade ]] && cp ${SRCDIR}/.babelrc-upgrade ${DESTDIR}/.babelrc
341+
$BABELJS ${DESTDIR}/upgrade.tmp.js -o ${UMD_UPGRADE_ES5_PATH}
342+
rm -f ${DESTDIR}/.babelrc
343+
344+
echo "====== Move ${PACKAGE} upgrade typings"
345+
rsync -a --exclude=*.js ${DESTDIR}/upgrade/ ${DESTDIR}/typings/upgrade
346+
rm -f ${DESTDIR}/typings/upgrade/index.d.ts
347+
rm -rf ${DESTDIR}/upgrade
348+
349+
mkdir ${DESTDIR}/upgrade && [[ -d ${DEST_MODULE}/${PACKAGE} ]] || mkdir ${DEST_MODULE}/${PACKAGE}
350+
351+
getPackageContents "${PACKAGE}" "upgrade" > ${DESTDIR}/upgrade/package.json
352+
353+
mv ${DESTDIR}/upgrade.tmp.js ${JS_UPGRADE_PATH}
354+
$BABELJS ${JS_UPGRADE_PATH} -o ${JS_UPGRADE_PATH_ES5}
211355
cat ${LICENSE_BANNER} > ${UMD_UPGRADE_ES5_PATH}.tmp
212356
cat ${UMD_UPGRADE_ES5_PATH} >> ${UMD_UPGRADE_ES5_PATH}.tmp
213357
mv ${UMD_UPGRADE_ES5_PATH}.tmp ${UMD_UPGRADE_ES5_PATH}
214358
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_UPGRADE_ES5_MIN_PATH} ${UMD_UPGRADE_ES5_PATH}
215359
fi
216360
) 2>&1 | grep -v "as external dependency"
217361

218-
if [[ -n "${EXPERIMENTAL_ES2015_DISTRO}" ]]; then
219-
cp -prv ${DESTDIR}/bundles ${ES2015_DESTDIR}
220-
fi
221362
fi
222363

223364
(
224365
echo "====== VERSION: Updating version references"
225-
cd ${DESTDIR}
366+
if [[ -e ${SRCDIR}/.babelrc ]]; then
367+
cd ${DEST_MODULE}
368+
else
369+
cd ${DESTDIR}
370+
fi
226371
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-PLACEHOLDER/${VERSION}/g\" $""(grep -ril 0\.0\.0\-PLACEHOLDER .)"
227372
perl -p -i -e "s/0\.0\.0\-PLACEHOLDER/${VERSION}/g" $(grep -ril 0\.0\.0\-PLACEHOLDER .) < /dev/null 2> /dev/null
228373
echo "====== EXECUTE: perl -p -i -e \"s/0\.0\.0\-ROUTERPLACEHOLDER/${ROUTER_VERSION}/g\" $""(grep -ril 0\.0\.0\-ROUTERPLACEHOLDER .)"
229374
perl -p -i -e "s/0\.0\.0\-ROUTERPLACEHOLDER/${ROUTER_VERSION}/g" $(grep -ril 0\.0\.0\-ROUTERPLACEHOLDER .) < /dev/null 2> /dev/null
230375
)
231376
done
232377

233-
echo ""
234-
echo "====== Building examples: ./modules/@angular/examples/build.sh ====="
235-
./modules/@angular/examples/build.sh
378+
if [[ ${BUILD_EXAMPLES} == true ]]; then
379+
echo ""
380+
echo "====== Building examples: ./modules/@angular/examples/build.sh ====="
381+
./modules/@angular/examples/build.sh
382+
fi
236383

237384
if [[ ${REMOVE_BENCHPRESS} == true ]]; then
238385
echo ""

integration/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ vendor/
77
**/*.ngfactory.ts
88
**/*.ngsummary.json
99
*/yarn*
10+
*/.yarn_local_cache*

integration/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Angular's `node_modules` is installed.
3535
The first time you run the tests, you'll need some setup:
3636

3737
```shell
38-
$ EXPERIMENTAL_ES2015_DISTRO=1 ./build.sh
3938
$ ./integration/build_rxjs_es6.sh
4039
```
4140

@@ -44,7 +43,7 @@ See the `package.json` of the test(s) you're debugging, to see which dist/ folde
4443
Then run the right `tsc --watch` command to keep those dist folders up-to-date, for example:
4544

4645
```
47-
$ ./node_modules/.bin/tsc -p modules/@angular/core/tsconfig-build.json --target es2015 --outDir dist/packages-dist-es2015/core --watch
46+
$ ./node_modules/.bin/tsc -p modules/@angular/core/tsconfig-build.json --outDir dist/packages-dist/core --watch
4847
```
4948

5049
Now you can run the integration test, it will re-install from the dist/ folder on each run.

0 commit comments

Comments
 (0)