backbone.viewmaster icon indicating copy to clipboard operation
backbone.viewmaster copied to clipboard

Enable AMD

Open mauron85 opened this issue 9 years ago • 0 comments

Hi currently there is only commonJS loading capability. My suggestion is to add UMD style module definition.

;(function (root, factory) {
  'use strict';

  if (typeof exports === 'object') {
    module.exports = factory(
      require('underscore'),
      require('backbone')
    );

  } else if (typeof define === 'function' && define.amd) {
    define([
      'underscore',
      'backbone'
    ], factory);

  } else {
    factory(_, Backbone);
  }

}(this, function (_, Backbone) {
  var VERSION = "1.2.4";
//... here will be actual viewmaster code
}));

mauron85 avatar Jul 05 '15 11:07 mauron85