2015-12-17 12:18:30 -06:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
grunt.registerTask('systemjs:build', function() {
|
|
|
|
var Builder = require('systemjs-builder');
|
|
|
|
var done = this.async();
|
|
|
|
|
|
|
|
// optional constructor options
|
|
|
|
// sets the baseURL and loads the configuration file
|
2015-12-21 04:10:16 -06:00
|
|
|
var builder = new Builder('public_gen', 'public_gen/app/system.conf.js');
|
2015-12-17 12:18:30 -06:00
|
|
|
console.log('Starting systemjs-builder');
|
|
|
|
|
2015-12-21 03:02:39 -06:00
|
|
|
var modules = [
|
2016-02-09 02:53:56 -06:00
|
|
|
'app/app',
|
2015-12-21 03:02:39 -06:00
|
|
|
'app/features/all',
|
2016-01-09 16:52:13 -06:00
|
|
|
'app/plugins/panel/**/module',
|
2016-02-09 23:50:17 -06:00
|
|
|
'app/plugins/datasource/graphite/module',
|
|
|
|
'app/plugins/datasource/influxdb/module',
|
|
|
|
'app/plugins/datasource/elasticsearch/module',
|
2015-12-21 03:02:39 -06:00
|
|
|
];
|
|
|
|
|
|
|
|
var expression = modules.join(' + ');
|
|
|
|
|
2015-12-17 12:18:30 -06:00
|
|
|
builder
|
2015-12-21 03:02:39 -06:00
|
|
|
.bundle(expression, 'public_gen/app/app_bundle.js')
|
2015-12-17 12:18:30 -06:00
|
|
|
.then(function() {
|
|
|
|
console.log('Build complete');
|
|
|
|
done();
|
2015-12-21 03:02:39 -06:00
|
|
|
grunt.task.run('concat:bundle_and_boot');
|
2015-12-17 12:18:30 -06:00
|
|
|
})
|
|
|
|
.catch(function(err) {
|
|
|
|
console.log('Build error');
|
|
|
|
console.log(err);
|
2015-12-21 09:34:18 -06:00
|
|
|
done(false);
|
2015-12-17 12:18:30 -06:00
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|