Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some UMD wrappers are not detected #2586

Closed
Deraen opened this issue Jul 31, 2017 · 2 comments
Closed

Some UMD wrappers are not detected #2586

Deraen opened this issue Jul 31, 2017 · 2 comments

Comments

@Deraen
Copy link
Contributor

Deraen commented Jul 31, 2017

I've hit problems with a few libraries which use UMD wrappers which Closure doesn't detect:

Leaflet https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.1.0/leaflet-src.js:

(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
	typeof define === 'function' && define.amd ? define(['exports'], factory) :
	(factory((global.L = global.L || {})));
}(this, (function (exports) {
   exports.foo = "bar";
})));

Bowser https://github.com/lancedikson/bowser/blob/master/src/bowser.js:

!function (root, name, definition) {
  if (typeof module != 'undefined' && module.exports) module.exports = definition()
  else if (typeof define == 'function' && define.amd) define(name, definition)
  else root[name] = definition()
}(this, 'bowser', function () {
    return {foo: 'bar'};
});
@ChadKillingsworth
Copy link
Collaborator

There are so many of these, it's very hard to properly detect. It'll probably be quite some time before I can look into this.

@ChadKillingsworth
Copy link
Collaborator

Most of these variations are now properly rewritten.

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

No branches or pull requests

2 participants