1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

Move web to apps/web and bitwarden_license/bit-web

This commit is contained in:
Hinton
2022-06-02 11:55:37 +02:00
parent fb35805202
commit 02fe715903
619 changed files with 2 additions and 7 deletions

36
apps/web/config.js Normal file
View File

@@ -0,0 +1,36 @@
function load(envName) {
return {
...require("./config/base.json"),
...loadConfig(envName),
...loadConfig("local"),
dev: {
...require("./config/base.json").dev,
...loadConfig(envName).dev,
...loadConfig("local").dev,
},
};
}
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(`./config/${configName}.json`);
} catch (e) {
if (e instanceof Error && e.code === "MODULE_NOT_FOUND") {
return {};
} else {
throw e;
}
}
}
module.exports = {
load,
log,
};