jQuery required?
cutme opened this issue · comments
Bartosz Mediger commented
Webpack 4:
var imageMapResizer = require("image-map-resizer");
When compile, I have error:
ERROR in ./node_modules/image-map-resizer/js/imageMapResizer.min.js
Module not found: Error: Can't resolve 'jquery' in ...
Is jQuery required for image-map-resizer work?
David J. Bradshaw commented
No it should not be required, it will just create a jQuery interface if it is available. This is the only ref to it in the code, so I'm confused by that error
if('jQuery' in window) {
jQuery.fn.imageMapResize = function $imageMapResizeF(){
return this.filter('map').each(scaleImageMap).end();
};
}
Happy to take a PR if you can workout why this happens
David J. Bradshaw commented
Thinking a bit more, does changing that to the following help?
if('jQuery' in window) {
window.jQuery.fn.imageMapResize = function $imageMapResizeF(){
return this.filter('map').each(scaleImageMap).end();
};
}
Bartosz Mediger commented
I removed this fragment and now is ok. Thanks.
David J. Bradshaw commented
I've release a version with the above patch