gulp-pleeease
Advanced tools
Comparing version 1.0.1 to 1.0.2
33
index.js
@@ -5,4 +5,4 @@ 'use strict'; | ||
var gutil = require('gulp-util'); | ||
var pleeease = require('pleeease'); | ||
var applySourceMap = require('vinyl-sourcemaps-apply'); | ||
var pleeease = require('pleeease'); | ||
@@ -14,9 +14,9 @@ module.exports = function (opts) { | ||
if (file.isNull()) { | ||
this.push(file); | ||
return cb(); | ||
cb(null, file); | ||
return; | ||
} | ||
if (file.isStream()) { | ||
this.emit('error', new gutil.PluginError('gulp-pleeease', 'Streaming not supported')); | ||
return cb(); | ||
cb(new gutil.PluginError('gulp-pleeease', 'Streaming not supported')); | ||
return; | ||
} | ||
@@ -26,10 +26,8 @@ | ||
if (file.sourceMap) { | ||
opts.sourcemaps = {}; | ||
if (file.base && file.path) { | ||
opts.sourcemaps.from = file.relative; | ||
} else { | ||
opts.sourcemaps.from = file.path; | ||
} | ||
opts.sourcemaps.map = { annotation: false }; | ||
opts.sourcemaps = { | ||
from : file.relative || file.path, | ||
map : { | ||
annotation: false | ||
} | ||
}; | ||
} | ||
@@ -39,15 +37,14 @@ | ||
file.contents = new Buffer(result.css || result); | ||
// apply source map to the chain | ||
if (file.sourceMap && result.map && result.map.toString) { | ||
if (file.sourceMap && result.map) { | ||
applySourceMap(file, result.map.toString()); | ||
} | ||
cb(null, file); | ||
} catch (err) { | ||
cb(new gutil.PluginError('gulp-pleeease', err, {fileName: file.path})); | ||
this.emit('error', new gutil.PluginError('gulp-pleeease', err)); | ||
} | ||
this.push(file); | ||
cb(); | ||
}); | ||
}; |
{ | ||
"name": "gulp-pleeease", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Postprocess CSS with ease.", | ||
@@ -39,2 +39,2 @@ "license": "MIT", | ||
"readmeFilename": "readme.md" | ||
} | ||
} |
3082
37