boolean | PluginDtsOptions
true
Module 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 | DtsRemoteOptions
true
Module Federation
generation type behaviorThe DtsRemoteOptions
types are as follows:
When configuring generateTypes
to true
, the following configuration will be generated by default:
boolean
undefined
exposes
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 exposes
Whether to extract the type of remotes
.
boolean
undefined
exposes
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.
boolean
undefined
Whether to generate the loadRemote
type in Federation Runtime
boolean
undefined
Whether generate types in child process
boolean
false
Whether to throw an error when a problem is encountered during type generation
string
path.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
boolean
true
Whether to delete the generated type folder
'tsc' | 'vue-tsc'
'tsc'
Example of compiled type
boolean | DtsHostOptions
true
Module Federation
consumption (loading) type behaviorThe DtsHostOptions
types are as follows:
When configuring consumeTypes
to true
, the following configuration will be generated by default:
boolean
true
Whether to generate the type of runtime loadRemote
API
number
3
Maximum number of retries for failed loading
boolean
false
Whether to throw an error when a problem is encountered during type loading
string
'@mf-types'
Type storage directory after successful loading
boolean
true
Before loading type files, whether to delete the previously loaded typesFolder
directory
string
'@mf-types'
typesFolder
corresponding to remotes
directory configuration
string
path.join(process.cwd(),'./tsconfig.json')
tsconfig configuration file path