-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
38 lines (33 loc) · 940 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
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const uglify = require('gulp-uglify');
const pump = require('pump');
const rename = require('gulp-rename');
const babel = require('gulp-babel');
gulp.task('lint', function () {
return gulp.src(['./src/**/*.js', './gulpfile.js'])
.pipe(eslint({
fix: true
}))
.pipe(eslint.format())
.pipe(eslint.failOnError());
});
gulp.task('uglify', function () {
return pump([
gulp.src(['./src/**/*.js'])
.pipe(babel({
presets: ['es2015'],
})),
uglify(),
rename({ suffix: '.min'}),
gulp.dest('dist')]);
});
gulp.task('babel', function(){
return pump([
gulp.src(['./src/**/*.js'])
.pipe(babel({
presets: ['es2015'],
})),
gulp.dest('dist')]);
});
gulp.task('build',['babel','uglify'],function(){});