UNPKG

reqjs

Version:

Require from string for browser use.

26 lines (22 loc) 624 B
/*! * reqjs v1.0.3 * (c) 2017-present egoist <0x142857@gmail.com> * Released under the MIT License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.req = factory()); }(this, (function () { 'use strict'; var index = function (code) { // eslint-disable-next-line no-new-func var fn = new Function( 'module', 'exports', (code + ";return module.exports") ); var _module = { exports: {} }; return fn(_module, _module.exports) }; return index; })));