systemjs_task.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. module.exports = function(grunt) {
  2. "use strict";
  3. grunt.registerTask('systemjs:build', function() {
  4. var Builder = require('systemjs-builder');
  5. var done = this.async();
  6. // optional constructor options
  7. // sets the baseURL and loads the configuration file
  8. var builder = new Builder('public_gen', 'public_gen/app/system.conf.js');
  9. console.log('Starting systemjs-builder');
  10. var modules = [
  11. 'app/app',
  12. 'app/features/all',
  13. 'app/plugins/panel/**/module',
  14. 'app/plugins/datasource/graphite/module',
  15. 'app/plugins/datasource/influxdb/module',
  16. 'app/plugins/datasource/elasticsearch/module',
  17. ];
  18. var expression = modules.join(' + ');
  19. builder
  20. .bundle(expression, 'public_gen/app/app_bundle.js')
  21. .then(function() {
  22. console.log('Build complete');
  23. done();
  24. grunt.task.run('concat:bundle_and_boot');
  25. })
  26. .catch(function(err) {
  27. console.log('Build error');
  28. console.log(err);
  29. done(false);
  30. });
  31. });
  32. };