Socket
Book a DemoInstallSign in
Socket

@ng-rsbuild/plugin-angular

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ng-rsbuild/plugin-angular

Rsbuild Plugin for building Angular.

21.0.4
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source
This package has been moved to @nx/angular-rsbuild.
Rsbuild Plugin Angular

@ng-rsbuild/plugin-angular

Rsbuild Support for Angular

Plugin providing Rsbuild support for Angular applications, both SSR and CSR.

Thank you to Brandon Roberts and Analog for their work on building Angular applications with Vite which both inspired this plugin and provided a basis for the compilation implementation.

Setup for SSR Application

Prerequisites: Angular SSR Application already created with ng new --ssr.

  • Install Rsbuild: npm install --save-dev @rsbuild/core
  • Install this plugin: npm install --save-dev @ng-rsbuild/plugin-angular
  • Create an rsbuild.config.ts file at the root of your project with the following:
import { createConfig } from '@ng-rsbuild/plugin-angular';

export default createConfig({
  browser: './src/main.ts',
  server: './src/main.server.ts',
  ssrEntry: './src/server.ts',
});
  • Update your ./src/server.ts file to use the createServer util:
import { createServer } from '@ng-rsbuild/plugin-angular/ssr';
import bootstrap from './main.server';

const server = createServer(bootstrap);

/** Add your custom server logic here
 *
 * For example, you can add a custom static file server:
 *
 * server.app.use('/static', express.static(staticFolder));
 *
 * Or add additional api routes:
 *
 * server.app.get('/api/hello', (req, res) => {
 *   res.send('Hello World!');
 * });
 *
 * Or add additional middleware:
 *
 * server.app.use((req, res, next) => {
 *   res.send('Hello World!');
 * });
 */

server.listen();
  • Run the builds: npx rsbuild build
  • Run the server: node dist/server/server.js
  • Run the dev server: npx rsbuild dev

Setup for CSR Application

Prerequisites: Angular CSR Application already created with ng new.

  • Install Rsbuild: npm install --save-dev @rsbuild/core
  • Install this plugin: npm install --save-dev @ng-rsbuild/plugin-angular
  • Create an rsbuild.config.ts file at the root of your project with the following:
import { createConfig } from '@ng-rsbuild/plugin-angular';

export default createConfig({
  browser: './src/main.ts',
});
  • Run the builds: npx rsbuild build
  • Run the dev server: npx rsbuild dev

Keywords

angular

FAQs

Package last updated on 21 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.