Grunt Concat Task: How to exclude some files?

I have the following task in grunt:

concat: {
       js: {
       src: ['app/**/**/*.js',
             '!app/**/**/*test.js'],
         dest: 'app/scripts.js'
       }
}

But it doesn't exclude the js files that finish with test. What pattern should I use to exclude these files?

Upvotes: 6

Views: 2182

Answers (1)

ngDeveloper
ngDeveloper

Reputation: 1304

This should work:

concat: {
  js: {
    src: [
      'app/**/*.js',
      '!**/*test.js'
    ],
    dest: 'app/scripts.js'
  }
}

Upvotes: 13

Related Questions