title: Reference External Modules in TypeScript
body: <p>I have an application which I want to convert step by step to TypeScript. Currently we are using browserify to generate a bundle.</p>
  
  <p>When converting to TypeScript I am having some modules which have not yet been converted. In the <a href="http://www.typescriptlang.org/Handbook#modules-working-with-other-javascript-libraries" rel="nofollow">TypeScript Handbook</a> it says that I can reference external modules, when specifying a type definition file for it.</p>
  
  <p>I have a module A.js which is not yet converted to TypeScript. I have a global type definition file which defines</p>
  
  <pre><code>declare module "A" {
      export function foo();
      export function bar();
  }
  </code></pre>
  
  <p>I am importing my module like this:</p>
  
  <pre><code>///&lt;reference path="../../typings/NotYetConvertedModules.d.ts" /&gt;
  import A = require('../someFolder/A');
  </code></pre>
  
  <p>when compiling this I get </p>
  
  <pre><code>error TS2307: Cannot find external module '../someFolder/A'
  </code></pre>
  
  <p>When requiring it with <code>require('A')</code> the compilation step works but the module loader cannot find the file, since I am not having a global alias for it.</p>
  
  <p>Is there any way to solve this?</p>