diff --git a/benches/jsconfig.json b/benches/jsconfig.json index f8bbf830d7..e08c9c126b 100644 --- a/benches/jsconfig.json +++ b/benches/jsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "es2020", + "module": "es2020", "checkJs": true, "moduleResolution": "node" }, diff --git a/benches/scripts/utils.js b/benches/scripts/utils.js index 17763009cb..5f551888ef 100644 --- a/benches/scripts/utils.js +++ b/benches/scripts/utils.js @@ -4,11 +4,6 @@ import * as path from 'path'; import escalade from 'escalade'; import { globby } from 'globby'; -// TODO: Replace with import.meta.resolve when stable -import { createRequire } from 'module'; -// @ts-ignore -const require = createRequire(import.meta.url); - export const IS_CI = process.env.CI === 'true'; // @ts-ignore @@ -28,8 +23,7 @@ export async function getPkgBinPath(pkgName) { /** @type {string | void} */ let packageJsonPath; try { - // TODO: Replace with import.meta.resolve when stable - const pkgMainPath = require.resolve(pkgName); + const pkgMainPath = await import.meta.resolve(pkgName); packageJsonPath = await escalade(pkgMainPath, (dir, names) => { if (names.includes('package.json')) { return 'package.json';