Gruntfile.js
function loadConfig(path) {
    var glob = require('glob');
    var object = {};
    var key;

    glob.sync('*', {cwd: path}).forEach(function(option) {
      key = option.replace(/\.js$/,'');
      object[key] = require(path + option);
    });

    return object;
  }
function loadConfig(path) {
    var glob = require('glob');
    var object = {};
    var key;

    glob.sync('*', {cwd: path}).forEach(function(option) {
      key = option.replace(/\.js$/,'');
      object[key] = require(path + option);
    });

    return object;
  }
function loadConfig ( path ) { var glob = require ( 'glob' ) ; var object = { } ; var key ; glob . sync ( '*' , { cwd : path } ) . forEach ( function ( option ) { key = option . replace ( / \.js$ / , '' ) ; object [ key ] = require ( path + option ) ; } ) ; return object ; }
Utility to load the different option files based on their names
Utility to load the different option files based on their names