function resolveConfig(configPath) {
  try {
    return require.resolve(configPath)
  } catch {
    return configPath
  }
}
require() does not exist for ESM, so we must create it to use require.resolve().
@see https://nodejs.org/api/module.html#modulecreaterequirefilename