Skip to content

Instantly share code, notes, and snippets.

@lunelson
Last active February 9, 2018 11:20
Show Gist options
  • Select an option

  • Save lunelson/9fad54b974f0aa108f77 to your computer and use it in GitHub Desktop.

Select an option

Save lunelson/9fad54b974f0aa108f77 to your computer and use it in GitHub Desktop.
Gulp Config to strip Sass comments
//////////////////
// definitions //
//////////////////
var gulp = require('gulp');
var sass = require('gulp-sass');
var strip_comments = require('gulp-strip-json-comments');
//////////
// sass //
//////////
gulp.task('sass', function () {
gulp.src('test/test.scss')
.pipe(sass({
errLogToConsole: false,
onError: function(err) {
console.log(err);
}
}))
.pipe(strip_comments())
.pipe(gulp.dest('test'));
});
///////////
// watch //
///////////
gulp.task('watch', function () {
gulp.watch('test/test.scss', ['sass']);
});
gulp.task('default', ['sass', 'watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment