@nx/plugin:plugin

Create a Plugin for Nx.

Usage

1nx generate plugin ... 2

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

You can specify the collection explicitly as follows:

1nx g @nx/plugin:plugin ... 2

Show what will be generated without writing to disk:

1nx g plugin ... --dry-run 2

Examples

Generates an Nx plugin project called plugins-my-plugin at libs/plugins/my-plugin. The project will have an npm package name and import path of @myorg/my-plugin.:

1nx g plugin my-plugin --directory=plugins --importPath=@myorg/my-plugin 2

Options

name

Required
string
Pattern: (?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$

Plugin name

importPath

string

How the plugin will be published, like @myorg/my-awesome-plugin. Note this must be a valid NPM name.

compiler

string
Default: tsc
Accepted values: tsc, swc

The compiler used by the build and test targets.

directory

string

A directory where the plugin is placed.

e2eTestRunner

string
Default: none
Accepted values: jest, none

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

linter

string
Default: eslint
Accepted values: eslint

The tool to use for running lint checks.

projectNameAndRootFormat

string
Accepted values: as-provided, derived

Whether to generate the project name and root directory as provided (as-provided) or generate them composing their values and taking the configured layout into account (derived).

publishable

boolean
Default: false

Generates a boilerplate for publishing the plugin to npm.

skipLintChecks

boolean
Default: false

Do not eslint configuration for plugin json files.

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

t
string

Add tags to the library (used for linting).

unitTestRunner

string
Default: jest
Accepted values: jest, none

Test runner to use for unit tests.

skipFormat

Internal
boolean
Default: false

Skip formatting files.

skipTsConfig

Internal
boolean
Default: false

Do not update tsconfig.json for development experience.

standaloneConfig

Deprecated
boolean
Default: true

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

Nx only supports standaloneConfig