typeof exports === 'object' && typeof module !== 'undefined'
typeof define === 'function'
factory
в данном контексте?(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Vue = factory());
}(this, (function () {}
function foo (global, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
module.exports = factory();
return;
}
if (typeof define === 'function' && define.amd) {
define(factory);
return;
}
global.Vue = factory();
}
foo(this, finction() { ... });