mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 07:02:22 +08:00
tech(systemjs): starting work on systemjs bundling
This commit is contained in:
27
tasks/systemjs_task.js
Normal file
27
tasks/systemjs_task.js
Normal file
@ -0,0 +1,27 @@
|
||||
module.exports = function(grunt) {
|
||||
"use strict";
|
||||
|
||||
grunt.registerTask('systemjs:build', function() {
|
||||
var path = require("path");
|
||||
var Builder = require('systemjs-builder');
|
||||
var done = this.async();
|
||||
|
||||
// optional constructor options
|
||||
// sets the baseURL and loads the configuration file
|
||||
var builder = new Builder('public_gen', 'public_gen/app/systemjs.conf.js');
|
||||
console.log('Starting systemjs-builder');
|
||||
|
||||
builder
|
||||
.bundle('app/app', 'public_gen/app/app.js')
|
||||
.then(function() {
|
||||
console.log('Build complete');
|
||||
done();
|
||||
})
|
||||
.catch(function(err) {
|
||||
console.log('Build error');
|
||||
console.log(err);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
};
|
Reference in New Issue
Block a user