-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (45 loc) · 1.25 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
var gulp = require('gulp'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
minify = require('gulp-clean-css'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
jsFiles = [
'js/checkJQuery.js',
'js/components/*.js',
'js/init.js'
];
gulp.task('less', function() {
gulp.src('less/zui.less')
.pipe(less())
.pipe(autoprefixer())
.pipe(gulp.dest('dist'));
});
gulp.task('less-watch', function() {
gulp.watch('less/**/*.less', ['less']);
});
gulp.task('css', function() {
gulp.src('less/zui.less')
.pipe(less())
.pipe(autoprefixer())
.pipe(minify())
.pipe(rename('zui.min.css'))
.pipe(gulp.dest('dist'));
});
gulp.task('js-concat', function() {
gulp.src(jsFiles)
.pipe(concat('zui.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('js', function() {
gulp.src(jsFiles)
.pipe(concat('zui.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('js-watch', function() {
gulp.watch('js/**/*.js', ['js-concat']);
});
gulp.task('dev', ['less-watch', 'js-watch']);
gulp.task('default', ['less', 'css', 'js-concat', 'js']);