forked from RyanFitzgerald/devportfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (36 loc) · 1.13 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
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var rename = require('gulp-rename');
var autoprefixer = require('gulp-autoprefixer');
gulp.task('scripts', function() {
return gulp.src('js/scripts.js')
.pipe(plumber(plumber({
errorHandler: function (err) {
console.log(err);
this.emit('end');
}
})))
.pipe(uglify({
preserveComments: 'license'
}))
.pipe(rename({extname: '.min.js'}))
.pipe(gulp.dest('js'));
});
gulp.task('styles', function() {
return gulp.src('scss/styles.scss')
.pipe(plumber(plumber({
errorHandler: function (err) {
console.log(err);
this.emit('end');
}
})))
.pipe(sass({outputStyle: 'compressed'}))
.pipe(autoprefixer())
.pipe(gulp.dest('css'));
});
gulp.task('watch', ['scripts', 'styles'], function() {
gulp.watch('js/*.js', ['scripts']);
gulp.watch('scss/*.scss', ['styles']);
});