21.1.0 • Published 8 months ago
@nx/angular-rsbuild v21.1.0
@nx/angular-rsbuild
Rsbuild Support for Angular
Plugin providing Rsbuild support for Angular applications, both SSR and CSR.
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 @nx/angular-rsbuild - Create an
rsbuild.config.tsfile at the root of your project with the following:
import { createConfig } from '@nx/angular-rsbuild';
export default createConfig({
browser: './src/main.ts',
server: './src/main.server.ts',
ssrEntry: './src/server.ts',
});- Update your
./src/server.tsfile to use thecreateServerutil:
import { createServer } from '@nx/angular-rsbuild/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 @nx/angular-rsbuild - Create an
rsbuild.config.tsfile at the root of your project with the following:
import { createConfig } from '@nx/angular-rsbuild';
export default createConfig({
browser: './src/main.ts',
});- Run the builds:
npx rsbuild build - Run the dev server:
npx rsbuild dev
21.1.0
8 months ago
21.0.4
9 months ago
21.0.3
9 months ago
21.0.2
9 months ago
21.0.1
9 months ago
21.0.0
9 months ago
21.0.0-beta.0
9 months ago
20.9.0
9 months ago
20.8.2
9 months ago
20.8.1
9 months ago
20.8.0
9 months ago
20.8.0-beta.0
9 months ago
20.7.0
10 months ago
20.7.0-beta.0
10 months ago
20.6.2
11 months ago
20.6.2-beta.0
11 months ago
20.6.1
11 months ago
20.6.0
11 months ago
20.6.0-beta.1
11 months ago
20.6.0-beta.0
11 months ago
20.5.0-beta.3
11 months ago
19.0.0-alpha.30
11 months ago