-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
35 lines (29 loc) · 955 Bytes
/
gulpfile.js
File metadata and controls
35 lines (29 loc) · 955 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');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var headerfooter = require('gulp-header-footer');
var includeJs = require('gulp-browser-js-include');
var rename = require("concur-gulp-rename");
gulp.task('build', function () {
gulp.src('src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('dist'));
gulp.src('src/index.js')
.pipe(includeJs())
.pipe(headerfooter({
header: ';(function () {',
footer: '})();',
filter: function (file) {
return true;
}
}))
.pipe(babel())
.pipe(rename('gaze.js'))
.pipe(gulp.dest('./'));
});
gulp.task('default', ['build'], function () {
var watcher = gulp.watch('src/**/*.js', ['build']);
watcher.on('change', function (event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
});