visionmedia/jade — pull request #1244 by sdether (2013-10-14 06:22:43+00:00)
Title: Ability to track files used to compile a template

I'm working on a piece of middleware that will dynamically compile jade templates to static html and invalidate that html whenever any file used in the compiling the template changes (i.e. extends and includes). Sort of what stylus is for css for jade/html. (wip: https://github.com/sdether/jaded)

In order to do the cache invalidation, i need to know what files make up a compiled template. Since compile only returns a function, I've attached the tree of files i recursively gathered in the parser to the function as a property, which may not be the most elegant way. If you'd prefer I create a new API entry-point that returns an object containing both the compiled function and the file tree, let me know and I'll re-work this.