plugin.module.ts 575 B

12345678910111213141516171819202122
  1. import { DynamicModule, Module } from '@nestjs/common';
  2. import { getConfig } from '../config/config-helpers';
  3. import { ConfigModule } from '../config/config.module';
  4. import { getModuleMetadata } from './plugin-metadata';
  5. /**
  6. * This module collects and re-exports all providers defined in plugins so that they can be used in other
  7. * modules.
  8. */
  9. @Module({
  10. imports: [ConfigModule],
  11. })
  12. export class PluginModule {
  13. static forRoot(): DynamicModule {
  14. return {
  15. module: PluginModule,
  16. imports: [...getConfig().plugins],
  17. };
  18. }
  19. }