jrburke/requirejs — Issue #136: Support for un-modulized scripts
Author: zimbatm
Created: 2011-11-07 12:13:37+00:00
State: open

I'm just learning requirejs and I think it's awesome. The only drawback that I see is that it's not easy to tap into existing scripts because they haven't been wrapped already. It would be nice if requirejs could support them out of the box. Especially when they live on a CDN already, it's not really possible to do that.

I guess the current solution is to add the script in the head before requirejs and write a small module wrapper like this:
`define(jQuery)`

I think this could be done in the requirejs configuration like that:

```
require = {
externs: {
'jquery': {
'//code.jquery.com/jquery-1.7.min.js',
function() { return jQuery.noConflict(); }
}
}
}
```

What do you think of adding such capability to requirejs ?