From 91bbbbcbe85cf09a4b222a88071fa55168e3db84 Mon Sep 17 00:00:00 2001 From: Anton Beloglazov Date: Tue, 23 Sep 2014 15:26:15 +1000 Subject: [PATCH] Added support for CommonJS modules as described in http://dontkry.com/posts/code/browserify-and-the-universal-module-definition.html --- js/jquery.knob.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100755 => 100644 js/jquery.knob.js diff --git a/js/jquery.knob.js b/js/jquery.knob.js old mode 100755 new mode 100644 index 163847b..5294ffa --- a/js/jquery.knob.js +++ b/js/jquery.knob.js @@ -11,7 +11,10 @@ * Thanks to vor, eskimoblood, spiffistan, FabrizioC */ (function (factory) { - if (typeof define === 'function' && define.amd) { + if (typeof exports === 'object') { + // CommonJS + module.exports = factory(require('jquery')); + } else if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else {