Skip to content

Commit d80800f

Browse files
committed
fix dir
2 parents e40a320 + f46d0df commit d80800f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/cli/src/cache.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
import fs from 'fs/promises';
1010
import path from 'path';
11-
const { utils } = require('@stylexjs/shared');
11+
import { utils } from '@stylexjs/shared';
1212

1313
const hash = utils.hash;
1414

@@ -17,6 +17,13 @@ export function getDefaultCachePath() {
1717
return path.join('node_modules', '.stylex-cache');
1818
}
1919

20+
export async function getCacheFilePath(cachePath, filePath) {
21+
const projectRoot = path.resolve(__dirname, '../../../');
22+
const relativePath = path.relative(projectRoot, filePath);
23+
const fileName = relativePath.replace(/[\\/]/g, '__');
24+
return path.join(cachePath, `${fileName}.json`);
25+
}
26+
2027
export async function getCacheFilePath(cachePath, filePath) {
2128
const projectRoot = path.resolve();
2229
const relativePath = path.relative(projectRoot, filePath);

0 commit comments

Comments
 (0)