21.0.4 • Published 7 months ago

@ng-rsbuild/plugin-angular v21.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@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.

  1. Install Rsbuild: npm install --save-dev @rsbuild/core
  2. Install this plugin: npm install --save-dev @ng-rsbuild/plugin-angular
  3. 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',
});
  1. 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();
  1. Run the builds: npx rsbuild build
  2. Run the server: node dist/server/server.js
  3. Run the dev server: npx rsbuild dev

Setup for CSR Application

Prerequisites: Angular CSR Application already created with ng new.

  1. Install Rsbuild: npm install --save-dev @rsbuild/core
  2. Install this plugin: npm install --save-dev @ng-rsbuild/plugin-angular
  3. 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',
});
  1. Run the builds: npx rsbuild build
  2. Run the dev server: npx rsbuild dev
21.0.4

7 months ago

21.0.3

7 months ago

21.0.2

7 months ago

21.0.1

7 months ago

21.0.0

7 months ago

21.0.0-beta.0

7 months ago

20.9.0

7 months ago

20.8.2

8 months ago

20.8.1

8 months ago

20.8.0

8 months ago

20.8.0-beta.0

8 months ago

20.7.0

8 months ago

20.7.0-beta.0

8 months ago

20.6.2

9 months ago

20.6.2-beta.0

9 months ago

20.6.1

9 months ago

20.6.0

9 months ago

20.6.0-beta.1

9 months ago

20.6.0-beta.0

9 months ago

20.5.0-beta.3

9 months ago

19.0.0-alpha.30

9 months ago

19.0.0-alpha.29

10 months ago

19.0.0-alpha.28

10 months ago

19.0.0-alpha.27

10 months ago

19.0.0-alpha.26

11 months ago

19.0.0-alpha.25

11 months ago

19.0.0-alpha.24

11 months ago

19.0.0-alpha.23

11 months ago

19.0.0-alpha.22

11 months ago

19.0.0-alpha.20

11 months ago

19.0.0-alpha.18

11 months ago

19.0.0-alpha.17

11 months ago

19.0.0-alpha.16

11 months ago

19.0.0-alpha.15

11 months ago

19.0.0-alpha.14

12 months ago

19.0.0-alpha.13

12 months ago

19.0.0-alpha.12

12 months ago

19.0.0-alpha.11

12 months ago

19.0.0-alpha.10

12 months ago

19.0.0-alpha.9

12 months ago

19.0.0-alpha.8

12 months ago

19.0.0-alpha.7

12 months ago

19.0.0-alpha.6

12 months ago

19.0.0-alpha.5

12 months ago

19.0.0-alpha.4

12 months ago

19.0.0-alpha.3

12 months ago

19.0.0-alpha.2

12 months ago

19.0.0-alpha.0

12 months ago