gobblejs / gobble

The last build tool you'll ever need
333 stars 20 forks source link

Transform context #24

Closed evs-chris closed 9 years ago

evs-chris commented 9 years ago

It might be handy to have transforms called with a context that gives them automagic access to the gobble instance that is calling them (in my case for env()). Also handy would be a way to log what's going on in a gobble-friendly in the midst of a long-ish-running transform. Perhaps something like this.log()? console.log is not very pretty jumping in between all the pacman dots :-)

Rich-Harris commented 9 years ago

Yes, this makes sense - though I reckon it should be readonly (i.e. this.env rather than this.gobble.env(), which by definition would allow this.gobble.env('mwhahah')). I like the this.log() idea as well