Skip to content

Commit

Permalink
Skip some common JS files
Browse files Browse the repository at this point in the history
See #27.
  • Loading branch information
swissspidy committed May 2, 2018
1 parent 9cc71ef commit 3950e4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/JsCodeExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3950e4a

Please sign in to comment.