-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
48 lines (33 loc) · 983 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
45
46
47
48
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var prefixer = require('gulp-autoprefixer');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
// Style Tasks
gulp.task('style', function() {
return sass('./src/select.scss', { style: 'compressed' })
.pipe(prefixer({
browsers: ['last 20 versions']
}))
.pipe(rename('select.min.css'))
.pipe(gulp.dest('./dist'));
});
// Javascript Tasks
gulp.task('lint', function() {
return gulp.src('./src/select.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('brains', ['lint'], function() {
return gulp.src('./src/select.js')
.pipe(uglify())
.pipe(rename('select.min.js'))
.pipe(gulp.dest('./dist'));
});
// Because we're lazy
gulp.task('default', function() {
gulp.watch('./src/select.scss', ['style']);
gulp.watch('./src/select.js', ['brains']);
});