title: Examples layout: default stylesheet: docs

Frameworks

Angular

Bazel can run any toolchain you want, so there is more than one way to use it with Angular. See Alex's post Angular ❤️ Bazel update for a longer explanation.

Architect: The first approach is the simplest: use Architect (aka. Angular CLI Builders). This is the build tool inside of Angular CLI, so your existing application will continue to work the same way. However, it has the worst performance because the level of incrementality is only as fine as how many libs your application is composed from.

Example: examples/angular_bazel_architect

Google: This toolchain is what we originally advertised as “Angular, Bazel and CLI” (ABC). It is based on Google‘s internal toolchain for building Angular, and has good performance characteristics. However it is harder to migrate to, because it doesn’t have good compatibility for existing applications.

The example has its own guide: examples/angular

View Engine: If you‘re stuck on the older Angular compiler/runtime before Ivy, called View Engine, then your options are more limited. We don’t support Angular 9 + View Engine + Bazel.

Example: examples/angular_view_engine

React

There is a basic example at examples/react_webpack

We are likely to add more, as the rules_nodejs core maintainers are working on some React projects.

Vue

We don't have a dedicated example yet, but Vue has been known to work. Follow https://github.com/bazelbuild/rules_nodejs/issues/1840 for an example.

Svelte

None yet, please file an issue if you need this.

Test Runners

Jest

There is a dedicated example for Jest: examples/jest

Cypress

We have done some early work to run Cypress under Bazel. Follow https://github.com/bazelbuild/rules_nodejs/issues/1904 for an example.

Mocha

Example at examples/webapp has a simple mocha_test

Karma and Protractor

See Protractor usage in examples/app

Bundlers

Webpack

See examples/react_webpack

Rollup

The example at examples/webapp uses Rollup, and produces an app with ES5 and ES2015 variants (“differential loading”) that gives faster loading in modern browsers without dropping support for legacy ones.

Parcel

The example in examples/parcel shows how to write a custom rule, it happens to use the parcel binary to build. It's a very minimal example but might be enough to get you started.

Language tooling

LESS, Sass, Stylus

See styles directory inside the examples/app example.

TypeScript

Most of the examples show TypeScript usage. Also look in packages/typescript/test for lots of handling of edge cases.

Kotlin

The Kotlin language can compile to JS. The result has a very large stdlib JS payload, so we don't recommend this for most uses.

Example at examples/kotlin

Google Closure Compiler

rules_closure is a whole-cloth approach to using Bazel if you're fully bought-into the Closure ecosystem.

examples/closure shows a very simple way to call the closure compiler without jumping into that ecosystem.

Protocol Buffers and gRPC

Note: this is considered a “labs” feature in rules_nodejs, so support and stability are not great. gRPC is still a WIP.

See examples/protocol_buffers

Bazel-specific

Bazel Persistent Workers

If you want to speed up Bazel by keeping some tools running warm in the background as daemons, there's a good readme in the examples/worker