Closed rhewitt22 closed 7 years ago
This is an old Issue but still needs to be fixed.
Like @rhewitt22 mentioned, you can install it with npm but you can't use it in the standard required or import way (import ImageComparison from 'image-comparison';
) when using something like webpack (or other bundlers).
Other than that issue, works great and does everything I need it to!
Version 2.0.2 adds support commonJS and ES6 import! See the readme for more information.
Excellent module! I'm excited to find a solution that doesn't require jQuery.
I'm using browserify to manage and bundle javascript. I see you're attaching
ImageComparison
to the window as a global. It would be great if you could use a UMD wrapper to support CommonJS and RequireJS.var ImageComparison = require('image-comparison');
results in an error (module 'image comparison' not found).package.json
's main field is pointing towards a file that doesn't exist (index.js). The main field should besrc/js/ImageComparison.js
at a minimum so the file can be required even if it's just attached to the window.