tree: daaa8854e77a02d434fc8a0a88897c452aa1bc8a
  1. .bazelrc
  2. BUILD.bazel
  3. favicon.png
  4. index.html
  5. index.js
  6. package.json
  7. README.md
  8. strings.en.js
  9. styles.css
  10. WORKSPACE
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 web_package rule, along with some CSS and an image. The web_package 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