forked from TryGhost/Casper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (36 loc) · 1.08 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
var gulp = require('gulp');
var sass = require('gulp-sass'),
autoprefix = require('gulp-autoprefixer'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
imagemin = require('gulp-imagemin'),
notify = require('gulp-notify');
// Stylesheets
gulp.task('sass', function () {
gulp.src('./assets/sass/*.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(autoprefix('last 2 versions'))
.pipe(gulp.dest('./assets/css'))
.pipe(notify({ message: 'Stylesheet build task complete' }));
});
// Javascript
gulp.task('jshint', function () {
gulp.src('./assets/js/*')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
// Images
gulp.task('imagemin', function () {
gulp.src('./assets/images/*')
.pipe(imagemin())
.pipe(gulp.dest(''))
.pipe(notify({ message: 'Image minification task complete' }));
});
gulp.task('default', function() {
// Watch sass files
gulp.watch('./assets/sass/**/*.scss', ['sass']);
// Watch js files
gulp.watch('./assets/scripts/**/*.js', ['scripts']);
// Watch image files
gulp.watch('./assets/images/**/*', ['imagemin']);
});