对已有框架进行整理调用

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;

  

posted on 2018-11-13 13:12  童彪  阅读(126)  评论(0编辑  收藏  举报

导航