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

(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;

}


慕森卡
浏览 2184回答 3
3回答

慕的地8271018

umd兼容处理。可以看umd部分
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript