-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (45 loc) · 1.42 KB
/
gulpfile.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
var gulp = require('gulp');
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var watch = require('gulp-watch');
var batch = require('gulp-batch');
var plumber = require('gulp-plumber');
var less = require('gulp-less');
gulp.task('server-es6', function () {
return gulp.src('server/**/*.es6')
.pipe(babel())
.pipe(gulp.dest('server/_compiled'));
});
gulp.task('server-es6-watch', function () {
return gulp.src('server/**/*.es6')
.pipe(watch('server/**/*.es6'))
.pipe(plumber())
.pipe(babel())
.pipe(plumber.stop())
.pipe(gulp.dest('server/_compiled'));
});
gulp.task('client-es6', function () {
return gulp.src('www/**/*.es6')
.pipe(babel())
.pipe(gulp.dest('www/_js'));
});
gulp.task('client-es6-watch', function () {
return gulp.src('www/**/*.es6')
.pipe(watch('www/**/*.es6'))
.pipe(plumber())
.pipe(babel())
.pipe(plumber.stop())
.pipe(gulp.dest('www/_js'));
});
gulp.task('less', function() {
return gulp.src('www/styles/compiled.less')
.pipe(less())
.pipe(gulp.dest('www/styles'));
});
gulp.task('less-watch', function() {
return watch('www/**/*.less', batch(function(events, done) {
gulp.start('less', done)
}));
});
gulp.task('default', ['server-es6', 'client-es6', 'less']);
gulp.task('watch', ['server-es6-watch', 'client-es6-watch', 'less-watch']);