Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Added UMD wrapper #147

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions src/backbonefire.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* License: MIT
*/

(function(_, Backbone) {
var backbonefire = function(_, Backbone) {
'use strict';

Backbone.Firebase = {};
Expand Down Expand Up @@ -864,4 +864,27 @@

});

})(window._, window.Backbone);
};

/*globals self, global, define, require, module */
(function(backbonefire) {
'use strict';
var root = (typeof self == 'object' && self.self == self && self) ||
(typeof global == 'object' && global.global == global && global);

if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['underscore', 'backbone'], function(_, Backbone) {
backbonefire(_, Backbone);
});
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
var _ = require('underscore');
var Backbone = require('backbone');
module.exports = backbonefire(_, Backbone);
} else {
// Browser globals
backbonefire(root._, root.Backbone);
}

})(backbonefire);