Make breeze play nice with AMD loaders like require.js
There is a problem when you want to AMD load breeze.js (see http://stackoverflow.com/questions/13937539/breezejs-and-requirejs-not-working-as-expected)
I think the only problem is that breeze.js should define dependencies in the define() call. Currently it calls define(), but doesn't pass ['ko', 'Q'] as dependencies, but instead looks for ko and Q in the global namespace.
If this is too much trouble, please provide second breeze-amd.js version.
1.2.4 removed internal dependencies on RequireJS. External dependencies on RequireJS should now play nice with Breeze.
Adam Steffes commented
Awesome! Thank you!
Ward Bell commented
That was a bit terse. As of v.1.2.4, when BreezeJS looks for an external library (e.g., `jquery`, `Q`, ...), it looks first for such an object in the global namespace (e.g., `window`). If not found, it looks for an ambient function named `require`. If `require` exists, BreezeJS calls it to acquire the library. Now BreezeJS will ask RequireJS for `Q` if you didn't load with script tags. N.B. that you must have caused `Q` to be loaded by RequireJS *before* using `breeze`. So make sure you list `Q` as a dependency of `breeze` when you configure RequireJS for your application.