-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (33 loc) · 977 Bytes
/
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
var gulp = require('gulp'),
gp_concat = require('gulp-concat'),
gp_rename = require('gulp-rename'),
gp_uglify = require('gulp-uglify'),
to5 = require('gulp-6to5');
gulp.task('es6-es5', function(){
return gulp.src([
'./public/app/ServerApp.js',
'./public/app/*/**.js',
'./public/app/*/*/**.js'
]
)
.pipe(to5())
.pipe(gulp.dest('./public/build/es5/'));
});
gulp.task('build', function(){
return gulp.src(
[
'./public/js/jquery.js',
'./public/js/plugins.js',
'./public/js/functions.js'
]
)
.pipe(gp_concat('gulp-concat.js'))
.pipe(gulp.dest('./public/min/'))
.pipe(gp_rename('vendor.min.js'))
.pipe(gp_uglify())
.pipe(gulp.dest('./public/build/'));
});
gulp.task('watch', function() {
gulp.watch(['./public/app/ServerApp.js', './public/app/*/**.js', './public/app/*/*/**.js'], ['es6-es5']);
});
gulp.task('default', ['es6-es5', 'build', 'watch'], function(){});