多种js环境加载使用的写法
2019-12-08 本文已影响0人
sorry510
(function (root, factory) {
if (typeof exports === 'object') {
module.exports = factory()
} else if (typeof define === 'function' && define.amd) {
define(factory)
} else {
root.xxx = factory()
}
})(this, function () {
return function(a) {
}
})