rocketlabsdev/require-jade — pull request #12 by pheuter (2013-01-30 21:13:49+00:00)
Title: Refactored to support 'extends' and 'include' when doing single-file optimization with r.js

**Disclaimer:** *This is the result of hacking around core Jade and require-jade functionality. Let this pull request serve as a means to an end rather than the solution.*

### Problem

Jade's template inheritance constructs, such as `extends` and `include`, are broken when using **require-jade**. See see issues [10](https://github.com/rocketlabsdev/require-jade/issues/10) and [11](https://github.com/rocketlabsdev/require-jade/issues/11).

### Proposed solution

Refactor `parseExtends` and `parseInclude` to leverage a modified, synchronous `fetchText`.

### Idiosyncrasies

`parseExtends` and `parseInclude` need to know the baseUrl. I was unable to figure out a way to pass it in other than via `process`. That is why you see the following in `load`:

```coffee
process.baseUrl = parentRequire.toUrl('.').slice(0, -1);
```

I'm sure there is a better way to accomplish this, I'm just not aware of it...