forked from syrotchukandrew/rainbow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
67 lines (56 loc) · 1.75 KB
/
gulpfile.js
File metadata and controls
67 lines (56 loc) · 1.75 KB
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
64
65
66
67
/*---------- gulpfile.js ------------*/
var gulp = require('gulp'),
less = require('gulp-less'),
concatJs = require('gulp-concat'),
minifyJs = require('gulp-uglify'),
clean = require('gulp-clean');
gulp.task('less', function() {
return gulp.src(['web-src/less/*.less'])
.pipe(less({compress: true}))
.pipe(gulp.dest('web/css/'));
});
gulp.task('images', function () {
return gulp.src([
'web-src/images/**'
])
.pipe(gulp.dest('web/images/'))
});
gulp.task('fonts', function () {
return gulp.src(['bower_components/bootstrap/fonts/*',
'web-src/fonts/**'
])
.pipe(gulp.dest('web/fonts'))
});
gulp.task('lib-js', function() {
return gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/bootstrap/dist/js/bootstrap.js',
'bower_components/metisMenu/dist/metisMenu.min.js',
'bower_components/raphael/raphael-min.js',
'bower_components/morrisjs/morris.min.js',
])
.pipe(concatJs('app.js'))
.pipe(minifyJs())
.pipe(gulp.dest('web/js/'));
});
gulp.task('pages-js', function() {
return gulp.src([
'web-src/js/*.js'
])
.pipe(minifyJs())
.pipe(gulp.dest('web/js/'));
});
gulp.task('clean', function () {
return gulp.src(['web/css/*', 'web/js/*', 'web/images/*', 'web/fonts/*'])
.pipe(clean());
});
gulp.task('default', ['clean'], function () {
var tasks = ['images', 'fonts', 'less', 'lib-js', 'pages-js'];
tasks.forEach(function (val) {
gulp.start(val);
});
});
gulp.task('watch', function () {
var less = gulp.watch('web-src/less/*.less', ['less']),
js = gulp.watch('web-src/js/*.js', ['pages-js']);
});