Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt globbing except a file

I have a list of files:

 'app/scripts/module.js',
 'app/templates/templates.js',
 'app/scripts/**/*.js'

This will load app/scripts/module.js, app/templates/templates.js and then all the files under app/scripts/**/*.js except the one that was loaded before (module.js).
Now I want it to load another file located in app/scripts/a.js at the end of the list.
The problem is that when app/scripts/**/*.js is loaded, it already load app/scripts/a.js.
I want to write something like app/scripts/**/*.js (!a.js) - load all except a.js.
It this possible?

like image 725
Naor Avatar asked Mar 21 '23 10:03

Naor


1 Answers

You want to load 'a.js', but after the other scripts? How about this, (pulled from the docs)

['app/scripts/**/*.js', '!app/scripts/**/a.js', 'app/scripts/**/a.js' ]

If you don't wish to load 'a.js', then just remove the last entry in the array.

['app/scripts/**/*.js', '!app/scripts/**/a.js']

http://gruntjs.com/configuring-tasks#globbing-patterns

like image 91
John McNulty Avatar answered Apr 02 '23 03:04

John McNulty