jrburke/r.js — pull request #697 by gfranko (2014-06-18 15:25:19+00:00)
Title: Add support for a new onReadFileError optimizer hook

**What**: A new `onReadFileError` optimizer hook that is called whenever the Require.js optimizer cannot find a file dependency.

**Why**: This will allow developers to add custom support for fallback file lookup algorithms (e.g. node.js)

**Example:**

```javascript
onReadFileError: function (moduleName, path) {
var fs = require('fs');
// If a file is not found with the Require.js configurations,
// use the node.js file lookup algorithm
return fs.readFileSync(require.resolve(moduleName), 'utf8');
}
```

**Questions**: I could not get the Require.js tests to complete successfully **with or without** this change. Could you take a look and let me know what else I need to do to integrate this PR?

Thanks!