[JavaScript]UMD模块

(function umd(root, factory) {
    if (typeof module === 'object' && typeof exports === 'object')
        module.exports = factory()
    else if (typeof define === 'function' && define.amd)
        define([], factory)
    else
        root.CustomFuc = factory()
})(this, function factory() {

    var CustomFuc = {};



    
    return CustomFuc;
});

 

posted @ 2021-08-09 17:21  阳癫疯  阅读(127)  评论(0编辑  收藏  举报