How to use the @pnpm/hoist function in @pnpm/hoist

To help you get started, we’ve selected a few @pnpm/hoist 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 / supi / src / install / link.ts View on Github external
} else if (
    opts.include.dependencies &&
    opts.include.devDependencies &&
    opts.include.optionalDependencies &&
    opts.skipped.size === 0
  ) {
    currentLockfile = newWantedLockfile
  } else {
    currentLockfile = newCurrentLockfile
  }

  let newHoistedAliases: {[depPath: string]: string[]} = {}
  if (newDepPaths.length > 0 || removedDepPaths.size > 0) {
    const rootImporterWithFlatModules = opts.hoistPattern && importers.find(({ id }) => id === '.')
    if (rootImporterWithFlatModules) {
      newHoistedAliases = await hoist(matcher(opts.hoistPattern!), {
        getIndependentPackageLocation: opts.independentLeaves
          ? async (packageId: string, packageName: string) => {
            const { dir } = await opts.storeController.getPackageLocation(packageId, packageName, {
              lockfileDir: opts.lockfileDir,
              targetEngine: opts.sideEffectsCacheRead && ENGINE_NAME || undefined,
            })
            return dir
          }
          : undefined,
        lockfile: currentLockfile,
        lockfileDir: opts.lockfileDir,
        modulesDir: opts.hoistedModulesDir,
        registries: opts.registries,
        virtualStoreDir: opts.virtualStoreDir,
      })
    }

@pnpm/hoist

Hoists dependencies in a node_modules created by pnpm

MIT
Latest version published 12 days ago

Package Health Score

63 / 100
Full package analysis

Popular @pnpm/hoist functions