@nx/angular:web-worker

Creates a new, generic web worker definition in the given or default project.

Examples

The basic usage of the web-worker generator is defined below. You must provide a name for the web worker and the project to assign it to.

1nx g @nx/angular:web-worker myWebWorker --project=myapp 2
Nx 15 and lower use @nrwl/ instead of @nx/

Usage

1nx generate web-worker ... 2

By default, Nx will search for web-worker in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

1nx g @nx/angular:web-worker ... 2
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

1nx g web-worker ... --dry-run 2

Options

name

Required
string

The name of the worker.

project

Required
string

The name of the project.

path

string
Format: path

The path at which to create the worker file, relative to the current workspace.

snippet

boolean
Default: true

Add a worker creation snippet in a sibling file of the same name.

skipFormat

boolean
Default: false

Skip formatting files.