segmentio/component-jade — pull request #3 by rschmukler (2013-05-15 17:24:25+00:00)
Title: Added Support for Templates outside of root-dir

Currently `component-jade` breaks if you have something like this:

/component
templates/
template.jade
template2.jade

template.jade

A few things will happen (which this PR resolves)

1) The relative paths won't get maintained, eg. `require(component/templates/template.jade)` won't resolve. Instead, it will assign them to the root directory. ie. `require(component/template2.jade)` would resolve.

2) Templates of the same name will overwrite each other. E.g. `require('component/template.jade');` given a component.json:

...
templates: [ 'template.jade', 'templates/template.jade' ]
...
will resolve to `templates/template.jade`