gulp-sass-error
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

gulp-sass error

By default gulp-sass never throws a clean error exit code (1). A lot of CI systems require this exit code to fail a build. This package provides a function to do so.

Installation

npm install --save gulp-sass-error

Usage

Using es2015 modules / typescript:

import { gulpSassError } from 'gulp-sass-error';
const throwError = true;
 
gulp.task('sass', () => {
    return gulp.src('web/css/*.scss')
        .pipe(
            sass()
            /** Instead of sass.logError you use gulpSassError */             
            .on('error', gulpSassError(throwError))
        )
        .pipe(postcss(config.postcss))
        .pipe(gulp.dest('web/css'));
});

Using require:

const { gulpSassError } = require('gulp-sass-error');
const throwError = true;
 
gulp.task('sass', () => {
    return gulp.src('web/css/*.scss')
        .pipe(
            sass()
            /** Instead of sass.logError you use gulpSassError */             
            .on('error', gulpSassError(throwError))
        )
        .pipe(postcss(config.postcss))
        .pipe(gulp.dest('web/css'));
});

Readme

Keywords

none

Package Sidebar

Install

npm i gulp-sass-error

Weekly Downloads

2,361

Version

1.0.5

License

MIT

Last publish

Collaborators

  • timneutkens