-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
39 lines (34 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
// Include gulp.
var gulp = require('gulp');
// Include plugins.
var notify = require('gulp-notify');
var sassLint = require('gulp-sass-lint');
var jshint = require('gulp-jshint');
var imagemin = require('gulp-imagemin');
var pngcrush = require('imagemin-pngcrush');
var autoprefixer = require('gulp-autoprefixer');
// SCSS Linting.
gulp.task('scss-lint', function() {
return gulp.src(['./_sass/*.scss', './css/main.scss'])
.pipe(sassLint())
.pipe(sassLint.format())
.pipe(sassLint.failOnError());
});
// JS Linting.
gulp.task('js-lint', function() {
return gulp.src('./js/creative.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// Compress images.
gulp.task('images', function () {
return gulp.src('./img/**/**')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{ removeViewBox: false }],
use: [pngcrush()]
}))
.pipe(gulp.dest('./img/'));
});
// Default Task
gulp.task('default', ['js-lint', 'scss-lint']);