Skip to content

Commit

Permalink
fix(js): postProcessInlinedDependencies throwing error on movePackage (
Browse files Browse the repository at this point in the history
  • Loading branch information
Itrulia authored May 31, 2023
1 parent 346c1f7 commit dfa19f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/js/src/utils/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ export function postProcessInlinedDependencies(
}

const parentDistPath = join(outputPath, parentOutputPath);
const markedForDeletion = new Set<string>();

// move parentOutput
movePackage(parentDistPath, outputPath);
markedForDeletion.add(parentDistPath);

const inlinedDepsDestOutputRecord: Record<string, string> = {};
// move inlined outputs
Expand All @@ -80,6 +82,7 @@ export function postProcessInlinedDependencies(
copySync(depOutputPath, destDepOutputPath, { overwrite: true });
} else {
movePackage(depOutputPath, destDepOutputPath);
markedForDeletion.add(depOutputPath);
}

// TODO: hard-coded "src"
Expand All @@ -88,6 +91,7 @@ export function postProcessInlinedDependencies(
}
}

markedForDeletion.forEach((path) => removeSync(path));
updateImports(outputPath, inlinedDepsDestOutputRecord);
}

Expand Down Expand Up @@ -262,7 +266,6 @@ function buildInlineGraphExternals(
function movePackage(from: string, to: string) {
if (from === to) return;
copySync(from, to, { overwrite: true });
removeSync(from);
}

function updateImports(
Expand Down

1 comment on commit dfa19f5

@vercel
Copy link

@vercel vercel bot commented on dfa19f5 May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app

Please sign in to comment.