Title: Theme development with Bower, Node.js, etc.
Last modified: August 24, 2016

---

# Theme development with Bower, Node.js, etc.

 *  [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/theme-development-with-bower-nodejs-etc/)
 * The theme check feature takes a lot of time when we use Bower and Node.js (Grunt)
   for theme development. The /bower_components/ and the /node_modules/ folders 
   contains a lot of files. I guess the listdir function is scanning al these folders
   and files. Is there a way we can ignore these folders/files?
 * [https://plugins.trac.wordpress.org/browser/theme-check/tags/20141222.1/checkbase.php#L153](https://plugins.trac.wordpress.org/browser/theme-check/tags/20141222.1/checkbase.php#L153)
 * I already developed a quick PHP 5.4+ fix, but it would be nice of something like
   this could integrated in this plugin.
 *     ```
       $filter = array( 'bower_components', 'node_modules' );
   
       $dir_iterator = new \RecursiveCallbackFilterIterator(
       	$dir_iterator,
       	function( $item ) use ( $filter ) {
       		return ! in_array( $item->getBaseName(), $filter );
       	}
       );
       ```
   
 * [https://wordpress.org/plugins/theme-check/](https://wordpress.org/plugins/theme-check/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [10 years, 11 months ago](https://wordpress.org/support/topic/theme-development-with-bower-nodejs-etc/#post-6171270)
 * No, those checks should indeed cause errors and failures.
 * Theme-check is primarily developed for use here on WordPress.org, because all
   themes uploaded to the directory are run through it at the time of that upload.
   If it skipped those, then you would be able to include those directories in released
   versions of themes, which you obviously should not do.
 * More likely is that I’d add a check to cause a hard failure on a theme containing
   those directories.
 *  Thread Starter [Remco Tolsma](https://wordpress.org/support/users/remcotolsma/)
 * (@remcotolsma)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/theme-development-with-bower-nodejs-etc/#post-6171274)
 * Ok, sounds good. But still it would be nice if you could improve the listdir()
   function. An /node_modules/ folder can grow quickly over 150+ MB with more then
   30.000 files. With that many files the theme check feature will take forever.
   It took me quit some time to figure out that the large /node_modules/ folder 
   was causing this issue. I guess more users could have this issue. If the listdir()
   function can ignore the /bower_components/**/* and /node_modules/**/* files that
   would be great. You can then still add a hard failure on existance of the folders/
   bower_components/ and /node_modules/.
 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [10 years, 11 months ago](https://wordpress.org/support/topic/theme-development-with-bower-nodejs-etc/#post-6171310)
 * I develop theme check on GitHub. Feel free to help me out, if you like.
 * [https://github.com/Otto42/theme-check](https://github.com/Otto42/theme-check)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Theme development with Bower, Node.js, etc.’ is closed to new replies.

 * ![](https://ps.w.org/theme-check/assets/icon-128x128.png?rev=972579)
 * [Theme Check](https://wordpress.org/plugins/theme-check/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/theme-check/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/theme-check/)
 * [Active Topics](https://wordpress.org/support/plugin/theme-check/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/theme-check/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/theme-check/reviews/)

## Tags

 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [node](https://wordpress.org/support/topic-tag/node/)

 * 3 replies
 * 2 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/theme-development-with-bower-nodejs-etc/#post-6171310)
 * Status: not resolved