-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (43 loc) · 1.2 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var prefix = require('gulp-autoprefixer');
var csslint = require('gulp-csslint');
var cssmin = require('gulp-minify-css');
gulp.task('scss', function() {
gulp.src('scss/bleuprint.scss')
.pipe(sass())
.pipe(prefix())
.pipe(cssmin())
.pipe(rename('c.css'))
.pipe(gulp.dest('css'));
});
gulp.task('csslint', function() {
gulp.src('css/c.css')
.pipe(csslint({
'compatible-vendor-prefixes': false,
'box-sizing': false,
'important': false,
'known-properties': false
}))
.pipe(csslint.reporter());
});
gulp.task('js', function() {
gulp.src('js/src/*.js')
.pipe(uglify())
.pipe(concat('j.js'))
.pipe(gulp.dest('js'));
});
gulp.task('jslint', function() {
gulp.src('./js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('watch', function() {
gulp.watch('scss/*.scss', ['csslint', 'scss']);
gulp.watch('js/*.js', ['jslint', 'js']);
});
gulp.task('default', ['scss', 'csslint', 'js', 'jslint', 'watch']);