@module-federation/dts-kit
- This kit provides utilities to support the implementation of Module Federation Types in your projects.
Usage
import { generateTypes, generateTypesInChildProcess, consumeTypes, } from '@module-federation/dts-kit';
generateTypes({ remote: RemoteOptions })
generateTypesInChildProcess({ remote: RemoteOptions })
consumeTypes({ host: HostOptions })
Configuration
interface DTSManagerOptions {
remote?: RemoteOptions;
host?: HostOptions;
extraOptions?: Record<string, any>;
}
RemoteOptions
interface RemoteOptions {
tsConfigPath?: string;
typesFolder?: string;
compiledTypesFolder?: string;
deleteTypesFolder?: boolean;
additionalFilesToCompile?: string[];
compileInChildProcess?: boolean;
compilerInstance?: 'tsc' | 'vue-tsc';
generateAPITypes?: boolean;
abortOnError?: boolean;
moduleFederationConfig: moduleFederationPlugin.ModuleFederationPluginOptions;
context?: string;
implementation?: string;
hostRemoteTypesFolder?: string;
}
HostOptions
interface HostOptions{
typesFolder?: string;
abortOnError?: boolean;
remoteTypesFolder?: string;
deleteTypesFolder?: boolean;
maxRetries?: number;
moduleFederationConfig: moduleFederationPlugin.ModuleFederationPluginOptions;
context?: string;
implementation?: string;
}