File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,30 @@ export function getGraphFunctions(ctx: RpcFunctionCtx) {
24
24
} )
25
25
: null
26
26
) || [ ]
27
- return modules
27
+ const filteredModules = modules . filter ( ( m ) => {
28
+ return m . id . match ( / \. ( v u e | j s | t s | j s x | t s x | h t m l | j s o n ) ( $ | \? v = ) / )
29
+ } )
30
+ const graph = filteredModules . map ( ( i ) => {
31
+ function searchForVueDeps ( id : string , seen = new Set < string > ( ) ) : string [ ] {
32
+ if ( seen . has ( id ) )
33
+ return [ ]
34
+ seen . add ( id )
35
+ const module = modules . find ( m => m . id === id )
36
+ if ( ! module )
37
+ return [ ]
38
+ return module . deps . flatMap ( ( i ) => {
39
+ if ( filteredModules . find ( m => m . id === i ) )
40
+ return [ i ]
41
+ return searchForVueDeps ( i , seen )
42
+ } )
43
+ }
44
+
45
+ return {
46
+ id : i . id ,
47
+ deps : searchForVueDeps ( i . id ) ,
48
+ }
49
+ } )
50
+ return graph
28
51
} ,
29
52
}
30
53
}
You can’t perform that action at this time.
0 commit comments