Skip to content

Commit 2ef6382

Browse files
devversionjelbourn
authored andcommitted
build: stop building rxjs for closure compiler test (#6635)
For every Pull Request, a job that runs the Google Closure Compiler against the demo-app will be started. In the past Closure Compiler wasn't able to properly handle CommonJS packages from the node modules. Now the Google Closure Compiler will be reconfigured to properly handle CommonJS packages (meaning that RxJS no longer needs to be built manually)
1 parent 6df8144 commit 2ef6382

File tree

3 files changed

+55
-23
lines changed

3 files changed

+55
-23
lines changed

package-lock.json

Lines changed: 50 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"firebase-tools": "^3.9.0",
6868
"fs-extra": "^3.0.1",
6969
"glob": "^7.1.2",
70-
"google-closure-compiler": "^20170218.0.0",
70+
"google-closure-compiler": "20170409.0.0",
7171
"gulp": "^3.9.1",
7272
"gulp-clean": "^0.3.2",
7373
"gulp-clean-css": "^3.3.1",

scripts/closure-compiler/build-devapp-bundle.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set -e -o pipefail
88
# Go to the project root directory
99
cd $(dirname $0)/../..
1010

11-
1211
# Build a release of material and of the CDK package.
1312
$(npm bin)/gulp material:build-release:clean
1413
$(npm bin)/gulp cdk:build-release
@@ -17,21 +16,12 @@ $(npm bin)/gulp cdk:build-release
1716
$(npm bin)/gulp :build:devapp:assets :build:devapp:scss
1817
$(npm bin)/tsc -p src/demo-app/tsconfig-build.json --target ES2015 --module ES2015
1918

20-
# Re-compile RxJS sources into ES2015. Otherwise closure compiler can't parse it properly.
21-
$(npm bin)/ngc -p scripts/closure-compiler/tsconfig-rxjs.json
22-
2319
# Create a list of all RxJS source files.
24-
rxjsSourceFiles=$(find dist/packages/rxjs -name '*.js');
20+
rxjsSourceFiles=$(find node_modules/rxjs/ -name '*.js');
2521

2622
# List of entry points in the CDK package. Exclude "testing" since it's not an entry point.
2723
cdkEntryPoints=($(find src/cdk -maxdepth 1 -mindepth 1 -type d -not -name testing -exec basename {} \;))
2824

29-
# Due a Closure Compiler issue https://github.com/google/closure-compiler/issues/2247
30-
# we need to add exports to the different RxJS ES2015 files.
31-
for i in $rxjsSourceFiles; do
32-
echo "export var __CLOSURE_WORKAROUND__" >> $i
33-
done
34-
3525
OPTS=(
3626
"--language_in=ES6_STRICT"
3727
"--language_out=ES5"
@@ -41,6 +31,8 @@ OPTS=(
4131
"--property_renaming_report=dist/closure/property_renaming_report"
4232
"--warning_level=QUIET"
4333
"--rewrite_polyfills=false"
34+
"--module_resolution=node"
35+
"--process_common_js_modules"
4436

4537
# List of path prefixes to be removed from ES6 & CommonJS modules.
4638
"--js_module_root=dist/packages"
@@ -103,4 +95,4 @@ echo ${OPTS[*]} > $closureFlags
10395
# Run the Google Closure compiler java runnable.
10496
java -jar node_modules/google-closure-compiler/compiler.jar --flagfile $closureFlags
10597

106-
echo "Finished bundling the dev-app using google closure compiler.."
98+
echo "Finished bundling the dev-app using Google Closure Compiler."

0 commit comments

Comments
 (0)