mirror of
https://github.com/bitwarden/web
synced 2025-12-21 18:53:38 +00:00
Add string replacement feature flagging
This commit is contained in:
17
config.js
17
config.js
@@ -30,7 +30,24 @@ function loadConfig(configName) {
|
||||
}
|
||||
}
|
||||
|
||||
function generateSubstitutions(configObj) {
|
||||
let result = {};
|
||||
|
||||
Object.keys(configObj.compileFlags ?? {}).forEach(key => {
|
||||
result = { ...result, ...generateSubstitutionsForFlag(key) };
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function generateSubstitutionsForFlag(flagName) {
|
||||
return {
|
||||
"featureFlag: (.*)[\\s\\S]*?\\/\\/ endFeatureFlag": ""
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
load,
|
||||
log,
|
||||
generateSubstitutions,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user