title: Using Karma, how do I exclude all files that match a pattern except for those within a specific sub-folder?
body: <p>I have a simple AngularJs application setup, that looks a bit like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>client
      vendor
          angular
          bootstrap
          jquery
          ...
      app.module.js
      app.controller.js
      ...
  node_modules
      angular-mocks
      ...
  </code></pre>
  
  <p>I'm setting up a <code>karma.conf.js</code> file and I want to include <code>angular\angular.js</code> from <code>vendor</code>. I don't want to include anything else from <code>vendor</code>.</p>
  
  <p>Here is what I have in the relevant <code>karma.conf.js</code> sections:</p>
  
  <pre><code>files: [
      'client/vendor/angular/angular.js',
      'client/**/*.js',
      'client/**/*.spec.js'
  ],
  exclude: [
      'client/vendor/**/*.js'
  ],
  </code></pre>
  
  <p>The problem I have is simple: I'm including <code>angular.js</code> explicitly in <code>files</code>, but it is then being excluded in the <code>exclude</code> section pattern.</p>
  
  <p>How can I exclude all of <code>client/vendor</code> except for <code>angular/angular.js</code> (and perhaps others later)? The <code>client</code> directory contains a lot of files, sub-folders, etc, that include my own .js files, so it's not easy to just move everything I want to include into a folder of its own, for example.</p>