-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (30 loc) · 937 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
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var postCSS = require('gulp-postcss');
var objectFitImages = require('postcss-object-fit-images');
gulp.task('styles', function() {
gulp.src('styles/**/[^_]*.scss')
.pipe(plumber(function (error) {
console.log(error);
this.emit('end');
}))
.pipe(sass())
.pipe(postCSS([objectFitImages]))
.pipe(autoprefixer({browsers: ['defaults', 'iOS >= 8']}))
.pipe(gulp.dest('public/styles/'));
});
gulp.task('scripts', function() {
gulp.src('scripts/**/[^_]*.js')
.pipe(plumber(function (error) {
console.log(error);
this.emit('end');
}))
.pipe(gulp.dest('public/scripts/'));
});
gulp.task('default', ['watch']);
gulp.task('watch', function() {
gulp.watch('styles/**/*.scss',['styles']);
gulp.watch('scripts/**/*.js',['scripts']);
});