kibana/Gruntfile.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-11-12 20:57:20 +01:00
/* jshint node:true */
'use strict';
module.exports = function (grunt) {
var config = {
pkg: grunt.file.readJSON('package.json'),
2013-11-15 05:26:20 +01:00
baseDir: './kibana',
srcDir: 'kibana/src',
2013-11-12 20:57:20 +01:00
destDir: 'dist',
2013-11-15 05:26:20 +01:00
tempDir: 'tmp'
2013-11-12 20:57:20 +01:00
};
// load plugins
2013-11-15 05:26:20 +01:00
require('load-grunt-tasks')(grunt);
// load task definitions
grunt.loadTasks('tasks');
// Utility function to load plugin settings into config
function loadConfig(config,path) {
require('glob').sync('*', {cwd: path}).forEach(function(option) {
var key = option.replace(/\.js$/,'');
// If key already exists, extend it. It is your responsibility to avoid naming collisions
config[key] = config[key] || {};
grunt.util._.extend(config[key], require(path + option)(config));
});
// technically not required
return config;
}
// Merge that object with what with whatever we have here
loadConfig(config,'./tasks/options/');
if (grunt.file.exists('kibana')) {
grunt.loadTasks('kibana/tasks');
loadConfig(config,'./kibana/tasks/options/');
}
2013-11-12 20:57:20 +01:00
// pass the config to grunt
grunt.initConfig(config);
};