对已有框架进行整理调用

1.原有框架的输出结构 

;(function(root, factory) {
  if (typeof define === 'function' && define.amd) {
    define(factory);
  } else if (typeof exports === 'object') {
    module.exports = factory();
  } else {
    root.moduleAdd = factory();
  }

})(this, function() {
  var moduleAdd = {};
  
  return moduleAdd;
});

  
2.整理后 可在已有项目中调用的结构

var moduleAdd = {};

module.exports = moduleAdd;

  

https://www.tongbiao.xyz/
原文地址:https://www.cnblogs.com/tongbiao/p/9951633.html