# all files / config/ config.js

100% Statements 17/17
100% Branches 4/4
100% Functions 2/2
100% Lines 8/8
1 branch Ignored

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    1
    4
    4
    4
    4

    1

    4

     'use strict';

    // Constants:
    import defaultConfig from './default.conf.js';

    // Utilities:
    import _ from 'lodash';
    import { join } from 'path';

    export default createConfig();

    export function createConfig () {
        let configPath = join(process.cwd(), 'tractor.conf.js');
        let config;
        try {
            config = require(configPath);
        } catch (e) {
            config = {};
        }
        return _.defaults(config, defaultConfig);
    }