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;