Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt JS how to target * all folders

This src doesn't appear to target anything/returns nothing.

src: ['docroot/components/*/*.js']

rather than this

src: ['docroot/components/pages/*.js', 'docroot/components/plugins/*.js']

Is it possible to target random folders?

like image 897
Jamie Hutber Avatar asked Aug 26 '13 22:08

Jamie Hutber


1 Answers

You should use double stars : src: ['docroot/components/**/*.js']

Note the double star for folders. If you want to limit to one folder deep scanning you can use src: ['docroot/components/{,*/}*.js'] this can help with performance if needed.

More on how to specify targets : Gruntjs documentation - Configuring tasks : Globbing patterns

like image 160
Jérémie Parker Avatar answered Sep 28 '22 08:09

Jérémie Parker