Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Explicitly name jQuery in Node require() call for browserify support #95

Merged
merged 1 commit into from

2 participants

@00Davo

browserify can't properly handle require()s with expressions inside, and since require(deps[0]) only ever comes out as require('jquery') in Toastr there's no particular reason not to put the jQuery identifier in the code directly. Having done this, browserify can detect the jQuery dependency and bundle jQuery with Toastr (as is required to have Toastr work).

@johnpapa johnpapa merged commit f837a40 into CodeSeven:master
@smh smh referenced this pull request from a commit in smh/toastr
@smh smh Adding back in support for browserify.
Commit 29fcfcb reverted the changes
from pull request #95 (uninenttionally?). This adds back in the
browserify support.
cbf9d75
@smh smh referenced this pull request from a commit in smh/toastr
@smh smh Adding back in support for browserify.
Commit 29fcfcb reverted the changes
from pull request #95 (unintentionally?). This adds the browserify
support back in.
2feae03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 21, 2013
  1. @00Davo
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 toastr.js
View
4 toastr.js
@@ -261,8 +261,8 @@
});
}(typeof define === 'function' && define.amd ? define : function (deps, factory) {
if (typeof module !== 'undefined' && module.exports) { //Node
- module.exports = factory(require(deps[0]));
+ module.exports = factory(require('jquery'));
} else {
window['toastr'] = factory(window['jQuery']);
}
-}));
+}));
Something went wrong with that request. Please try again.