(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.testPlugin = factory()); }(this, (function () { // do somethings var testPlugin = function(option){ console.log('option=====',option); } return testPlugin })));
参考html2canvas插件源码
参考:https://www.cnblogs.com/niklai/p/6095974.html