-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (35 loc) · 1.09 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
var gulp = require('gulp');
// plugins
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var less = require('gulp-less');
var minifyCss = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
// concatenate, minify js
gulp.task('js', function() {
return gulp.src('src/**/*.js')
.pipe(concat('bottomDrawer.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('bottomDrawer.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
// less compile, autoprefix, minify css
gulp.task('less', function() {
return gulp.src('src/bottomDrawer/bottomDrawer.less')
.pipe(less())
.pipe(autoprefixer())
.pipe(rename('bottomDrawer.css'))
.pipe(gulp.dest('dist'))
.pipe(rename('bottomDrawer.min.css'))
.pipe(minifyCss())
.pipe(gulp.dest('dist'));
});
// watch files for changes
gulp.task('watch', function() {
gulp.watch('src/**/*.js', ['js']);
gulp.watch('src/**/*.less', ['less']);
});
// default task
gulp.task('default', ['js', 'less']);