nx/docs/react/api-react/schematics/application.md
Jack Hsu 811c50b92c feat(web): use babel-loader instead of ts-loader for web build builder
- removes the `differentialLoading` build option
- differential loading is always enabled for prod builds

BEFORE (without ESM):

Benchmark #1: nx build demo --prod
  Time (mean ± σ):     13.834 s ±  1.731 s    [User: 11.817 s, System: 1.352 s]
  Range (min … max):   11.947 s … 16.015 s    10 runs

AFTER (with ESM):

Benchmark #1: nx build demo --prod
  Time (mean ± σ):     18.711 s ±  1.310 s    [User: 12.172 s, System: 1.394 s]
  Range (min … max):   17.232 s … 20.770 s    10 runs
2019-09-05 15:34:01 -04:00

2.0 KiB

application

Create an application

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 @nrwl/react:application ...

Show what will be generated without writing to disk:

nx g application ... --dry-run

Examples

Generate apps/myorg/myapp and apps/myorg/myapp-e2e:

nx g app myapp --directory=myorg

Use class components instead of functional components:

nx g app myapp --classComponent

Set up routing:

nx g app myapp --routing

Options

classComponent

Alias(es): C

Default: false

Type: boolean

Use class components instead of functional component

directory

Alias(es): d

Type: string

The directory of the new application.

e2eTestRunner

Default: cypress

Type: string

Possible values: cypress, none

Test runner to use for end to end (e2e) tests

linter

Default: tslint

Type: string

Possible values: eslint, tslint

The tool to use for running lint checks.

name

Type: string

The name of the application.

pascalCaseFiles

Alias(es): P

Default: false

Type: boolean

Use pascal case component file name (e.g. App.tsx)

routing

Type: boolean

Generate application with routes

skipFormat

Default: false

Type: boolean

Skip formatting files

skipWorkspaceJson

Default: false

Type: boolean

Skip updating workspace.json with default schematic options based on values provided to this app (e.g. babel, style)

style

Alias(es): s

Default: css

Type: string

Possible values: css, scss, styl, less, styled-components, @emotion/styled

The file extension to be used for style files.

tags

Alias(es): t

Type: string

Add tags to the application (used for linting)

unitTestRunner

Default: jest

Type: string

Possible values: jest, none

Test runner to use for unit tests