forked from picturepan2/spectre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (38 loc) · 1.05 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
var gulp = require('gulp');
var less = require('gulp-less');
var cleancss = require('gulp-clean-css');
var csscomb = require('gulp-csscomb');
var rename = require('gulp-rename');
var LessPluginAutoPrefix = require('less-plugin-autoprefix');
var autoprefix= new LessPluginAutoPrefix({ browsers: ["last 3 versions"] });
gulp.task('watch', function() {
gulp.watch('./**/*.less', ['build']);
});
gulp.task('build', function() {
gulp.src('./*.less')
.pipe(less({
plugins: [autoprefix]
}))
.pipe(csscomb())
.pipe(gulp.dest('./dist'))
.pipe(cleancss())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist'))
});
gulp.task('tools', function() {
gulp.src('tools/**/*.less')
.pipe(less({
plugins: [autoprefix]
}))
.pipe(csscomb())
.pipe(cleancss())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest(function(file) {
return file.base;
}))
});
gulp.task('default', ['build']);