title: How to compile a specific file with tsc using the paths compiler option
body: <p>I have several files I want to compile using a script. These files rely on the <code>paths</code> compile option to resolve its modules. As I want to target these files specifically I am bound to supplying them to <code>tsc</code> (as I don't want to create a separate <code>tsconfig.json</code> that targets these files for this task)</p>
  
  <p>I've looked at the option to pass the <code>--path</code> parameter to <code>tsc</code>, but this is not allowed (<code>error TS6064: Option 'paths' can only be specified in 'tsconfig.json' file.</code>)</p>
  
  <p>Can I somehow only compile specific <code>.ts</code> files while using the <code>paths</code> option?</p>
  
  <p><strong>Update (22-06-17)</strong></p>
  
  <p>As per request some specific examples:</p>
  
  <p>The relevant settings in the <code>tsconfig.json</code> file are the following:</p>
  
  <pre><code>{
    "compilerOptions": {
      "baseUrl": ".",
      "paths": {
        "Components/*": [
          "./src/Components/*"
        ]
      }
    }
  }
  </code></pre>
  
  <p>so the relevant part is the paths setting, where you can create shorthands to import files from a certain directory. so you can import a file like <code>import {header} from 'Components/header.ts'</code> in stead of <code>import {header} from '../../Components/header.ts'</code></p>
  
  <p>But I need to compile specific files from the command line. But if I try:</p>
  
  <pre><code>tsc --project tsconfig.json entryFile.ts
  </code></pre>
  
  <p>it will give me the error:</p>
  
  <pre><code>error TS5042: Option 'project' cannot be mixed with source files on a command line.
  </code></pre>
  
  <p>and if I try to provide the <code>paths</code> option to the cli I get the following error:</p>
  
  <pre><code>error TS6064: Option 'paths' can only be specified in 'tsconfig.json' file.
  </code></pre>