-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
36 lines (32 loc) · 1.11 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var gulp = require('gulp');
var util = require('gulp-util');
var runSequence = require('run-sequence');
var Builder = require('systemjs-builder');
function SystemJsExtension(config, systemJsConfig) {
var defaultSystemJsConfig = config.src + 'systemjs.conf.js';
systemJsConfig = systemJsConfig || defaultSystemJsConfig;
gulp.task('build-systemjs', function (done) {
runSequence('tsc-app', buildSJS);
function buildSJS () {
var builder = new Builder();
builder.loadConfig(systemJsConfig)
.then(function() {
var path = config.tmpApp;
return builder
.buildStatic(
path + 'main.js',
path + 'bundle.js',
config.systemJs.builder);
})
.then(function() {
util.log('Build complete');
done();
})
.catch(function (ex) {
util.log('Build failed', ex);
done('Build failed.');
});
}
});
}
module.exports = SystemJsExtension;