-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
63 lines (50 loc) · 1.32 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var gulp = require('gulp');
var filter = require('gulp-filter');
var mkdirp = require('mkdirp');
var del = require('del');
var destLib = 'libs'
var srcLib = ['node_modules/**/**',
'bower_components/**/**',
'!node_modules/**/node_modules/**',
//'!node_modules/**/lib/**',
'!node_modules/**/test/**',
'!node_modules/**/examples/**',
];
/* temporary lib cleaner */
gulp.task('clean-node', function (cb) {
del(['node_modules'], cb);
});
gulp.task('clean-bower', function (cb) {
del(['bower_components'], cb);
});
/* for resteing libs copy */
gulp.task('clean-libs', function (cb) {
del(['libs'], cb);
});
gulp.task('clean-all',['clean-libs','clean-bower','clean-node']);
/* default tasks */
gulp.task('mkdir', function() {
mkdirp(destLib, function (err) {
if (err) console.error(err);
});
});
gulp.task('js', function() {
gulp.src(srcLib)
.pipe(filter('**/*.min.js'))
.pipe(gulp.dest(destLib));
gulp.src(srcLib)
.pipe(filter('**/*.js'))
.pipe(gulp.dest(destLib));
gulp.src(srcLib)
.pipe(filter('**/*.min.js.map'))
.pipe(gulp.dest(destLib));
});
gulp.task('css', function() {
gulp.src(srcLib)
.pipe(filter('**/*.css'))
.pipe(gulp.dest(destLib));
});
// Default Task
gulp.task('default', ['mkdir','js','css']);
// reset and copy
gulp.task('reset-default', ['clean-libs','mkdir','js']);