Skip to content

Conversation

@hugomrdias
Copy link

In a browserify package, this will refer to a node-style exports object, not
window. So just reference window directly.

…ct, not window. So just reference window directly.
@OtaK
Copy link

OtaK commented Dec 10, 2014

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;

@blueimp
Copy link
Owner

blueimp commented Apr 24, 2015

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 blueimp closed this Apr 24, 2015
@D34THWINGS
Copy link

@blueimp can you make the same changes that you made on this PR blueimp/JavaScript-Canvas-to-Blob#22 ? Because your library is unusable alongside browserify otherwise

@blueimp
Copy link
Owner

blueimp commented Aug 18, 2015

@D34THWINGS: Done.

@hugomrdias:
Sorry for the delay of one year, I think this pull request was closed by mistake back then.

@D34THWINGS
Copy link

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants