Skip to content

Commit

Permalink
Merge pull request #12 from STAH/require
Browse files Browse the repository at this point in the history
Make it happy with RequireJS and plain JS
  • Loading branch information
rhysbrettbowen committed May 27, 2014
2 parents 013c3fc + 6dda75f commit feb6af6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions advice.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
// http://opensource.org/licenses/MIT
// ==========================================

define([
'backbone',
'underscore'
], function (Backbone, _) {
(function(root, factory) {
if (typeof exports !== 'undefined') {
// Define as CommonJS export:
module.exports = factory(require('underscore'), require('backbone'));
} else if (typeof define === 'function' && define.amd) {
// Define as AMD:
define('backbone.advice',['underscore', 'backbone'], factory);
} else {
// Just run it:
factory(root._, root.Backbone);
}
}(this, function(_, Backbone) {

Backbone.Advice = {

Expand Down Expand Up @@ -243,4 +251,4 @@ define([

return Backbone.Advice;

});
}));

0 comments on commit feb6af6

Please sign in to comment.