visionmedia/jade — pull request #1642 by timmfin (2014-08-30 04:20:16+00:00)
Title: Create a new option, `options.loadPaths`

This is similar to `options.filename` and `options.basedir`, but is an array. It allows you to tell jade to search for include/exclude paths in several possible directories (instead of just one).

Something like this is helpful when trying to share groups of jade files (jade modules?) among several different projects. That way, every project that uses these shared modules can refer to them by the same path. For example:

```jade
//- Ideally several projects would refer to these shared jade files like
include module1/sometmpl
extend module2/anothertmpl

//- And not have to do these things like this differently in each project, depending on how exactly that “jade module” was included in that project
include ../../lib/module1/sometmpl
extend /vendor/assets/jade/module2/anothertmpl
```

This gives jade includes/extends a _lot_ more flexibility. Especially when used in a non-node context (like the Rails asset pipeline or some static site generator).

Some similar precedent/examples are [load_paths in SASS](http://sass-lang.com/documentation/Sass.html#load_paths-class_method), the [paths option in Stylus](http://learnboost.github.io/stylus/docs/import.html#stylus-import), and the NODE_PATH environment variable for node.