Merge pull request #294 from aj0strow/fix-empty-file
check contents length for empty file
This commit is contained in:
commit
e8ed3bdc63
3
index.js
3
index.js
|
@ -25,6 +25,9 @@ var gulpSass = function gulpSass(options, sync) {
|
|||
if (file.isStream()) {
|
||||
return cb(new gutil.PluginError(PLUGIN_NAME, 'Streaming not supported'));
|
||||
}
|
||||
if (!file.contents.length) {
|
||||
return cb(null, file);
|
||||
}
|
||||
if (path.basename(file.path).indexOf('_') === 0) {
|
||||
return cb();
|
||||
}
|
||||
|
|
0
test/expected/empty.css
Normal file
0
test/expected/empty.css
Normal file
|
@ -414,4 +414,11 @@ describe('gulp-sass -- sync compile', function() {
|
|||
}))
|
||||
.on('end', done);
|
||||
});
|
||||
|
||||
it('should work with empty files', function(done) {
|
||||
gulp.src(path.join(__dirname, '/scss/empty.scss'))
|
||||
.pipe(sass.sync())
|
||||
.pipe(gulp.dest(path.join(__dirname, '/results/')))
|
||||
.on('end', done);
|
||||
});
|
||||
});
|
||||
|
|
0
test/scss/empty.scss
Normal file
0
test/scss/empty.scss
Normal file
Loading…
Reference in a new issue