From 3950e4a72dc09d94ac139ca045428f556f7f0c44 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 3 May 2018 00:02:35 +0200 Subject: [PATCH] Skip some common JS files See #27. --- src/JsCodeExtractor.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/JsCodeExtractor.php b/src/JsCodeExtractor.php index e02fcdb1..ab02bc13 100644 --- a/src/JsCodeExtractor.php +++ b/src/JsCodeExtractor.php @@ -101,9 +101,15 @@ protected static function getFilesFromDirectory( $dir ) { continue; } - if ( $file->isFile() && 'js' === $file->getExtension() ) { - $filtered_files[] = $file->getPathname(); + if ( ! $file->isFile() || 'js' !== $file->getExtension() ) { + continue; } + + if ( in_array( $file->getBasename(), [ 'webpack.config.js', 'Gruntfile.js' ], true ) ) { + continue; + } + + $filtered_files[] = $file->getPathname(); } return $filtered_files;