itsjavi / bootstrap-colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
https://itsjavi.com/bootstrap-colorpicker/
MIT License
1.38k stars 367 forks source link

Using color picker Webpack and require doesn't work #195

Closed minotogna closed 7 years ago

minotogna commented 7 years ago

I have installed the plugin using npm install bootstrap-colorpicker --save and included in the module with require require( 'bootstrap-colorpicker' )

However I got the following error

Uncaught TypeError: Cannot set property 'colorpicker' of undefined at bootstrap-colorpicker.js:1268 at $ (bootstrap-colorpicker.js:15)

Is there any configuration I'm missing (jquery is included as global object with $ )?

n1crack commented 7 years ago

same issue here..

https://github.com/itsjavi/bootstrap-colorpicker/blob/master/dist/js/bootstrap-colorpicker.js#L15

// module.exports = factory(global.jQuery, global);     doesnt work
module.exports = factory(window.jQuery, window);  works

still need a decent solution.

itsjavi commented 7 years ago

fixed in v2.5.0