Skip to content

Commit

Permalink
fix(experience): update dev features flag env handling
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyijun committed Aug 19, 2024
1 parent 13bfa06 commit a017a13
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/experience/src/constants/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { yes } from '@silverhand/essentials';

const normalizeEnv = (value: unknown) =>
value === null || value === undefined ? undefined : String(value);

const isProduction = import.meta.env.PROD;

export const isDevFeaturesEnabled =
process.env.NODE_ENV !== 'production' || yes(process.env.DEV_FEATURES_ENABLED);
!isProduction || yes(normalizeEnv(import.meta.env.DEV_FEATURES_ENABLED));

0 comments on commit a017a13

Please sign in to comment.