Change record status: 
Project: 
Introduced in branch: 
11.5.x
Introduced in version: 
11.5.0
Description: 

Hook discovery now respects the existing file_scan_ignore_directories setting that is used for example when discovering extensions.

This avoids parsing node_modules and similar folders when looking for legacy hooks to include and it may be beneficial to customize this when modules or themes include very large folders with many files:

$settings['file_scan_ignore_directories'] = ['node_modules', 'styleguide'];

This is only necessary when scanning for legacy hooks and will be removed/made unecessary in Drupal 13 which will only support OOP hooks in module and themes.

Impacts: 
Module developers
Themers