Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 1.23 KB

README.md

File metadata and controls

38 lines (32 loc) · 1.23 KB

gulp-plumber-notifier

Prevent pipe breaking, log and notify using gulp-plumber and node-notifier

//////////////////////////////////////////////////
// Styles Task                                  //
// + SASS -> CSS                                //
// + Remove unused CSS                          //
// + Add vendor prefixes                        //
// + Minify                                     //
//////////////////////////////////////////////////

gulp.task('styles', function () {
    return gulp
        .src('scss/**/*.scss')
        .pipe(plumberNotifier())
        .pipe(sass({
            outputStyle: 'compressed',
            sourcemap: true,
        }))
        .pipe(uncss({
            html: ['index.html', 'posts/**/*.html', 'http://example.com']
        }))
        .pipe(prefix('last 2 versions'))
        .pipe(csso())
        .on('error', errorLog)
        .pipe(gulp.dest('build/css'))
        .pipe(livereload());
});