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) {
2424 } )
2525 : null
2626 ) || [ ]
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
2851 } ,
2952 }
3053}
You can’t perform that action at this time.
0 commit comments