Skip to content

Commit

Permalink
Switch to using through2
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjoar committed Jan 23, 2014
1 parent b519178 commit 53ff3d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var es = require('event-stream');
var rework = require('rework');
var path = require('path');
var through = require('through2');
var validator = require('validator');

var isAbsolute = function(p) {
Expand Down Expand Up @@ -31,14 +31,15 @@ module.exports = function(options) {
options = options || {};
var root = options.root || '.';

return es.map(function(file, cb) {
return through.obj(function(file, enc, cb) {
var css = rebaseUrls(file.contents.toString(), {
currentDir: path.dirname(file.path),
root: path.join(file.cwd, root)
});

file.contents = new Buffer(css);

cb(null, file);
this.push(file);
cb();
});
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "gulp-css-rebase-urls",
"version": "0.0.4",
"version": "0.0.5",
"description": "Rebase relative image URLs",
"main": "index.js",
"dependencies": {
"event-stream": "~3.1.0",
"rework": "~0.20.2",
"validator": "~3.1.0"
"validator": "~3.1.0",
"through2": "~0.4.0"
},
"devDependencies": {
"mocha": "~1.17.0"
Expand Down

0 comments on commit 53ff3d6

Please sign in to comment.