jonkemp / useref

Parse build blocks in HTML files to replace references
MIT License
51 stars 13 forks source link

Pass basePath to custom block handler #6

Closed ghost closed 7 years ago

ghost commented 8 years ago

From within useref custom block handlers I need access to the _basePath variable which gulp-useref uses as vfs.glob base, so that I can push files to the stream and they will be output identically to useref internal blocks.

import: function importer (content, target, options, alternateSearchPath, basePath) {
  //...
  let file = new vinyl({
    base: basePath,
    path: target,
    contents: buffer,
  })
  stream.push(file)
  return `<script src="${target}"></script>`
}
jonkemp commented 7 years ago

Closing since this is a year old. If you still need it, please submit a new pull request so we can discuss.