jonkemp / gulp-useref

Parse build blocks in HTML files to replace references to non-optimized scripts or stylesheets.
MIT License
705 stars 93 forks source link

Can't pass absolute path as searchPath #123

Closed timdp closed 9 years ago

timdp commented 9 years ago

I was running into an empty stream when passing an absolute path as my searchPath. I kind of expected gulp-useref not to fail silently on an empty glob result, but anyway, the reason why it doesn't work is this call to path.join() (and presumably the one a few lines higher too).

Would changing that call to a path.resolve() break anything? In my case, it worked fine.

As a workaround, I used path.relative(__dirname, dir) to get a relative path, but supporting absolute paths seems like a useful feature.

jonkemp commented 9 years ago

You can submit a pull request if you like. :smile:

timdp commented 9 years ago

Will do!