Skip to content

Commit

Permalink
fix node.js browserify compat
Browse files Browse the repository at this point in the history
  • Loading branch information
abrkn committed Nov 14, 2012
1 parent 36178b8 commit 2de8020
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backbone-relational.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* CommonJS shim
**/
var _, Backbone, exports;
if ( typeof window === 'undefined' ) {
if ( typeof require !== 'undefined' ) {
_ = require( 'underscore' );
Backbone = require( 'backbone' );
exports = module.exports = Backbone;
Expand Down

6 comments on commit 2de8020

@glyphobet
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes require.js unable to load Backbone-relational. See issues #215 and #57.

@al
Copy link

@al al commented on 2de8020 Nov 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 (I mean plus one on @glyphobet's comment)

@abrkn
Copy link
Contributor Author

@abrkn abrkn commented on 2de8020 Nov 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, how does Backbone make RequireJS/CommonJS/AMD/node/browserify all work at the same time and relational fails to do so?

@al
Copy link

@al al commented on 2de8020 Nov 29, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Backbone have AMD support? I thought not. I know Underscore used to, but it was removed.

My problem is that this commit breaks existing code written to use Require.js and seems to preclude its use. I'd like to see it fixed up or reverted or else I am stuck using forks.

@PaulUithol
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, there are very few people who know how all these different requirement managers behave and interact. I know I sure don't..

I'll give one potential solution (just a guess, compounded with some common sense...) a shot; if that doesn't work, I'll revert this change.

@abrkn
Copy link
Contributor Author

@abrkn abrkn commented on 2de8020 Dec 1, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

much appreciated

Please sign in to comment.