-
Notifications
You must be signed in to change notification settings - Fork 17
Features
A. Malthe Henriksen edited this page Jan 21, 2024
·
6 revisions
Features are settings located in features.json. These settings are used by build variants to check for feature toggles and certain variables such as the document.title text in the application.
To add a feature, create a new entry into features.json (including all build variants). This means we add a new entry into all variants of features.json in folders ./src/__viteBuildVariants__/[variant].
Then to be able to reference the feature in the Feature enum in file FeatureToggles.ts. The name should string variant should reflect the name in features.json.
We can use features specified in features.json by using the utility file FeatureToggles.ts
document.title = getFeature(Feature.TITLE);
// Or
console.log(hasFeature(Feature.KNN_MODEL);