Напр, так:
@Module({
imports: [
LoggerModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (config: ConfigService<EnvironmentVariables>) => getLoggerOptions(config),
}),
// ....................
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => getTypeORMConfig(configService),
}),
TypeOrmModule.forFeature([MyRepository, MyDetailsRepository]),
],