Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Add UMD wrapper, remove separate AMD version #39

Merged
merged 1 commit into from
Apr 25, 2014
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"Wreqr": true,
"require": true,
"module": true,
"define": true
"define": true,
"exports": true
}
}
19 changes: 5 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ module.exports = function(grunt) {
pkg: grunt.file.readJSON('package.json'),
meta: {
version: '<%= pkg.version %>',
banner:
banner:
'// Backbone.Wreqr (Backbone.Marionette)\n' +
'// ----------------------------------\n' +
'// ----------------------------------\n' +
'// v<%= pkg.version %>\n' +
'//\n' +
'//\n' +
'// Copyright (c)<%= grunt.template.today("yyyy") %> Derick Bailey, Muted Solutions, LLC.\n' +
'// Distributed under MIT license\n' +
'//\n' +
'//\n' +
'// http://github.com/marionettejs/backbone.wreqr\n' +
'\n\n'
},
Expand All @@ -27,12 +27,7 @@ module.exports = function(grunt) {
files: {
'lib/backbone.wreqr.js' : 'src/wreqr.js'
}
},
core_amd: {
files: {
'lib/amd/backbone.wreqr.js' : 'src/amd.js'
}
},
}
},

concat: {
Expand All @@ -49,10 +44,6 @@ module.exports = function(grunt) {
options: {
banner: "<%= meta.banner %>"
},
amd : {
src : 'lib/amd/backbone.wreqr.js',
dest : 'lib/amd/backbone.wreqr.min.js'
},
core : {
src : 'lib/backbone.wreqr.js',
dest : 'lib/backbone.wreqr.min.js',
Expand Down
4 changes: 2 additions & 2 deletions component.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"jashkenas/backbone": "*",
"jashkenas/underscore": "*"
},
"main": "lib/amd/backbone.wreqr.js",
"main": "lib/backbone.wreqr.js",
"scripts": [
"lib/amd/backbone.wreqr.js"
"lib/backbone.wreqr.js"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A Simple Service Bus For Backbone and Backbone.Marionette",
"version": "1.2.0",
"homepage": "https://github.com/marionettejs/backbone.wreqr",
"main": "lib/amd/backbone.wreqr.js",
"main": "lib/backbone.wreqr.js",
"keywords": [
"backbone",
"plugin",
Expand Down
21 changes: 0 additions & 21 deletions src/amd.js

This file was deleted.

22 changes: 18 additions & 4 deletions src/wreqr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
Backbone.Wreqr = (function(Backbone, Marionette, _){
(function(root, factory) {

if (typeof define === 'function' && define.amd) {
define(['exports', 'backbone', 'underscore'], function(exports, Backbone, _) {
factory(exports, Backbone, _);
});
} else if (typeof exports !== 'undefined') {
var Backbone = require('backbone');
var _ = require('underscore');
factory(exports, Backbone, _);
} else {
factory({}, root.Backbone, root._);
}

}(this, function(Wreqr, Backbone, _) {
"use strict";
var Wreqr = {};

Backbone.Wreqr = Wreqr;

// @include wreqr.handlers.js
// @include wreqr.commandStorage.js
Expand All @@ -10,5 +25,4 @@ Backbone.Wreqr = (function(Backbone, Marionette, _){
// @include wreqr.channel.js
// @include wreqr.radio.js

return Wreqr;
})(Backbone, Backbone.Marionette, _);
}));