@nx/react:federate-module

Create a federated module, which can be loaded by a remote host.

Usage

1nx generate federate-module ... 2

By default, Nx will search for federate-module in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

1nx g @nx/react:federate-module ... 2
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

1nx g federate-module ... --dry-run 2

Examples

Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule.:

1nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app 2

Options

name

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

The name of the module.

path

Required
string

The path to locate the federated module.

remote

Required
string

The name of the remote.

e2eTestRunner

string
Default: cypress
Accepted values: cypress, none

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

host

string

The host / shell application for this remote.

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).

style

s
string
Default: css

The file extension to be used for style files.

unitTestRunner

string
Default: jest
Accepted values: jest, none

Test runner to use for unit tests.

skipFormat

boolean
Default: false

Skip formatting files.