Files
llmx/codex-cli/require-shim.js
Ilan Bigio 59a180ddec Initial commit
Signed-off-by: Ilan Bigio <ilan@openai.com>
2025-04-16 12:56:08 -04:00

12 lines
397 B
JavaScript

/**
* This is necessary because we have transitive dependencies on CommonJS modules
* that use require() conditionally:
*
* https://github.com/tapjs/signal-exit/blob/v3.0.7/index.js#L26-L27
*
* This is not compatible with ESM, so we need to shim require() to use the
* CommonJS module loader.
*/
import { createRequire } from "module";
globalThis.require = createRequire(import.meta.url);