Skip to content

Rspack Plugin and Tooling for Angular applications

License

Notifications You must be signed in to change notification settings

nrwl/angular-rspack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rsbuild Plugin Angular

Angular Rspack and Rsbuild Tools

GitHub Actions License

NPM Version NPM Version


Build Angular with Rspack and Rsbuild

The goal of @nx/angular-rspack and @nx/angular-rsbuild is to make it easy and straightforward to build Angular applications with Rspack and Rsbuild.

Configuration

Configuration is controlled entirely via the Rspack/Rsbuild config.
Both tools offer a createConfig function to aid in the creation of the configuration.

Documentation

The documentation for this project can be found at angular-rspack.dev.


Feature Parity

The following aims to compare features of Rspack and Rsbuild, and it's Angular wrapper with Angular's standards (Angular CLI and Webpack/esbuild).

Rspack and Rsbuild are modern, high-performance JavaScript build tools designed as alternatives to Webpack and other traditional bundlers.

πŸ“Œ Mapping @nx/angular-rspack & @nx/angular-rsbuild Packages to Angular CLI Components

This table maps the key angular-rspack and angular-rsbuild packages to their equivalent Angular CLI components to show how Rspack and Rsbuild replace or mirror Angular CLI's system.

Package Comparison

angular-rspack / angular-rsbuild Package New Equivalent in Angular CLI / DevKit Old Equivalent in Angular CLI / DevKit Description
@nx/angular-rspack @angular/build @angular-devkit/build-angular Core build system for ng-rspack, replacing Angular CLI's Webpack-based builder.
@nx/angular-rspack-compiler @angular/build @angular/build Compiler for Angular applications using Rspack, leveraging abstractions from @angular/build.
@nx/angular-rsbuild @angular/build (Builder API) @angular-devkit/build-angular Rsbuild plugin for Angular projects, similar to Angular CLI's Webpack-based builder API.

Feature Comparisons

Legend:

  • βœ… Fully Supported
  • ⚠️ Partial Support
  • ❌ Not Supported
  • πŸ”˜ Not Applicable
  • 🌟 Best-in-Class
Feature State angular-rspack / angular-rsbuild Package State New Equivalent (@angular/build) State Old Equivalent (@angular-devkit) Notes
Builder / Build Performance βœ…πŸŒŸ [1] Rspack / Rsbuild βœ… Angular Esbuild ⚠️ Webpack Rspack & Rsbuild (Rust-based) are optimized for performance. New Angular uses Esbuild, replacing Webpack for faster builds.
Plugins & Loaders βœ… - βœ… - βœ… -
- CSS Loader βœ… CSS Loader βœ… CSS Loader βœ… CSS Loader
- SCSS/SASS Loader βœ… SCSS Loader βœ… SCSS Loader βœ… SCSS Loader
- LESS Loader βœ… LESS Loader βœ… LESS Loader βœ… LESS Loader
- Style Loader 🚧 Style Loader βœ… Style Loader βœ… Style Loader
Configuration File (Bundler) βœ… Rspack Config (rspack.config.js) βœ… Angular JSON (angular.json) βœ… Webpack Config (webpack.config.js) Angular combines bundler and builder configs in one file (angular.json)
Configuration File (Builder) βœ… Rsbuild Config (rsbuild.config.ts) βœ… Angular JSON (angular.json) βœ… Webpack Config (webpack.config.js)
Compiler βœ… @nx/angular-rspack-compiler βœ… @angular/build βœ… @angular/compiler
Automatic Downleveling via browserslist ❌ - βœ… - βœ… - Can be supported via Rspack Target
Build Flags (NG_BUILD_MANGLE=0, etc.) ❌ - βœ… - βœ… - No method to override SWC options
HMR (Hot Module Replacement) ⚠️ @nx/angular-rspack @nx/angular-rsbuild βœ… @angular/build βœ… @angular-devkit/build-angular
TypeScript Handling βœ… Rspack SWC βœ… Angular Esbuild βœ… Webpack TypeScript Rspack uses SWC, Angular uses Esbuild
Tree Shaking βœ… - βœ… - βœ… -
Asset Management βœ… - βœ… - βœ… -
Development Server βœ… - βœ… - βœ… -
Schematics ⚠️ - βœ… - βœ… -
- Generate Application ⚠️ - βœ… ng generate app βœ… ng generate app
- Serve Application βœ… - βœ… ng serve βœ… ng serve
- Build Application βœ… - βœ… ng build βœ… ng build
Migration from Webpack βœ… - ⚠️ - ⚠️ - Rspack serves as a drop-in replacement for Webpack; Angular is transitioning to Esbuild