versoul/gulp-data-uri — pull request #3 by cviebrock (2014-05-30 19:48:36+00:00)
Title: Get file path relative to source file

A fix for #2 (I hope). As an example, here was my gulpfile.js:

```js
gulp.task('less.select2', function() {
return gulp.src('bower_components/select2/select2.css')
.pipe(data_uri())
.pipe(gulp.dest('build/css'));
});
```

The directory structure looks like:

```
project
+-- gulpfile.js
+-- bower_components
+-- select2
+-- select2.css
+-- select2.png
```

select2.css has:

```css
.whatever {
....
background: url('select2.png') right top no-repeat;
}
```

And the output errors are:

```
[gulp] gulp-data-uri: file not found and it is passed (/Users/admin/Documents/projectselect2.png)
```

So, I don't think your plugin was looking determining the source of the input file correctly.

This pull request fixes it so that it takes the path of the source file, and uses that as the base for any URLs found in the source file. This is my first time working on a gulp plug-in, so apologies if I've done something wrong. Specifically, I don't know if accessing `file.path` is kosher, or if there is a better way.