-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (32 loc) · 819 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'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
babel = require('gulp-babel');
gulp.task('js', function() {
gulp.src([
'js/*.js'
])
.pipe(babel({
presets: ['es2015']
}))
// concat pulls all our files together before minifying them
.pipe( concat('main.min.js') )
.pipe(uglify())
.pipe(gulp.dest('./'))
});
gulp.task('minjs', function() {
gulp.src([
'js/*.js'
])
.pipe(babel({
presets: ['es2015']
}))
// concat pulls all our files together before minifying them
.pipe( concat('main.js') )
.pipe(gulp.dest('./'))
});
gulp.task('watch', function () {
gulp.watch('js/*.js',['js', 'minjs']);
});
gulp.task('default', ['js', 'minjs']);
gulp.task('start', ['watch']);