mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-28 12:01:37 -04:00
perf: fix performance issue caused by refactoring
This commit is contained in:
@@ -92,17 +92,20 @@ async function installInContext (installType: string, packagesToInstall: Depende
|
||||
cacheTTL: opts.cacheTTL
|
||||
}),
|
||||
}
|
||||
return (
|
||||
await installMultiple(installCtx,
|
||||
return Array.prototype.concat.apply([], await Promise.all([
|
||||
installMultiple(
|
||||
installCtx,
|
||||
packagesToInstall,
|
||||
nodeModulesPath,
|
||||
installOpts)
|
||||
).concat(
|
||||
await installMultiple(installCtx,
|
||||
installOpts
|
||||
),
|
||||
installMultiple(
|
||||
installCtx,
|
||||
ctx.pkg && ctx.pkg && ctx.pkg.optionalDependencies || {},
|
||||
nodeModulesPath,
|
||||
Object.assign({}, installOpts, {optional: true}))
|
||||
)
|
||||
Object.assign({}, installOpts, {optional: true})
|
||||
),
|
||||
]))
|
||||
})
|
||||
|
||||
if (opts.flatTree) {
|
||||
|
||||
@@ -92,18 +92,22 @@ async function install (pkgRawSpec: string, modules: string, ctx: InstallContext
|
||||
optional: dependency.optional,
|
||||
root: dependency.srcPath,
|
||||
})
|
||||
dependency.dependencies = (await installMultiple(ctx,
|
||||
dependency.dependencies = Array.prototype.concat.apply([], await Promise.all([
|
||||
installMultiple(
|
||||
ctx,
|
||||
dependency.pkg.dependencies || {},
|
||||
path.join(dependency.path, 'node_modules'),
|
||||
nextInstallOpts)
|
||||
).concat(
|
||||
await installMultiple(ctx,
|
||||
nextInstallOpts
|
||||
),
|
||||
installMultiple(
|
||||
ctx,
|
||||
dependency.pkg.optionalDependencies || {},
|
||||
path.join(dependency.path, 'node_modules'),
|
||||
Object.assign({}, nextInstallOpts, {
|
||||
optional: true
|
||||
}))
|
||||
)
|
||||
})
|
||||
),
|
||||
]))
|
||||
ctx.piq = ctx.piq || []
|
||||
ctx.piq.push({
|
||||
path: dependency.path,
|
||||
|
||||
Reference in New Issue
Block a user