-
Notifications
You must be signed in to change notification settings - Fork 226
/
gulpfile.js
42 lines (36 loc) · 1.14 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
var gulp = require('gulp');
var rename = require('gulp-rename');
var less = require('gulp-less');
var minifyCss = require('gulp-minify-css');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var karma = require('karma').server;
gulp.task('default', ['css', 'jshint', 'test', 'compress']);
gulp.task('less', function() {
return gulp.src('./less/*.less')
.pipe(less())
.pipe(gulp.dest('./css'));
});
gulp.task('css', ['less'], function() {
return gulp.src('./css/colorpicker.css')
.pipe(minifyCss())
.pipe(rename('colorpicker.min.css'))
.pipe(gulp.dest('./css'));
});
gulp.task('jshint', function () {
return gulp.src(['js/*.js', 'test/unit/*.js', '!js/bootstrap-colorpicker-module.min.js'])
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('default'));
});
gulp.task('compress', function() {
gulp.src('./js/bootstrap-colorpicker-module.js')
.pipe(uglify())
.pipe(rename('bootstrap-colorpicker-module.min.js'))
.pipe(gulp.dest('./js'))
});
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/test/karma.conf.js',
singleRun: true
}, done);
});