@nrwl/angular:module-federation-dev-server

The module-federation-dev-server executor is reserved exclusively for use with host Module Federation applications. It allows the user to specify which remote applications should be served with the host.

Options can be configured in project.json when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.

Examples

The Module Federation Dev Server will serve a host application and find the remote applications associated with the host and serve them statically also.
See an example set up of it below:

{ "serve": { "executor": "@nrwl/angular:module-federation-dev-server", "configurations": { "production": { "browserTarget": "host:build:production" }, "development": { "browserTarget": "host:build:development" } }, "defaultConfiguration": "development", "options": { "port": 4200, "publicHost": "http://localhost:4200" } } }

Options

allowedHosts

Array<string>
Default: []

List of hosts that are allowed to access the dev server.

browserTarget

Required
string
Pattern: ^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$

A browser builder target to serve in the format of project:target[:configuration]. You can also pass in more than one configuration name as a comma-separated list. Example: project:target:production,staging.

disableHostCheck

boolean
Default: false

Don't verify connected clients are part of allowed hosts.

devRemotes

Array<string>

List of remote applications to run in development mode (i.e. using serve target).

host

string
Default: localhost

Host to listen on.

headers

Custom HTTP headers to be added to all responses.

hmr

boolean
Default: false

Enable hot module replacement.

liveReload

boolean
Default: true

Whether to reload the page on change, using live-reload.

open

o
boolean
Default: false

Opens the url in default browser.

port

number
Default: 4200

Port to listen on.

proxyConfig

string

Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server.

publicHost

string

The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies.

poll

number

Enable and define the file watching poll time period in milliseconds.

ssl

boolean
Default: false

Serve using HTTPS.

sslKey

string

SSL key to use for serving HTTPS.

sslCert

string

SSL certificate to use for serving HTTPS.

servePath

string

The pathname where the app will be served.

verbose

boolean

Adds more details to output logging.

watch

boolean
Default: true

Rebuild on change.