drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.39k stars 1.63k forks source link

Does not work with Browserify #391

Closed codedcontainer closed 6 years ago

codedcontainer commented 6 years ago

Does not work as a common js module even though it is listed on NPM.

codedcontainer commented 6 years ago

When trying to require the 2.0 version externally I get the following error: "cannot read property 'extend' of undefined" > win.icheck = $.extend(defaults, win.icheck); When trying to require using NPM install I get the following error: "cannot read property 'fn' of undefined" > $.fn[_iCheck] = function(options, fire) {...

codedcontainer commented 6 years ago

Found a solution to this problem:

1.) Install with NPM 2.) Add with require('icheck'); 3.) Make sure that you using the latest 2.0+ not 3.0+ version of Jquery. 4.) Include Jquery in icheck file in /node_modules/icheck/icheck.js (function($){ var $ = require('jquery'); ...}