HI! Perhaps someone will tell you how you can make dynamic imports in the module that depend on the value in "ConfigService"?
I found the following https://github.com/nestjs/nest/issues/10151 and https://github.com/nestjs/docs.nestjs.com/issues/223 , but I still don't understand.
Example:
@Module({ controllers: [ControllerA] })
class AModule {}
@Module({ controllers: [ControllerB] })
class BModule {}
@Module({})
class BaseModule {
static forRootAsync(...) {
// Get the value from `configService`
const module = configService.get('module')
if (module === 'a') return { imports: [AModule] };
return { imports: [BModule] };
}
}
// Usage
class AppModule {
imports: [BaseModule.forRootAsync(…)]
}
GitHub
Is there an existing issue that is already proposing this? I have searched the existing issues Is your feature request related to a problem? Please describe it Reopening #9046 because it wasn&#...