File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -189,18 +189,17 @@ function* scanCacheDependencies(
189
189
} ) . scanImports ( readFileSync ( target ) ) ;
190
190
for ( const imp of imports ) {
191
191
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
+ ) ;
193
195
if (
194
196
path . includes ( "/node_modules/" ) ||
195
197
excludes . some ( ( x ) => path . match ( x ) )
196
198
)
197
199
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 ) ;
204
203
}
205
204
}
206
205
}
You can’t perform that action at this time.
0 commit comments