导出模块js无法正常工作(npm i BigInt)

时间:2018-05-13 11:47:44

标签: javascript node.js angular

我使用名为BigInt.js的模块,角度为4(https://www.npmjs.com/package/BigInt),当我运行我的projet(ng服务)时,会发生这些警告 warnings

然后在尝试使用此模块时,它会变成一个错误

error

我意识到问题在于模块的导出,但我不知道如何解决这个问题! 这是BigInt.js代码! 错误正是这一行factory(require, exports, module);

    (function(factory) {
    if (typeof exports === 'object') {
        // CommonJS
        factory(require, exports, module);
    } else if (typeof define === 'function') {
        // AMD requirejs
        define(factory);
    } else {
        // Plain script tag
        var _module = {};
        _module.exports = {};
        var _require = function(name) { throw new Error("can't require"); }
        factory(_require, _module.exports, _module);
        window.BigInt = _module.exports;
    }
})(function (require, exports, module) {
    "use strict";

    //all the bigint functions 

 module.exports = {
      //Export all functions
    };

});

有任何帮助吗?

0 个答案:

没有答案