requirejs / almond

A minimal AMD API implementation for use after optimized builds
Other
2.42k stars 169 forks source link

Find external dependencies #79

Closed murrayju closed 10 years ago

murrayju commented 10 years ago

When almond can’t find a dependency, see if we can find it using requirejs or in the global scope before throwing an error.

This allows one to compile a project that has some external dependencies, and still use it with or without using requirejs. For example, building a jquery plugin module.

jrburke commented 10 years ago

It is suggested that if an external dependency is needed, the almond-built code uses a UMD-style wrapper to grab that dependency, then just do a define() internally for that outside module value to bring it into almond.

No plans to add this by default as almond is specialized for "all-in-one" builds that are self contained. Please feel free though to keep a fork, and feel free to mention it in the AMD API shims wiki page.