mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
New client configuration pattern (#937)
* 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
This commit is contained in:
29
config.js
Normal file
29
config.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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
|
||||
};
|
||||
Reference in New Issue
Block a user