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 cliParser = require('./cli');
const envParser = require('./env'); const envParser = require('./env');
const { resolveConfigPresets } = require('./presets');
exports.parseConfigs = parseConfigs; exports.parseConfigs = parseConfigs;
exports.mergeChildConfig = mergeChildConfig; exports.mergeChildConfig = mergeChildConfig;
exports.filterConfig = filterConfig; exports.filterConfig = filterConfig;
@ -22,12 +24,12 @@ async function parseConfigs(env, argv) {
const cliConfig = cliParser.getConfig(argv); const cliConfig = cliParser.getConfig(argv);
const envConfig = envParser.getConfig(env); const envConfig = envParser.getConfig(env);
const config = { let config = mergeChildConfig(
...defaultConfig, await resolveConfigPresets(defaultConfig),
...fileConfig, await resolveConfigPresets(fileConfig)
...envConfig, );
...cliConfig, config = mergeChildConfig(config, await resolveConfigPresets(envConfig));
}; config = mergeChildConfig(config, await resolveConfigPresets(cliConfig));
// Set log level // Set log level
logger.levels('stdout', config.logLevel); logger.levels('stdout', config.logLevel);