Command Line Tool
Module Federation provides lightweight command-line tools: @module-federation/enhanced and @module-federation/modern-js .
View All Commands
If you need to view all available CLI commands, please run the following command in the project directory:
Output:
Common Options
Module Federation CLI provides some common options that can be used for all commands:
mf dts
The mf dts command is used to pull or generate TypeScript type declaration files.
The mf dts command will automatically generate or pull type declaration files based on the configuration in module-federation.config.ts. This means you must provide a valid configuration file, otherwise the command will not run correctly.
If you are only using the runtime API, you need to create a temporary module-federation.config.ts file, configure dts.consumeTypes.remoteTypeUrls, and then run the mf dts command.