function parseConfigDir (scriptsPath, dir) {
    return new Promise(function (resolve, reject) {
        gulp.src(configSourceFiles.map(function (i) { return join(scriptsPath, dir, i); }))
            .pipe(jsonminify()) // remove any comments which would break the merging
            .pipe(merge({
                fileName: configMergedSources,  // combined.json
                edit: function (parsedJson, file) {
                    var editedJson = {};
                    editedJson[dir] = parsedJson;
                    return editedJson;
                }
            }))
            .on('error', reject)
            .pipe(gulp.dest(join(scriptsPath, dir)))
            .on('end', resolve);
    });
}
/*
 * Parse a section (folder) in the config dir:
 * the function merges default.json and the optional custom.json into combined.json
 * Under json root there is one element with the same name as the directory.
 * @param {string} scriptsPath
 * @param {string} dir
 * @return {promise}
 */
Parse a section (folder) in the config dir:
the function merges default.json and the optional custom.json into combined.json
Under json root there is one element with the same name as the directory.
@param {string} scriptsPath
@param {string} dir
@return {promise}
Parse a section ( folder ) in the config dir : the function merges default . json and the optional custom . json into combined . json Under json root there is one element with the same name as the directory . @param { string } scriptsPath @param { string } dir @return { promise }
function parseConfigDir (scriptsPath, dir) {
    return new Promise(function (resolve, reject) {
        gulp.src(configSourceFiles.map(function (i) { return join(scriptsPath, dir, i); }))
            .pipe(jsonminify()) 
            .pipe(merge({
                fileName: configMergedSources,  
                edit: function (parsedJson, file) {
                    var editedJson = {};
                    editedJson[dir] = parsedJson;
                    return editedJson;
                }
            }))
            .on('error', reject)
            .pipe(gulp.dest(join(scriptsPath, dir)))
            .on('end', resolve);
    });
}
function parseConfigDir ( scriptsPath , dir ) { return new Promise ( function ( resolve , reject ) { gulp . src ( configSourceFiles . map ( function ( i ) { return join ( scriptsPath , dir , i ) ; } ) ) . pipe ( jsonminify ( ) ) . pipe ( merge ( { fileName : configMergedSources , edit : function ( parsedJson , file ) { var editedJson = { } ; editedJson [ dir ] = parsedJson ; return editedJson ; } } ) ) . on ( 'error' , reject ) . pipe ( gulp . dest ( join ( scriptsPath , dir ) ) ) . on ( 'end' , resolve ) ; } ) ; }
Parse a section (folder) in the config dir:
 the function merges default.json and the optional custom.json into combined.json
 Under json root there is one element with the same name as the directory.
Parse a section ( folder ) in the config dir : the function merges default . json and the optional custom . json into combined . json Under json root there is one element with the same name as the directory .
// remove any comments which would break the merging // combined.json