How to use the @pnpm/git-resolver function in @pnpm/git-resolver

To help you get started, we’ve selected a few @pnpm/git-resolver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / packages / default-resolver / src / index.ts View on Github external
export default function createResolver (
  pnpmOpts: ResolverFactoryOptions,
): ResolveFunction {
  const resolveFromNpm = createResolveFromNpm(pnpmOpts)
  const resolveFromGit = createResolveFromGit(pnpmOpts)
  return async (wantedDependency, opts) => {
    const resolution = await resolveFromNpm(wantedDependency, opts as ResolveFromNpmOptions)
      || wantedDependency.pref && (
        await resolveFromTarball(wantedDependency as {pref: string})
        || await resolveFromGit(wantedDependency as {pref: string})
        || await resolveFromLocal(wantedDependency as {pref: string}, opts)
      )
    if (!resolution) {
      throw new Error(`Cannot resolve ${wantedDependency.alias ? wantedDependency.alias + '@' : ''}${wantedDependency.pref} packages not supported`)
    }
    return resolution
  }
}

@pnpm/git-resolver

Resolver for git-hosted packages

MIT
Latest version published 7 days ago

Package Health Score

66 / 100
Full package analysis

Popular @pnpm/git-resolver functions