-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (27 loc) · 859 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
//Dodany autoprefixer
var gulp = require('gulp');
var sass = require('gulp-sass');
var gplumber = require('gulp-plumber');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var errorHandler = function() {
return gplumber(function(error) {
console.log(error.message);
})
};
var autoprefixerOptions = {
browsers: ['last 10 versions', '> 1%', 'Firefox ESR']
};
gulp.task('sass', function() {
return gulp.src('scss/main.scss')
.pipe(errorHandler())
.pipe(sourcemaps.init())
.pipe(sass.sync({outputStyle: 'expanded'}))
.pipe(sourcemaps.write())
.pipe(autoprefixer(autoprefixerOptions))
.pipe(gulp.dest('css'))
});
gulp.task('watch', function(){
return gulp.watch('scss/**/*.scss', ['sass'])
});
gulp.task('default', ['sass', 'watch']);