Need help with rules_nodejs?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

bazelbuild
500 Stars 391 Forks Apache License 2.0 2.7K Commits 161 Opened issues

Description

JavaScript and NodeJS rules for Bazel

Services available

!
?

Need anything else?

Contributors list

# 651
TypeScr...
bazel
bazel-r...
python-...
1058 commits
# 1,266
JavaScr...
bazel
bazel-r...
TypeScr...
614 commits
# 84
netlify
TypeScr...
GraphQL
angular...
109 commits
# 261,780
bazel-r...
bazel
HTML
Shell
57 commits
# 70,633
C++
OCaml
efficie...
efficie...
49 commits
# 2,783
JavaScr...
TypeScr...
Shell
intelli...
37 commits
# 806
TypeScr...
Gulp
Clojure...
cljs
31 commits
# 3,091
JavaScr...
HTML
jQuery
Redux
28 commits
# 1,194
TypeScr...
JavaScr...
Angular
web-per...
24 commits
# 470
TypeScr...
Shell
HTML
angular...
24 commits
# 10,620
TypeScr...
bazel-r...
HTML
Google
24 commits
# 27,235
Shell
JavaScr...
Google
C
22 commits
# 23,068
bazel-r...
C++
OCaml
closure...
22 commits
# 2,930
JavaScr...
TypeScr...
Shell
Angular
16 commits
# 485
TypeScr...
Angular
angular...
Express
14 commits
# 379,845
bazel
bazel-r...
Go
HTML
13 commits
# 21,593
TypeScr...
Angular
Algolia
angular...
13 commits
# 322,509
bazel-r...
C++
C
Shell
12 commits
# 85,183
TypeScr...
C
grpc-ga...
swagger
12 commits
# 46,522
bazel-r...
gRPC
GraphQL
ESLint
11 commits

JavaScript rules for Bazel

Circle CI

Bazel CI
CircleCI Build status

The nodejs rules integrate NodeJS development toolchain and runtime with Bazel.

This toolchain can be used to build applications that target a browser runtime, so this repo can be thought of as "JavaScript rules for Bazel" as well. (We would call this

rules_javascript
if renames weren't so disruptive.)

This repository is maintained by volunteers in the Bazel community. Neither Google, nor the Bazel team, provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases.

We follow semantic versioning. Patch releases have bugfixes, minor releases have new features. Only major releases (1.x, 2.x) have breaking changes. We support the last two major releases of Bazel, see

SUPPORTED_BAZEL_VERSIONS
in our
/index.bzl
for the list we test against.

We strive to give you an easy upgrade path when we do introduce a breaking change by documenting a migration path. If you use code from an

/internal
path, or the labs package, these are not subject to our support policy and may have breaking changes or removals with no warning or migration path.

Documentation

Comprehensive documentation for installing and using the rules, including generated API docs: https://bazelbuild.github.io/rules_nodejs/

Quickstart

This is the fastest way to get started. See the installation documentation for details and alternative methods, or if you already have a Bazel project and you're adding Node/JavaScript support to it.

$ npx @bazel/create my_workspace
$ cd my_workspace

The

npx
tool is distributed with node. If you prefer, you can run equivalent commands
npm init @bazel
or
yarn create @bazel
. If you've used
@bazel/create
before, you may want to use
npx @bazel/[email protected]
to get the most recent version. Run without any arguments to see available command-line flags.

Adopters

Thanks to the following active users!

Open-source repositories:

Organizations:

Not on this list? Send a PR to add your repo or organization!

User testimonials

From Lewis Hemens at Dataform:

At Dataform we manage a number of NPM packages, Webpack builds, Node services and Java pipelines across two separate repositories. This quickly became hard for us to manage, development was painful and and deploying code required a many manual steps. We decided to dive in and migrate our build system entirely to Bazel. This was a gradual transition that one engineer did over the course of about 2 months, during which we had both Bazel and non bazel build processes in place. Once we had fully migrated, we saw many benefits to all parts of our development workflow: - Faster CI: we enabled the remote build caching which has reduced our average build time from 30 minutes to 5 (for the entire repository) - Improvements to local development: no more random bash scripts that you forget to run, incremental builds reduced to seconds from minutes - Simplified deployment processes: we can deploy our code to environments in Kubernetes with just one command that builds and pushes images - A monorepo that scales: adding new libraries or packages to our repo became easy, which means we do it more and end up write more modular, shared, maintainable code - Developing across machine types: our engineers have both Macbooks and Linux machines, bazel makes it easy to build code across both - Developer setup time: New engineers can build all our code with just 3 dependencies - bazel, docker and the JVM. The last engineer to join our team managed to build all our code in < 30 minutes on a brand new, empty laptop

From Jason Bedard at Allocadia:

At Allocadia we use Bazel as the primary build system in a monorepo consisting of multiple applications, services and deployments across a range of technologies. Bazel has provided many benefits over previous build systems including: - reduced CI pipeline time from 60+ to 5-10 minutes - increased build and testing stability - improved developer ergonomics such as initial setup, faster more consistent local builds

The use of rules_nodejs has provided these benefits across multiple Angular/TypeScript applications, Karma+Jasmine testing, Rollup, npm packaging, protobuf client/server communication, and a variety of Node.js based tooling.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.