gulp-community / gulp-concat

Streaming concat middleware for gulp
MIT License
792 stars 126 forks source link

Accept vinyl-file options as argument #61

Closed floatdrop closed 10 years ago

floatdrop commented 10 years ago

I've stumbled upon this in issue, that related with gulp-jade.

Jade calculates relative path's from extend and include based on filename which is taken from path of the incoming vinyl file. Problem is - I have bunch of files with mixins that goes before actual file with extend in it. So concat takes path from first file (that contain mixins) and jade calculating extend from mixin file and not from last file, that contains extend instruction.

May be it is worth to create option cloneLast - that will tell gulp-concat to clone last file?

yocontra commented 10 years ago

@floatdrop I think it would make more sense here to just get rid of the file clone, and let people specify the cwd/base/path of a brand new file as an option (with default to the first file like it is currently). I would take a PR that optionally accepts an object as an argument and then uses that in the outbound file instead of cloning

yocontra commented 10 years ago

Oops ^

yocontra commented 10 years ago
concat('app.js') // takes cwd and base from first file

// full overrides
concat({
  cwd: process.cwd(),
  path: '/home/whatever/app.js'
})
floatdrop commented 10 years ago

Looks good. I will try to do this in the morning.

yocontra commented 10 years ago

Awesome - thanks for reporting :+1: