title: Stop grunt-ts from compiling references
body: <p>I've recently switched from using Web Essentials to grunt-ts to compile my typescript files due to the flexibility of output. Part of the reason I switched is that I don't want all files compiled seperately, and I don't want to have all files compiled to a single file. I want a bit of both. Since I've recently started using grunt for a lot of tasks, I thought I might as well switch my TS build too.</p>
  
  <p>Here's my gruntfile</p>
  
  <pre><code>module.exports = function (grunt) {
      grunt.initConfig({
          pkg: grunt.file.readJSON('package.json'),
          dirs: {
              distribution: 'script/dist',
              ts_root: 'script/src',
              ts_controllers: 'script/src/controllers'
          },
          ts: {
              apprunner: {
                  src: ['&lt;%= dirs.ts_root %&gt;/main.ts'],
                  out: '&lt;%= dirs.distribution %&gt;/src/main.js',
                  options: {
                      target: 'es5'
                  }
              },
              controllers: {
                  src: ['&lt;%= dirs.ts_controllers %&gt;/*.ts'],
                  out: '&lt;%= dirs.distribution %&gt;/src/controllers.js'
                  options: {
                      target: 'es5'
                  }
              }
          }
      });
  
      grunt.loadNpmTasks('grunt-ts');
  
      grunt.registerTask('default', ['ts']);
  };
  </code></pre>
  
  <p>Inside the <code>main.ts</code> file, I have to reference one of the typescript files that, when compiled, makes up part of the <code>controllers.js</code> file. </p>
  
  <p>So my <code>main.js</code> file I have the following:</p>
  
  <pre><code>/// &lt;reference path="controllers/ExampleController.ts" /&gt;
  
  var newExample = new wctApp.controllers.ExampleController();
  </code></pre>
  
  <p>Grunt compiles my <code>controllers.js</code> file fine:</p>
  
  <pre><code>var wctApp;
  (function (wctApp) {
      (function (controllers) {
          var ExampleController = (function () {
              function ExampleController() {
              }
              return ExampleController;
          })();
          controllers.ExampleController = ExampleController;
      })(wctApp.controllers || (wctApp.controllers = {}));
      var controllers = wctApp.controllers;
  })(wctApp || (wctApp = {}));
  </code></pre>
  
  <p>But it compiles the same code inside the <code>main.js</code> file. </p>
  
  <pre><code>var wctApp;
  (function (wctApp) {
      (function (controllers) {
          var ExampleController = (function () {
              function ExampleController() {
              }
              return ExampleController;
           })();
          controllers.ExampleController = ExampleController;
      })(wctApp.controllers || (wctApp.controllers = {}));
      var controllers = wctApp.controllers;
  })(wctApp || (wctApp = {}));
  ;
  var newExample = new wctApp.controllers.ExampleController();
  </code></pre>
  
  <p>If I remove the reference from the main file, it won't build because it can't find ExampleController. How can I keep the reference to this file, but stop it from being compiled in the <code>main.js</code> file.</p>