Skip to content

Commit

Permalink
[heft] Fix incremental copy cache file (#4950)
Browse files Browse the repository at this point in the history
Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
  • Loading branch information
dmichon-msft and dmichon-msft authored Sep 30, 2024
1 parent a06c97d commit 0657762
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/heft/src/pluginFramework/IncrementalBuildInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export async function writeBuildInfoAsync(state: IIncrementalBuildInfo, filePath
const serializedBuildInfo: ISerializedIncrementalBuildInfo = serializeBuildInfo(
state,
(absolutePath: string) => {
return makePathRelative(basePath, absolutePath);
return makePathRelative(absolutePath, basePath);
}
);

Expand Down
4 changes: 3 additions & 1 deletion apps/heft/src/plugins/CopyFilesPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ async function _copyFilesInnerAsync(
oldBuildInfo = undefined;
}

const inputFileVersions: Map<string, string> = new Map();
// Since in watch mode only changed files will get passed in, need to ensure that all files from
// the previous build are still tracked.
const inputFileVersions: Map<string, string> = new Map(oldBuildInfo?.inputFileVersions);

const buildInfo: IIncrementalBuildInfo = {
configHash,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft",
"comment": "Include all previous `inputFileVersions` in incremental copy files cache file during watch mode. Fix incorrect serialization of cache file for file copy.",
"type": "patch"
}
],
"packageName": "@rushstack/heft"
}

0 comments on commit 0657762

Please sign in to comment.