This repo is a test for building & bunding an Angular Universal application using the Google Closure Compiler. It contains a minimal Hello World application with a single component that uses @angular/forms.
The browser code is built by ngc and optimized and bundled the Google Closure Compiler. The server code is built using Bazel.
Closure compiler bundling is based off of https://github.com/angular/closure-demo
Angular Universal configuration and build is based off of https://github.com/bleenco/angular-universal-seed
Bazel build configuration is based off of https://github.com/alexeagle/angular-bazel-example
The compressed JS size for an Angular 4.3.0 Hello World app is 44kb.
This includes @angular/forms (which is why it is larger than the @angular/closure-demo).
45014 16 Aug 02:43 dist/browser.js.brotli
50723 16 Aug 02:43 dist/browser.js.gz
Install brotli, which is a more modern compression algorithm than gzip. It gives a 13% smaller JS file. On Mac, brew install brotli
.
Requires Node >= 6.x since the ngc
tool (and its deps) are now shipped as ES6 as well.
Requires Java installed to run the Closure Compiler. Zulu distribution is great: http://zulu.org/download-dev/.
$ yarn install
$ yarn run build
$ yarn run serve
$ yarn run explore