mirror of https://github.com/bitwarden/web.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
760 B
29 lines
760 B
function load(envName) { |
|
const envOverrides = { |
|
'production': () => require('./config/production.json'), |
|
'qa': () => require('./config/qa.json'), |
|
'development': () => require('./config/development.json'), |
|
}; |
|
|
|
const baseConfig = require('./config/base.json'); |
|
const overrideConfig = envOverrides.hasOwnProperty(envName) ? envOverrides[envName]() : {}; |
|
|
|
return { |
|
...baseConfig, |
|
...overrideConfig |
|
}; |
|
} |
|
|
|
function log(configObj) { |
|
const repeatNum = 50 |
|
console.log(`${"=".repeat(repeatNum)}\nenvConfig`) |
|
Object.entries(configObj).map(([key, value]) => { |
|
console.log(` ${key}: ${value}`) |
|
}) |
|
console.log(`${"=".repeat(repeatNum)}`) |
|
} |
|
|
|
module.exports = { |
|
load, |
|
log |
|
};
|
|
|