File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/node/src/integrations Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,21 @@ import { dirname, join } from 'path';
44
55let moduleCache : { [ key : string ] : string } ;
66
7+ /** Extract information about paths */
8+ function getPaths ( ) : string [ ] {
9+ try {
10+ return require . cache ? Object . keys ( require . cache as Record < string , unknown > ) : [ ] ;
11+ } catch ( e ) {
12+ return [ ] ;
13+ }
14+ }
15+
716/** Extract information about package.json modules */
817function collectModules ( ) : {
918 [ name : string ] : string ;
1019} {
1120 const mainPaths = ( require . main && require . main . paths ) || [ ] ;
12- const paths = require . cache ? Object . keys ( require . cache as Record < string , unknown > ) : [ ] ;
21+ const paths = getPaths ( ) ;
1322 const infos : {
1423 [ name : string ] : string ;
1524 } = { } ;
You can’t perform that action at this time.
0 commit comments