function NodeModulesExcluder::excludeNodeModulesFiles

Excludes node_modules directories from stage operations.

Parameters

\Drupal\package_manager\Event\CollectPathsToExcludeEvent $event: The event object.

File

core/modules/package_manager/src/PathExcluder/NodeModulesExcluder.php, line 26

Class

NodeModulesExcluder
Excludes node_modules files from stage directories.

Namespace

Drupal\package_manager\PathExcluder

Code

public function excludeNodeModulesFiles(CollectPathsToExcludeEvent $event) : void {
    $event->addPathsRelativeToProjectRoot($event->scanForDirectoriesByName('node_modules'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.