boolean | PluginDtsOptionstrueModule Federation generation/consumption type behaviorAfter configuration, the producer will automatically generate a compressed type file @mf-types.zip (default name) during build, and the consumer will automatically pull the type file of remotes and decompress it to @mf-types (default name).
The PluginDtsOptions types are as follows:
boolean | DtsRemoteOptionstrueModule Federation generation type behaviorThe DtsRemoteOptions types are as follows:
When configuring generateTypes to true, the following configuration will be generated by default:
booleanundefinedexposes has its own remotes module that re-exports itself, then extractRemoteTypes: true can ensure that the consumer can normally obtain the module type of the producer exposesWhether to extract the type of remotes.
booleanundefinedexposes contains a module containing antd, and the consumer does not have antd installed, then extractThirdParty: true can ensure that the consumer can normally obtain the module of the producer exposes typeWhether to extract third-party package types.
booleanundefinedWhether to generate the loadRemote type in Federation Runtime
booleanundefinedWhether generate types in child process
booleanfalseWhether to throw an error when a problem is encountered during type generation
stringpath.join(process.cwd(),'./tsconfig.json')priority: dts.generateTypes.tsConfigPath > dts.tsConfigPath tsconfig configuration file path
string'@mf-types'The name of the generated compression type file. For example, if typesFolder is set to custom, then the name of the generated compression type file is: custom.zip
booleantrueWhether to delete the generated type folder
'tsc' | 'vue-tsc''tsc'Example of compiled type
boolean | DtsHostOptionstrueModule Federation consumption (loading) type behaviorThe DtsHostOptions types are as follows:
When configuring consumeTypes to true, the following configuration will be generated by default:
booleantrueWhether to generate the type of runtime loadRemote API
number3Maximum number of retries for failed loading
booleanfalseWhether to throw an error when a problem is encountered during type loading
string'@mf-types'Type storage directory after successful loading
booleantrueBefore loading type files, whether to delete the previously loaded typesFolder directory
string'@mf-types'typesFolder corresponding to remotes directory configuration
stringpath.join(process.cwd(),'./tsconfig.json')tsconfig configuration file path
stringundefinedThe working directory to run the compiler
booleantrueWhether print error log in terminal