Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gulp-plumber handling syntax errors only in the main sass file and not in partials #60

Open
mrassili opened this issue Jan 22, 2018 · 0 comments

Comments

@mrassili
Copy link

I'm having an issue with gulp-plumber, when I intentionally make a syntax error in my main file, the error is being shown in console (so it works perfectly) but when I make an error in some partial sass file it compiles and ignore the error for some reason! Also, it only handles the error if I do an error in partial name in the @import line (i.e. @import 'compLnents/buttons') and not when I write (@iLport 'components/buttons')

this is my gulpfile.js

var gulp = require('gulp');

// Plugins
var plugins = require('gulp-load-plugins')();

var sassPattern = 'sass/**/*.scss';

// Sass to CSS
gulp.task('sass', function() {
	// Gets all .scss files in sass/ and children dirs
	return gulp.src(sassPattern)
		.pipe(plugins.plumber(function(error) {
			console.log(error.toString());
			this.emit('end');
		}))
		.pipe(plugins.sourcemaps.init())
		.pipe(plugins.sass())
		.pipe(plugins.minifyCss())
		.pipe(plugins.sourcemaps.write('.'))
		.pipe(gulp.dest('css'))
});

// Watch task
gulp.task('watch', function() {
	return gulp.watch(sassPattern, ['sass']);
});

// Default task
gulp.task('default', ['sass','watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant