API Reference
createConfig
import { createConfig } from '@ng-rsbuild/plugin-angular';
The createConfig
function is used to create a Rsbuild
configuration object setup for Angular applications.
It takes an optional RsbuildConfig
object as an argument, which
allows for customization of the Rsbuild configuration.
function createConfig(
options: Partial<PluginAngularOptions>,
additionalConfig?: Partial<RsbuildConfig>
)
Examples
Server-Side Rendering (SSR)
Client-Side Rendering (CSR)
Modify Rsbuild Configuration
File Replacements
The following example shows how to create a configuration for a SSR application:
rsbuild.config.ts
import { createConfig } from '@ng-rsbuild/plugin-angular';
export default createConfig({
browser: './src/main.ts',
server: './src/main.server.ts',
ssrEntry: './src/server.ts',
});
PluginAngularOptions
The PluginAngularOptions
object is an object that contains the
following properties:
export interface PluginAngularOptions {
root: string;
index: string;
browser: string;
server?: string;
ssrEntry?: string;
polyfills: string[];
assets: string[];
styles: string[];
scripts: string[];
jit: boolean;
inlineStylesExtension: 'css' | 'scss' | 'sass';
tsconfigPath: string;
hasServer: boolean;
useParallelCompilation: boolean;
useHoistedJavascriptProcessing: boolean;
}