<p dir="auto">Taking example 2 from the original issue (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="109143324" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/5039" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/5039/hovercard" href="https://github.com/microsoft/TypeScript/issues/5039">#5039</a>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="projectRoot
├── folder1
│   ├── file1.ts
│   └── file2.ts
├── generated
│   ├── folder1
│   └── folder2
│       └── file3.ts (Contains: import 'folder1/file2';)
└── tsconfig.json (with &quot;baseUrl&quot;: &quot;.&quot;)"><pre class="notranslate"><code class="notranslate">projectRoot
├── folder1
│   ├── file1.ts
│   └── file2.ts
├── generated
│   ├── folder1
│   └── folder2
│       └── file3.ts (Contains: import 'folder1/file2';)
└── tsconfig.json (with "baseUrl": ".")
</code></pre></div>
<p dir="auto">When doing...</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'folder1/file2';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'folder1/file2'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">...in <code class="notranslate">file3.ts</code> it current compiles to the same thing as above. Would it be possible if we could add a compiler option or some way that would convert this to the relative path? So it would transpile it to:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import './../../folder1/file2';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'./../../folder1/file2'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">That way the paths don't have to be managed in two places. I couldn't find this discussed anywhere and didn't want to clutter the original issue so I'm opening this here.</p>
<p dir="auto">In TypeScript 1.9.0-dev.20160426 I tried:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import * as Promise from 'bluebird';

async function test() {
    await Promise.delay(1000);
}

test();"><pre class="notranslate"><code class="notranslate">import * as Promise from 'bluebird';

async function test() {
    await Promise.delay(1000);
}

test();
</code></pre></div>
<p dir="auto">The compiler reports:</p>
<p dir="auto"><code class="notranslate">error TS2529: Duplicate identifier 'Promise'. Compiler reserves name 'Promise' in top level scope of a module containing async functions.</code></p>
<p dir="auto">Especially since this is purely for Node.js, I'd like to use Bluebird promises for their debuggability and import them as <code class="notranslate">Promise</code> instead of some other name.</p>
<p dir="auto">Could I provide my own <code class="notranslate">__awaiter</code> or could the default one use the imported <code class="notranslate">Promise</code>?</p>