mapbox / pixelmatch

The smallest, simplest and fastest JavaScript pixel-level image comparison library
ISC License
6.1k stars 304 forks source link

Avoid crash when module is undefined #111

Closed ggorlen closed 2 years ago

ggorlen commented 2 years ago

Closes #110

mourner commented 2 years ago

I'm going to publish a proper browser bundle on NPM in future versions. The module hack is not a suitable way to do that because it exposes other global variables besides pixelmatch. For now, please use https://bundle.run/pixelmatch@5.2.0 instead

ggorlen commented 2 years ago

Yes, it does expose other globals but a closure should solve that, right? The link in the doc readme, https://bundle.run/pixelmatch, doesn't work, but the direct version you shared above does, so I'll use that. Looking forward to the browser bundle. Thanks!