多种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) {
       
    }
})
上一篇 下一篇

猜你喜欢

热点阅读