Closed hugomrdias closed 9 years ago
Why would you want to browserify it? It doesn't depend on any AMD or node/npm modules.
Something like this should be enough to support requireJS/commonJS or any AMD loader:
// AMD / CommonJS stuff
if (typeof define === 'function' && !!define.amd)
define(function() { return loadImage; });
else if (typeof module === 'object' && !!module && typeof module.exports === 'object' && !!module.exports)
module.exports = loadImage;
else
window.loadImage = loadImage;
Sorry for my late reply.
If this package is loaded via browserify, it's intended that loadImage
should be set as a property of the exports object.
@blueimp can you make the same changes that you made on this PR https://github.com/blueimp/JavaScript-Canvas-to-Blob/pull/22 ? Because your library is unusable alongside browserify otherwise
@D34THWINGS: Done.
@hugomrdias: Sorry for the delay of one year, I think this pull request was closed by mistake back then.
Thanks !
In a browserify package, this will refer to a node-style exports object, not window. So just reference window directly.