openexchangerates / money.js

money.js is a tiny (1kb) javascript currency conversion library, for web & nodeJS
http://openexchangerates.github.io/money.js
MIT License
1.46k stars 127 forks source link

fxSetup doesn't work with browserify #19

Open davidnorth opened 9 years ago

davidnorth commented 9 years ago

money is assuming that 'this' will === window in browser environments but this doesn't work with Browserify. As a result, fxSetup can't be accessed and you end up with an error from missing rates.

I changed: }(this));

To: }(typeof window === 'undefined' ? this : window));