Skip to content

Commit

Permalink
fix dir
Browse files Browse the repository at this point in the history
  • Loading branch information
mellyeliu committed Jan 13, 2025
2 parents e40a320 + f46d0df commit d80800f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/cli/src/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import fs from 'fs/promises';
import path from 'path';
const { utils } = require('@stylexjs/shared');
import { utils } from '@stylexjs/shared';

const hash = utils.hash;

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

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

export async function getCacheFilePath(cachePath, filePath) {
const projectRoot = path.resolve();
const relativePath = path.relative(projectRoot, filePath);
Expand Down

0 comments on commit d80800f

Please sign in to comment.