tree: 95b7178f9bb25b7afd59987a8eecf5335764d7c8 [path history] [tgz]
  1. .bazelignore
  2. .bazelrc
  3. app.spec.js
  4. BUILD.bazel
  5. differential_loading.bzl
  6. dummy_test.sh
  7. es5.babelrc
  8. favicon.png
  9. index.html
  10. index.ts
  11. package.json
  12. protractor.on-prepare.js
  13. README.md
  14. sourcemaps.spec.js
  15. strings.en.ts
  16. tsconfig.json
  17. WORKSPACE
  18. yarn.lock
examples/webapp/README.md

Webapp example

This example shows how to compose some rules from this repo.

The first rule is rollup_bundle which takes index.js and strings.en.js and produces a single JS file for our application which combines the two, given an entry_point.

The output bundle is then passed to the assets of a pkg_web rule, along with some CSS and an image. The pkg_web rule produces a directory ready to ship to our CDN to serve the application in production. It also injects a <link> tag for our CSS and a <script> tag for our JavaScript.

The http_server rule lets us run a server locally which serves the packaged application.

$ bazel run :server
Starting up http-server, serving package
Available on:
  http://127.0.0.1:8080
  http://192.168.86.240:8080
Hit CTRL-C to stop the server