-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
44 lines (28 loc) · 873 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
42
43
44
var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var cssmin = require('gulp-cssmin');
var rename = require('gulp-rename');
var minify = require('gulp-minify');
var minifyCss = require('gulp-minify-css');
gulp.task('build', ['less-to-css','min-js','min-css']);
gulp.task('less-to-css', function() {
gulp.src('./assets/css/*.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(gulp.dest('./assets/css/'));
});
gulp.task('min-js',['min-css'], function() {
gulp.src('./assets/js/*.js')
.pipe(minify({
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '*-min.js']
}))
.pipe(gulp.dest('./assets/js/'));
});
gulp.task('min-css',['less-to-css'], function() {
gulp.src('./assets/css/*.css')
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest('./assets/css/*'));
});