Last active
February 9, 2018 11:20
-
-
Save lunelson/9fad54b974f0aa108f77 to your computer and use it in GitHub Desktop.
Gulp Config to strip Sass comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ////////////////// | |
| // 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