sindresorhus/broccoli-uncss

html parameter should be relative to the srcDir.

shanielh opened this issue · 5 comments

I'm using broccoli-swig to create my html files, Because of that, I can't use the html parameter relative to the process working directory. html should be relative to the directory of the "input tree". I don't know if there's an easy way to do that.

Ya, I guess we could use the second argument to processString; relativePath.

@joliss thoughts?

I don't think it's going to help, the second argument isn't enough. I think that the second argument should be "absolute path" and not relative, I've read the code of broccoli-filter, and relative path won't help here, we need the full relative path (with the temp source dir).שני.

On Wed, Feb 26, 2014 at 9:39 PM, Sindre Sorhus notifications@github.com
wrote:

Ya, I guess we could use the second argument to processString; relativePath.

@joliss thoughts?

Reply to this email directly or view it on GitHub:
#1 (comment)

Filter by design doesn't allow you to access other files from processString -- I presume that's what you want an "absolute path" argument for, right? Accessing other files would break caching, as the cache wouldn't know to invalidate when the other (dependent) file changes. I'll document this on broccoli-filter when I get around to it.

The solution is to do file handling yourself, e.g. using broccoli-transform or using no plugin helper at all (the API is super simple). Maybe we can also make a broccoli-uncached-filter type of base class helper, which would allow you to access other files.

Or maybe pass some object that allows to add dependent files to the current transformed file. שני.

On Wed, Feb 26, 2014 at 9:51 PM, Jo Liss notifications@github.com wrote:

Filter by design doesn't allow you to access other files from processString -- I presume that's what you want an "absolute path" argument for, right? Accessing other files would break caching, as the cache wouldn't know to invalidate when the other (dependent) file changes. I'll document this on broccoli-filter when I get around to it.

The solution is to do file handling yourself, e.g. using broccoli-transform or using no plugin helper at all (the API is super simple). Maybe we can also make a broccoli-uncached-filter type of base class helper, which would allow you to access other files.

Reply to this email directly or view it on GitHub:
#1 (comment)

It's possible, but I'm hesitant to add this kind of complexity until I understand the set of possible use cases really well. Presumably that will only happen if/when I need it myself, e.g. to add source maps support to broccoli-coffee. So don't hold your breath.