2019-01-21 17:17:26 -08:00
|
|
|
// Attempt to include a common.js config file, if it exists.
|
|
|
|
|
let common
|
|
|
|
|
try {
|
|
|
|
|
common = require('./env/common')
|
2019-01-21 17:26:27 -08:00
|
|
|
} catch (err) {
|
|
|
|
|
common = require('./env/min-config')
|
|
|
|
|
}
|
2019-01-20 18:12:23 -08:00
|
|
|
|
2019-01-21 17:17:26 -08:00
|
|
|
// Default to development environment.
|
2019-01-20 18:12:23 -08:00
|
|
|
const env = process.env.NODE_ENV || 'development'
|
2019-01-21 17:17:26 -08:00
|
|
|
|
|
|
|
|
// Load the config object for the selected environment.
|
2019-01-20 18:12:23 -08:00
|
|
|
const config = require(`./env/${env}`)
|
|
|
|
|
|
2019-01-21 17:17:26 -08:00
|
|
|
// Merge into a single object and export.
|
2019-01-20 18:12:23 -08:00
|
|
|
module.exports = Object.assign({}, common, config)
|