@nx/angular:webpack-server

The webpack-server executor is very similar to the standard server builder provided by the Angular Devkit. It is usually used in tandem with @nx/angular:webpack-browser when your Angular application uses a custom webpack configuration and NgUniversal for SSR.

Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.

Options

main

Required
string

The full path for the main entry point to the server app, relative to the current workspace.

outputPath

Required
string

The full path for the new output directory, relative to the current workspace.

By default, writes output to a folder named dist/ in the current project.

tsConfig

Required
string
Default: tsconfig.app.json

The full path for the TypeScript configuration file, relative to the current workspace.

buildLibsFromSource

boolean
Default: true

Read buildable libraries from source instead of building them separately.

customWebpackConfig

Options for additional webpack configurations.

assets

Array<oneOf [object , string]>
Default: []

List of static application assets. Note: only supported in Angular versions >= 15.1.0

buildOptimizer

boolean
Default: true

Enables advanced build optimizations. Note: only supported in Angular versions >= 16.0.0.

deleteOutputPath

boolean
Default: true

Delete the output path before building.

extractLicenses

boolean
Default: true

Extract all licenses in a separate file, in the case of production builds only.

externalDependencies

Array<string>
Default: []

Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.

fileReplacements

Array<oneOf [object , object ]>
Default: []

Replace compilation source files with other compilation source files in the build.

inlineStyleLanguage

string
Default: css
Accepted values: css, less, sass, scss

The stylesheet language to use for the application's inline component styles.

i18nMissingTranslation

string
Default: warning
Accepted values: warning, error, ignore

How to handle missing translations for i18n.

i18nDuplicateTranslation

string
Default: warning
Accepted values: warning, error, ignore

How to handle duplicate translations for i18n.

localize

oneOf [boolean, Array<string>]

Translate the bundles in one or more locales.

namedChunks

boolean
Default: false

Use file name for lazy loaded chunks.

optimization

oneOf [object , boolean]
Default: true

Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.

outputHashing

string
Default: none
Accepted values: none, all, media, bundles

Define the output filename cache-busting hashing mode.

progress

boolean
Default: true

Log progress to the console while building.

boolean

Do not use the real path when resolving modules. If unset then will default to true if NodeJS option --preserve-symlinks is set.

poll

number

Enable and define the file watching poll time period in milliseconds.

resourcesOutputPath

string

The path where style resources will be placed, relative to outputPath.

stylePreprocessorOptions

Options to pass to style preprocessors

sourceMap

oneOf [object , boolean]
Default: false

Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.

statsJson

boolean
Default: false

Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.

vendorChunk

boolean
Default: false

Generate a separate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time. Note: supported in Angular versions >= 15.1.0

verbose

boolean
Default: false

Adds more details to output logging.

watch

boolean
Default: false

Run build when files change.

deployUrl

Deprecated
string

URL where files will be deployed.

Use "baseHref" browser builder option, "APP_BASE_HREF" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url.