perf: create module directories before linking start

PR #2875
This commit is contained in:
Zoltan Kochan
2020-09-19 00:54:38 +03:00
committed by GitHub
parent 9289a5039d
commit 40a9e1f3f9
3 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/headless": minor
"supi": minor
---
Create the module dirs of dependencies before importing them and linking their dependencies.

View File

@@ -217,6 +217,7 @@ export default async (opts: HeadlessOptions) => {
prefix: lockfileDir,
})
await Promise.all(depNodes.map((depNode) => fs.mkdir(depNode.modules, { recursive: true })))
await Promise.all([
linkAllModules(depNodes, {
lockfileDir,

View File

@@ -307,6 +307,7 @@ async function linkNewPackages (
const newPkgs = R.props<string, DependenciesGraphNode>(newDepPaths, depGraph)
await Promise.all(newPkgs.map((depNode) => fs.mkdir(depNode.modules, { recursive: true })))
await Promise.all([
linkAllModules(newPkgs, depGraph, {
lockfileDir: opts.lockfileDir,