-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGulpfile.js
More file actions
34 lines (27 loc) · 837 Bytes
/
Gulpfile.js
File metadata and controls
34 lines (27 loc) · 837 Bytes
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
var gulp = require('gulp'),
$ = require('gulp-load-plugins')();
gulp.task('traceur:runtime', function() {
return gulp.src($.traceur.RUNTIME_PATH)
.pipe(gulp.dest('dist'));
});
function build(type) {
var runtimePath = $.traceur.RUNTIME_PATH,
_order = ['traceur-runtime.js', 'event.js', 'observe.js', 'global.js'];
var filter = $.filter(['*.js', '!traceur-runtime.js']);
var pipeline = gulp.src([runtimePath, 'lib/*.js'])
.pipe($.order(_order))
.pipe($.sourcemaps.init())
.pipe(filter)
.pipe($.traceur({
sourceMap: true,
modules: type
}))
.pipe(filter.restore())
.pipe($.concat('eventd.js'))
.pipe($.sourcemaps.write('.')).pipe(gulp.dest('dist'));
return pipeline;
}
gulp.task('build:inline', function() {
build('inline');
});
gulp.task('default', ['build:inline']);