File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 8
8
*/
9
9
import fs from 'fs/promises' ;
10
10
import path from 'path' ;
11
- const { utils } = require ( '@stylexjs/shared' ) ;
11
+ import { utils } from '@stylexjs/shared' ;
12
12
13
13
const hash = utils . hash ;
14
14
@@ -17,6 +17,13 @@ export function getDefaultCachePath() {
17
17
return path . join ( 'node_modules' , '.stylex-cache' ) ;
18
18
}
19
19
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
+
20
27
export async function getCacheFilePath ( cachePath , filePath ) {
21
28
const projectRoot = path . resolve ( ) ;
22
29
const relativePath = path . relative ( projectRoot , filePath ) ;
You can’t perform that action at this time.
0 commit comments