We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6d8303 commit 8f9dfecCopy full SHA for 8f9dfec
cli/common/runtime.js
@@ -1,9 +1,10 @@
1
// @ts-check
2
-import { createRequire } from "node:module";
+import { fileURLToPath } from "node:url";
3
import * as path from "node:path";
4
5
-const require = createRequire(import.meta.url);
+const runtimePackageJsonUrl = await import.meta.resolve(
6
+ "@rescript/runtime/package.json",
7
+);
8
+const runtimePackageJsonPath = fileURLToPath(runtimePackageJsonUrl);
9
-const runtimePackageJson = require.resolve("@rescript/runtime/package.json");
-
-export const runtimePath = path.dirname(runtimePackageJson);
10
+export const runtimePath = path.dirname(runtimePackageJsonPath);
0 commit comments