avoidwork / filesize.js

JavaScript library to generate a human readable String describing the file size
https://filesizejs.com
BSD 3-Clause "New" or "Revised" License
1.61k stars 97 forks source link

Correctly check for AMD loader #65

Closed boris-petrov closed 8 years ago

boris-petrov commented 8 years ago

You are currently doing:

if (typeof define === 'function')

While it should be:

if (typeof define === 'function' && define.amd)

Otherwise it breaks, e.g. in Ember.js.

avoidwork commented 8 years ago

Pull request welcome! I don't use ember or care about it.

boris-petrov commented 8 years ago

Should I commit also the grunt-updated files (the stuff in lib) or just the change in src?

avoidwork commented 8 years ago

It should be everything. Make your change to src file, build, if tests pass please commit the result. People that clone shouldn't have to 'build' to get your change, imo.