-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
39 lines (32 loc) · 823 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
/*
* gulpfile.js
*/
var gulp = require('gulp');
var gutil = require('gulp-util');
var ghelper = require('gulp-helper');
ghelper.require();
var pkg = require('./package.json');
var config = require('./src/config.json');
gulp.task('default', ['concat', 'uglify']);
gulp.task('concat', function() {
var scripts = config.files.map(function(f) {
return './src/' + f;
});
return gulp.src(scripts)
.pipe(concat('poker.js'))
.pipe(replace('<%= version %>', pkg.version))
.pipe(gulp.dest('./build/'))
;
});
gulp.task('uglify', ['concat'], function() {
return gulp.src('./build/poker.js')
.pipe(uglify())
.pipe(rename({
extname: '.min.js'
}))
.pipe(gulp.dest('./build/'))
.on('end', function() {
util.log(util.colors.blue('finish'));
gutil.beep();
});
});