Skip to main content

Bazel Rules

"Rules" are how Bazel is extended to learn how to use new tools to build and test more languages and frameworks. Thus rules are a critical part of Aspect's Bazel platform.

This documentation is mirrored from open-source rule sets, making them easier to use:

  • a single search bar that finds results from all the rules we mirror - thanks Algolia!
  • versioned so you can find docs for the release you're using
  • better rendering than Stardoc, including deep-links to attributes
  • copy-paste usage examples including the load statement

Use the sidebar on the left to navigate all the rules we've mirrored so far. Come visit this site again as we'll continue to add more.

Aspect's Rules

The Bazel rules listed below are built and maintained by Aspect engineers. They are free to use and released under the Apache 2.0 License.

If you use our free software, please consider supporting the development and maintenance of our open source Bazel rules through open collective. We also accept Bug Bounties and Feature Bounties to unblock your usage of our rules when you find something broken or missing.

Aspect's Bazel OSS Support is the missing commercial support option for Bazel and its ecosystem of rules, including Aspect’s rules. We will do our best to keep your team unblocked by answering questions, pointing to relevant documentation and issues, and recommending best practice patterns we've seen succeed. To learn more, contact us.


rules_jsGitHub release (latest by date)Bazel rules for building JavaScript programs
rules_tsGitHub release (latest by date)Bazel rules for TypeScript
rules_swcGitHub release (latest by date)Bazel rules for swc
rules_esbuildGitHub release (latest by date)Bazel rules for esbuild JS bundler
rules_terserGitHub release (latest by date)Bazel rules for Terser - a JavaScript minifier
rules_webpackGitHub release (latest by date)Bazel rules for Webpack
rules_rollupGitHub release (latest by date)Bazel rules for Rollup - a JavaScript bundler
rules_jestGitHub release (latest by date)Bazel rules to run tests using Jest
rules_jasmineGitHub release (latest by date)Bazel rules to run tests using Jasmine
rules_cypressGitHub release (latest by date)Bazel rules to run tests using Cypress
rules_denoGitHub release (latest by date)Bazel rules for Deno, an alternative server JS runtime to Node.js


rules_pyGitHub release (latest by date)Bazel rules for running Python tools and building Python projects

C / C++

gcc-toolchainGitHub release (latest by date)A fully-hermetic Bazel GCC toolchain for Linux


rules_ociGitHub release (latest by date)Bazel rules for building OCI containers


rules_solGitHub release (latest by date)Bazel rules for the Solidity blockchain contracts compiler, solc (


bazel-libGitHub release (latest by date)Common useful rules & functions for writing custom build rules with Starlark
bazel-super-formatterGitHub release (latest by date)Hermetic aggregation formatter to format code in most languages

Community Rules

Any rules mirrored on this site which don't appear in the "Aspect Rules" section above are owned and maintained by others in the Bazel community. Aspect engineers have good relationships with these maintainers and we can help to resolve issues or contribute fixes to those as well.

Support for community rules is included in Aspect Build Enterprise in the Bazel Ecosystem plan.