2017-02-09 22:48:55 +01:00
|
|
|
require('./src/optimize/babel/register');
|
2015-08-01 01:33:01 +02:00
|
|
|
|
2014-02-11 00:09:04 +01:00
|
|
|
module.exports = function (grunt) {
|
2014-06-18 19:35:37 +02:00
|
|
|
// set the config once before calling load-grunt-config
|
2015-07-23 01:21:49 +02:00
|
|
|
// and once during so that we have access to it via
|
2014-06-18 19:35:37 +02:00
|
|
|
// grunt.config.get() within the config files
|
2016-03-10 20:42:45 +01:00
|
|
|
const config = {
|
2014-06-18 19:35:37 +02:00
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
root: __dirname,
|
2015-06-26 00:44:06 +02:00
|
|
|
src: __dirname + '/src',
|
2016-05-27 22:40:57 +02:00
|
|
|
buildDir: __dirname + '/build', // temporary build directory
|
2016-06-28 16:54:53 +02:00
|
|
|
plugins: __dirname + '/src/core_plugins',
|
2015-06-26 00:59:55 +02:00
|
|
|
server: __dirname + '/src/server',
|
2015-06-26 00:44:06 +02:00
|
|
|
target: __dirname + '/target', // location of the compressed build targets
|
|
|
|
configFile: __dirname + '/src/config/kibana.yml',
|
2014-06-18 19:35:37 +02:00
|
|
|
|
2015-07-28 17:23:56 +02:00
|
|
|
karmaBrowser: (function () {
|
2015-08-19 00:33:29 +02:00
|
|
|
if (grunt.option('browser')) {
|
|
|
|
return grunt.option('browser');
|
|
|
|
}
|
|
|
|
|
2015-07-28 17:23:56 +02:00
|
|
|
switch (require('os').platform()) {
|
|
|
|
case 'win32':
|
|
|
|
return 'IE';
|
|
|
|
default:
|
2016-07-01 21:22:20 +02:00
|
|
|
return 'Chrome';
|
2015-07-28 17:23:56 +02:00
|
|
|
}
|
|
|
|
}()),
|
|
|
|
|
2015-09-01 06:24:40 +02:00
|
|
|
nodeVersion: grunt.file.read('.node-version').trim(),
|
2014-10-23 08:30:49 +02:00
|
|
|
|
2014-06-18 19:35:37 +02:00
|
|
|
meta: {
|
|
|
|
banner: '/*! <%= package.name %> - v<%= package.version %> - ' +
|
|
|
|
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
|
|
|
|
'<%= package.homepage ? " * " + package.homepage + "\\n" : "" %>' +
|
|
|
|
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= package.author.company %>;' +
|
|
|
|
' Licensed <%= package.license %> */\n'
|
2015-02-07 20:26:20 +01:00
|
|
|
},
|
2014-06-18 19:35:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
grunt.config.merge(config);
|
|
|
|
|
2016-05-27 22:40:57 +02:00
|
|
|
// must run before even services/platforms
|
|
|
|
grunt.config.set('build', require('./tasks/config/build')(grunt));
|
|
|
|
|
2016-03-28 04:06:16 +02:00
|
|
|
config.packageScriptsDir = __dirname + '/tasks/build/package_scripts';
|
2015-08-14 20:53:26 +02:00
|
|
|
// ensure that these run first, other configs need them
|
2015-08-14 06:16:54 +02:00
|
|
|
config.services = require('./tasks/config/services')(grunt);
|
2015-08-14 20:53:26 +02:00
|
|
|
config.platforms = require('./tasks/config/platforms')(grunt);
|
2015-08-14 06:16:54 +02:00
|
|
|
|
|
|
|
grunt.config.merge(config);
|
|
|
|
|
2014-06-18 19:35:37 +02:00
|
|
|
// load plugins
|
|
|
|
require('load-grunt-config')(grunt, {
|
|
|
|
configPath: __dirname + '/tasks/config',
|
|
|
|
init: true,
|
2015-08-03 18:35:31 +02:00
|
|
|
config: config,
|
|
|
|
loadGruntTasks: {
|
2017-04-12 00:01:06 +02:00
|
|
|
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*']
|
2015-08-03 18:35:31 +02:00
|
|
|
}
|
2014-02-11 00:09:04 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
// load task definitions
|
2014-09-16 23:16:36 +02:00
|
|
|
grunt.task.loadTasks('tasks');
|
2015-08-14 06:16:54 +02:00
|
|
|
grunt.task.loadTasks('tasks/build');
|
2014-08-26 02:55:32 +02:00
|
|
|
};
|