title: TypeScript AMD unable to resolve external module with custom require.config baseUrl
body: <p>I have some troubles with typescript + requirejs.
  I have two projects (the main one and the one with unit tests).
  It looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/nyOJ8.png" alt="solution with two projects">
  <br/>
  moduleA.ts:
  <br/></p>
  
  <pre><code>export class A {
      constructor(someThing: string) {
          this.someThing = someThing;
      }
      someThing: string;
  }
  export var aInst = new A("hello from module A");
  </code></pre>
  
  <p><br/>
  moduleB.ts:
  <br/></p>
  
  <pre><code>import moduleA = require('moduleA');
  
  export class B {
      private a: moduleA.A;
  
      constructor(a: moduleA.A) {
          this.a = a;
      }
  
      getSomeThing() {
          return this.a.someThing;
      }
  }
  
  export var bInst = new B(moduleA.aInst);
  </code></pre>
  
  <p><br/>
  requireConfig.js:
  <br/></p>
  
  <pre><code>require.config({
      baseUrl: "/app",
  });
  </code></pre>
  
  <p><br/>
  myTest.ts:
  <br/></p>
  
  <pre><code>import moduleB = require('moduleB');
  
  QUnit.test('my test', () =&gt; {
      QUnit.equal("hello from module A", moduleB.bInst.getSomeThing());
  });
  </code></pre>
  
  <p><br/>
  testRequreConfig.js:
  <br/></p>
  
  <pre><code>require.config({
      baseUrl: "../Base/app",
  });
  </code></pre>
  
  <p><br/>
  index.html:
  <br/></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
  
      &lt;link rel="stylesheet" href="Content/qunit.css" type="text/css" /&gt;
      &lt;script type="text/javascript" src="Scripts/qunit.js"&gt;&lt;/script&gt;
  
      &lt;script src="Scripts/require.js"&gt;&lt;/script&gt;
      &lt;script src="test/testRequreConfig.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1 id="qunit-header"&gt;Unit Tests&lt;/h1&gt;
      &lt;h2 id="qunit-banner"&gt;&lt;/h2&gt;
      &lt;h2 id="qunit-userAgent"&gt;&lt;/h2&gt;
      &lt;ol id="qunit-tests"&gt;&lt;/ol&gt;
      &lt;div id="qunit-fixture"&gt;test markup, will be hidden&lt;/div&gt;
  
      &lt;script type="text/javascript"&gt;
          (function () {
              QUnit.config.autostart = false;
              require(['test/myTest.js'], QUnit.start);
          }());
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>We are not able to change <b>Base</b> project.
  We want be able to use <b>moduleB</b> in <strong>Test</strong> project (loading by requirejs by 'moduleB' string).
  What we have:<br/> <img src="https://i.stack.imgur.com/l6Ill.png" alt="unable to load">
  <br/>
  TypeScript compiler unable to resolve external module (because it have no idea where to look for it).
  If we put 
  <br/></p>
  
  <pre><code>declare module "moduleB" {
   
      export  ...
  }
  </code></pre>
  
  <p><br/>
  in *.d.ts file - then we would be able to use it. But in real project we have a lot of typescript files and it's not possible to manually write 'declare' for each of them.
  Is there any approach to handle it?
  The main problem is the fact, that we cant edit require.config (for some reasons).</p>
  
  <p>Is it possible to get tsc.exe to know about require.config?</p>