Skip to content

Some UMD wrappers are not detected #2586

Closed

Description

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'};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions