-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (37 loc) · 1.06 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
// load gulp
var gulp = require('gulp'),
imagemin = require('gulp-imagemin'),
minifyCSS = require('gulp-minify-css'),
sass = require('gulp-ruby-sass'),
nodemon = require('gulp-nodemon');
gulp.task('sass', function () {
return sass('public/stylesheets/scss')
.on('error', function (err) {
console.error('Error!', err.message);
})
.pipe(gulp.dest('public/stylesheets/css'));
});
gulp.task('imagemin', function(){
gulp.src('public/images/*')
.pipe(imagemin())
.on('error', function (err) {
console.error('Error!', err.message);
})
.pipe(gulp.dest('public/images/'));
});
gulp.task('styles', function() {
gulp.src('public/stylesheets/css/*.css')
.pipe(minifyCSS())
.pipe(gulp.dest('public/stylesheets/css'))
});
gulp.task('nodemon', function () {
nodemon({
script: 'bin/www'
, ext: 'js html'
})
})
gulp.task('watch', function(){
gulp.watch('public/stylesheets/scss/*.scss', ['sass']);
gulp.watch('public/stylesheets/css/*.css', ['styles']);
})
gulp.task('go',['watch', 'nodemon', 'imagemin']);