@nx/angular:federate-module

Create a federated module, which is exposed by a Producer (remote) and can be subsequently loaded by a Consumer (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/angular:federate-module ... 2

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=myRemoteApp --remoteDirectory=apps/myRemoteApp 2

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

1nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer 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

producerRequired
string

The name of the Producer (remote).

e2eTestRunner

string
Default: cypress
Accepted values: cypress, none

Test runner to use for end to end (e2e) tests of the Producer (remote) if it needs to be created.

host

consumer
string

The Consumer (host) application for this Producer (remote).

remoteDirectory

producerDirectory
string

The directory of the new Producer (remote) application if one needs to be created.

style

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

The file extension to be used for style files for the Producer (remote) if one needs to be created.

standalone

boolean
Default: true

Whether to generate the Producer (remote) application with standalone components if it needs to be created.

unitTestRunner

string
Default: jest
Accepted values: jest, vitest, none

Test runner to use for unit tests of the Producer (remote) if it needs to be created.

skipFormat

Internal
boolean
Default: false

Skip formatting files.