为了账号安全,请及时绑定邮箱和手机立即绑定

请问这段代码中exports、module是什么意思?this, (function

请问这段代码中exports、module是什么意思?this, (function

慕森卡 2019-02-28 14:34:16
(function (global, factory) {    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :        typeof define === 'function' && define.amd ? define(['exports'], factory) :            (factory((global.echarts = {})));}(this, (function (exports) {    'use strict';// (1) The code `if (__DEV__) ...` can be removed by build tool.// (2) If intend to use `__DEV__`, this module should be imported. Use a global// variable `__DEV__` may cause that miss the declaration (see #6535), or the// declaration is behind of the using position (for example in `Model.extent`,// And tools like rollup can not analysis the dependency if not import).    var dev;// In browser    if (typeof window !== 'undefined') {`请输入代码`        dev = window.__DEV__;    }// In node    else if (typeof global !== 'undefined') {        dev = global.__DEV__;    }    if (typeof dev === 'undefined') {        dev = true;    }    var __DEV__ = dev;}
查看完整描述

3 回答

?
慕的地8271018

TA贡献1796条经验 获得超4个赞

umd兼容处理。
可以看umd部分

查看完整回答
反对 回复 2019-03-06
  • 3 回答
  • 0 关注
  • 2180 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信