@nx/angular:application

Creates an Angular application.

Examples

Create an application named my-app:

nx g @nx/angular:application my-app
Nx 15 and lower use @nrwl/ instead of @nx/

Usage

nx generate application ...
nx g app ... #same

By default, Nx will search for application in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

nx g @nx/angular:application ...
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

nx g application ... --dry-run

Options

name

Required
string
Pattern: ^[a-zA-Z].*$

The name of the application.

directory

string

The directory of the new application.

routing

boolean
Default: false

Generate a routing module.

standalone

boolean

Generate an application that is setup to use standalone components. Note: This is only supported in Angular versions >= 14.1.0

addTailwind

boolean
Default: false

Whether to configure Tailwind CSS for the application.

backendProject

string

Backend project that provides data to this application. This sets up proxy.config.json.

bundler

string
Default: webpack
Accepted values: webpack, esbuild

Bundler to use to build the application.

e2eTestRunner

string
Default: cypress
Accepted values: cypress, playwright, none

Test runner to use for end to end (E2E) tests.

inlineStyle

s
boolean
Default: false

Specifies if the style will be in the ts file.

inlineTemplate

t
boolean
Default: false

Specifies if the template will be in the ts file.

linter

string
Default: eslint
Accepted values: eslint, none

The tool to use for running lint checks.

minimal

boolean
Default: false

Generate a Angular app with a minimal setup.

prefix

p
string
Format: html-selector

The prefix to apply to generated selectors.

port

number

The port at which the remote application should be served.

style

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

The file extension to be used for style files.

skipTests

S
boolean
Default: false

Skip creating spec files.

strict

boolean
Default: true

Create an application with stricter type checking and build optimization options.

setParserOptionsProject

boolean
Default: false

Whether or not to configure the ESLint parserOptions.project option. We do not do this by default for lint performance reasons.

tags

string

Add tags to the application (used for linting).

unitTestRunner

string
Default: jest
Accepted values: jest, none

Test runner to use for unit tests.

viewEncapsulation

string
Accepted values: Emulated, None, ShadowDom

Specifies the view encapsulation strategy.

rootProject

Hidden
boolean
Default: false

Create an application at the root of the workspace.

skipFormat

boolean
Default: false

Skip formatting files.

skipPackageJson

boolean
Default: false

Do not add dependencies to package.json.

standaloneConfig

Deprecated
boolean
Default: true

Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json.

Nx only supports standaloneConfig