Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

Use this file to discover all available pages before exploring further.

This comprehensive training course will guide you through building modern JavaScript and TypeScript applications with Bazel. The JavaScript ecosystem moves quickly. New tools pop up monthly, and many of them evolve to be build systems, either intentionally or accidentally. The Aspect team has been developing Bazel support for JavaScript since 2017. As the industry experts we’re excited to show you how well this tooling can work for your team. rules_nodejs commit history Before you begin, ensure you have completed the Bazel 101 course to understand the core Bazel concepts. Now, let’s get started.

Tooling

This guide uses a combination of Bazel modules and performance-optimized tools.

Bazel modules

The following modules form the foundation of the JavaScript toolchain within Bazel:
  • Runtime environment — The rules_nodejs module supplies a fully isolated node.js toolchain, both for running build tools and for server application runtimes.
  • Package management — The aspect_rules_js module adds pnpm package manager support, and includes basic rules for building, testing, and running JavaScript code.
  • TypeScript support — The aspect_rules_ts module adds type-checking and transpilation to JavaScript.

Performance optimized build tools

Bazel works with virtually any JavaScript tooling. However, you will experience the best performance with tools that have minimal startup time. This guide uses Rust-based and Go-based tools for optimal performance:
  • ESBuild: A fast JavaScript bundler written in Go.
  • SWC: A fast Rust-based tool for compiling JavaScript/TypeScript.
  • Vite A modern development server that provides a fast development experience.
    Additional performance improvements via typescript-goare planned for future releases.

Development experience

Finally, to make our terminal experience great. Install the Aspect CLI, it makes Bazel much easier to use by providing a familiar task runner interface, similar to package.json scripts. Next, you’ll build a basic Node.js application with Bazel.
zipline

Delivered by Zipline

Sponsorship for development of this training course was provided by Zipline. Thank you!