Skip to content

Commit

Permalink
chore(api): init prod dependencies only in next and prod environments
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmasberg committed Feb 1, 2024
1 parent 48061a5 commit 3a6be90
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ import { GraphqlSubscriptionsController } from './controllers/graphql-subscripti
import { HealthCheckController } from './controllers/health-check.controller';
import environment from './environment';

// todo: narrow this down, we should have either an explicit way of defining when to use what (currently hard, since ConfigService not available in forRoot), or we should have an environment variable that defines the environment
const isProdEnv =
process.env.NODE_ENV === 'production' && !process.env.GITHUB_ACTIONS;
const isNextOrProdEnv = ['next', 'prod'].includes(
process.env.ENVIRONMENT_NAME ?? '',
);

const FEATURE_MODULES = [OrganizationModule];
const UTILITY_MODULES = [
SharedKernel,
AuthModule.forRoot(isProdEnv ? 'aadb2c' : 'dev'),
ObservabilityModule.forRoot(isProdEnv ? 'sentry' : 'dev'),
AuthModule.forRoot(isNextOrProdEnv ? 'aadb2c' : 'dev'),
ObservabilityModule.forRoot(isNextOrProdEnv ? 'sentry' : 'dev'),
];

@Module({
Expand Down

0 comments on commit 3a6be90

Please sign in to comment.