Skip to content

Commit 55d4190

Browse files
committed
feat: make filepath relative for cache portability
1 parent 493c789 commit 55d4190

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/cli/src/cache.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export function getDefaultCachePath() {
1818
}
1919

2020
export async function getCacheFilePath(cachePath, filePath) {
21-
const fileName = filePath.replace(/[\\/]/g, '__');
21+
const projectRoot = path.resolve();
22+
const relativePath = path.relative(projectRoot, filePath);
23+
const fileName = relativePath.replace(/[\\/]/g, '__');
2224
return path.join(cachePath, `${fileName}.json`);
2325
}
2426

0 commit comments

Comments
 (0)