Skip to content

Commit

Permalink
feat: make filepath relative for cache portability
Browse files Browse the repository at this point in the history
  • Loading branch information
mellyeliu committed Jan 13, 2025
1 parent 493c789 commit 55d4190
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cli/src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export function getDefaultCachePath() {
}

export async function getCacheFilePath(cachePath, filePath) {
const fileName = filePath.replace(/[\\/]/g, '__');
const projectRoot = path.resolve();
const relativePath = path.relative(projectRoot, filePath);
const fileName = relativePath.replace(/[\\/]/g, '__');
return path.join(cachePath, `${fileName}.json`);
}

Expand Down

0 comments on commit 55d4190

Please sign in to comment.