flowyapps/smoothie — pull request #10 by danvk (2014-11-14 19:35:44+00:00)
Title: Add requireCompiler and requireOverrides

Thanks for your `require.js` -- it makes node.js code work in-browser in a way that nothing else does!

I needed to make two modifications to use it:

1. Added a `requireCompiler` global, which lets you set a function to pre-process all code before it's `eval`d. This lets you do fun things like compile coffeescript or (in my case), apply ES6 transformations using [JSXTransformer][1].
2. Added a `requireOverrides` global which lets you plug in particular return values for `require`s. This is helpful if your code depends on the node versions of, say, jQuery or underscore. For example:

```javascript
// mymodule.js
var $ = require('jquery'),
_ = require('underscore');
...
```

```html