Fix fn usage condition
MODIFY
packages/@romejs/core/common/utils/executeMain.ts
packages/@romejs/core/common/utils/executeMain.ts
@@ -51,9 +51,9 @@ export default async function executeMain(
setImmediate,
setInterval,
setTimeout,
- require:
- internalModule.createRequire(filename) ||
- internalModule.createRequireFromPath(filename),
+ require: internalModule.createRequire
+ ? internalModule.createRequire(filename)
+ : internalModule.createRequireFromPath(filename),
console,
__dirname: path.getParent().join(),
__filename: filename,

MODIFY
packages/@romejs/node/index.ts
packages/@romejs/node/index.ts
@@ -19,8 +19,9 @@ function getRequire(folder: AbsoluteFilePath = CWD_PATH): RequireFunction {
}
const filename = folder.join();
- const req =
- mod.createRequire(filename) || mod.createRequireFromPath(filename);
+ const req = mod.createRequire
+ ? mod.createRequire(filename)
+ : mod.createRequireFromPath(filename);
requires.set(folder, req);
return req;
}

Fix fn usage condition