1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Feature/put serve behind feature flag (#455)

* Add build-time feature flag capabilities

* Toggle `bw serve` command with `serve` flag

* Run linter and prettier
This commit is contained in:
Matt Gibson
2022-01-28 09:29:04 -05:00
committed by GitHub
parent 1b409653a2
commit 210e0502ca
9 changed files with 117 additions and 18 deletions

30
config/config.js Normal file
View File

@@ -0,0 +1,30 @@
function load(envName) {
return {
...loadConfig(envName),
...loadConfig("local"),
};
}
function log(configObj) {
const repeatNum = 50;
console.log(`${"=".repeat(repeatNum)}\nenvConfig`);
console.log(JSON.stringify(configObj, null, 2));
console.log(`${"=".repeat(repeatNum)}`);
}
function loadConfig(configName) {
try {
return require(`./${configName}.json`);
} catch (e) {
if (e instanceof Error && e.code === "MODULE_NOT_FOUND") {
return {};
} else {
throw e;
}
}
}
module.exports = {
load,
log,
};