File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -189,18 +189,17 @@ function* scanCacheDependencies(
189189 } ) . scanImports ( readFileSync ( target ) ) ;
190190 for ( const imp of imports ) {
191191 if ( imp . kind === "import-statement" ) {
192- const path = Bun . fileURLToPath ( import . meta. resolve ( imp . path , target ) ) ;
192+ const path = require . resolve (
193+ Bun . fileURLToPath ( import . meta. resolve ( imp . path , target ) )
194+ ) ;
193195 if (
194196 path . includes ( "/node_modules/" ) ||
195197 excludes . some ( ( x ) => path . match ( x ) )
196198 )
197199 continue ;
198- const resolved = Object . keys ( require . cache ) . find ( ( x ) =>
199- x . startsWith ( path )
200- ) ;
201- if ( resolved ) {
202- yield resolved ;
203- yield * scanCacheDependencies ( resolved , excludes ) ;
200+ if ( path in require . cache ) {
201+ yield path ;
202+ yield * scanCacheDependencies ( path , excludes ) ;
204203 }
205204 }
206205 }
You can’t perform that action at this time.
0 commit comments