fix: resolve presets in config.js

Closes #1080
This commit is contained in:
Rhys Arkins 2018-04-04 14:08:10 +02:00
parent 394bc931bd
commit 0d92defb7d

View file

@ -9,6 +9,8 @@ const fileParser = require('./file');
const cliParser = require('./cli');
const envParser = require('./env');
const { resolveConfigPresets } = require('./presets');
exports.parseConfigs = parseConfigs;
exports.mergeChildConfig = mergeChildConfig;
exports.filterConfig = filterConfig;
@ -22,12 +24,12 @@ async function parseConfigs(env, argv) {
const cliConfig = cliParser.getConfig(argv);
const envConfig = envParser.getConfig(env);
const config = {
...defaultConfig,
...fileConfig,
...envConfig,
...cliConfig,
};
let config = mergeChildConfig(
await resolveConfigPresets(defaultConfig),
await resolveConfigPresets(fileConfig)
);
config = mergeChildConfig(config, await resolveConfigPresets(envConfig));
config = mergeChildConfig(config, await resolveConfigPresets(cliConfig));
// Set log level
logger.levels('stdout', config.logLevel);