mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
6e4782784c
* adding in initial config files * working config files * updating the client config pattern to default to dev instead of prod * updating the npm script commands and docs * Adding a helpful debugging log for the webpack build * adding in more supporting documentation for running against production * updating README.md and removing the unneeded ENV var
30 lines
760 B
JavaScript
30 lines
760 B
JavaScript
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
|
|
};
|