File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -179,18 +179,17 @@ async function nodeExternals(options: ExternalsOptions = {}): Promise<Plugin> {
179
179
for ( let current = process . cwd ( ) , previous : string | undefined = undefined ; previous !== current ; previous = current , current = path . dirname ( current ) ) {
180
180
181
181
// Gather package.json files.
182
- const name = path . join ( current , 'package.json' )
183
- const stat = await fs . stat ( name ) . catch ( ( ) => null )
184
- if ( stat ?. isFile ( ) )
182
+ let name = path . join ( current , 'package.json' )
183
+ if ( await fs . stat ( name ) . then ( stat => stat . isFile ( ) ) . catch ( ( ) => false ) )
185
184
packagePaths . push ( name )
186
185
187
186
// Break early if we are at the root of a git repo.
188
187
if ( current === gitRepository )
189
188
break
190
189
191
190
// Break early is there is a known workspace root file.
192
- for ( const file of workspaceRootFiles ) {
193
- if ( await fs . stat ( path . join ( current , file ) ) . then ( stat => stat . isFile ( ) ) . catch ( ( ) => false ) )
191
+ for ( name of workspaceRootFiles ) {
192
+ if ( await fs . stat ( path . join ( current , name ) ) . then ( stat => stat . isFile ( ) ) . catch ( ( ) => false ) )
194
193
break search
195
194
}
196
195
}
You can’t perform that action at this time.
0 commit comments