-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgulpfile.js
45 lines (36 loc) · 930 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
38
39
40
41
var gulp = require('gulp');
var argv = require('yargs').argv;
var pjson = require('./package.json');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var tap = require("gulp-tap");
var jshint = require('gulp-jshint');
gulp.task('list',function(done){
console.log('tasks');
console.log('dist');
console.log('test');
done();
});
gulp.task('test',function(done){
gulp.src(pjson.myFiles)
.pipe(concat('tmp.js'))
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(tap(function(){
console.log('finished');
done();
}));
});
gulp.task('dist',function(done){
gulp.src(pjson.myFiles)
.pipe(concat('all.'+pjson.version+'.js'))
.pipe(gulp.dest('./dist/'))
.pipe(uglify())
.pipe(rename('all.min.'+pjson.version+'.js'))
.pipe(gulp.dest('./dist/'))
.pipe(tap(function(){
console.log('success : all.min.'+pjson.version+'.js');
done();
}));
});