MCPcopy
hub / github.com/Experience-Monks/devtool / moduleWrap

Function moduleWrap

lib/require-hook.js:103–113  ·  view source on GitHub ↗
(script)

Source from the content-addressed store, hash-verified

101 };
102
103 function moduleWrap (script) {
104 if (opts.browserGlobals) {
105 // Use native module wrapper
106 return wrap.call(Module, script);
107 } else {
108 // Use custom module wrapper that undefines window/document
109 return '(function (exports, require, module, __filename, __dirname, process, global, window, navigator, document, self) { ' +
110 script +
111 '\n});';
112 }
113 }
114
115 // Use browser field resolution for require statements
116 if (opts.browserField) {

Callers 1

require-hook.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected