diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 81cd5f5..1bc99cd 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -8,7 +8,7 @@ */ /*jslint browser: true, white: true, plusplus: true */ -/*global define, window, document, jQuery */ +/*global define, window, document, jQuery, exports */ // Expose plugin as an AMD module if AMD loader is present: (function (factory) { @@ -16,6 +16,9 @@ if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); + } else if (typeof exports === 'object' && typeof require === 'function') { + // Browserify + factory(require('jquery')); } else { // Browser globals factory(jQuery);