(target, prop)
| 99 | |
| 100 | cachedNodeProcessShim = new Proxy(process, { |
| 101 | get(target, prop) { |
| 102 | if (prop === 'mainModule') { |
| 103 | return { |
| 104 | require: esmRequire, |
| 105 | exports: {}, |
| 106 | id: '.', |
| 107 | filename: '', |
| 108 | loaded: true, |
| 109 | children: [], |
| 110 | paths: [], |
| 111 | }; |
| 112 | } |
| 113 | return Reflect.get(target, prop); |
| 114 | }, |
| 115 | }); |
| 116 | } catch { |
| 117 | // If createRequire fails for any reason, return browser shim as fallback |
no test coverage detected