code: function mergeConfigRecursively(baseObject, data) {
          var i;
          for (i in data) {
              if (data[i] !== undefined) {
  
                  // exception
                  if (baseObject[i] !== undefined && typeof data[i] !== typeof baseObject[i]) {
                      grunt.log.error('Data types not mutch. Property: ' + i +
                          ' {' + typeof baseObject[i] + '} !== {' +  typeof data[i] + '}');
                  }
  
                  // simple file type
                  if (
                      baseObject[i] === undefined ||
                          typeof data[i] !== 'object' ||
                          data[i] instanceof Array
                  ) {
                      baseObject[i] = data[i];
                  } else {
                      mergeConfigRecursively(baseObject[i], data[i]);
                  }
              }
          }
      }
docs: подключаем настройки конкретного приложения