Output and directory structure in typescript
<p>Let say that have have the given directory structure for my project :</p>

<pre><code>project 
| app
  | dist
  | src
    | components
      | some .ts files
    | services
      | some .ts files
    | some ts files
</code></pre>

<p>I want to have in dist the output of typescript compilation, but with the same structure starting from app. Example of what I want after compiling</p>

<pre><code>project 
| app
  | dist
      components
      | some .js files
    | services
      | some .js files
    | some js files
  | src
    | components
      | some .ts files
    | services
      | some .ts files
    | some ts files
</code></pre>

<p>But I tried every possible solution I could think of with compile options, my result for dist folder is always that one :</p>

<pre><code>project 
| app
  | dist
    | app 
      | src
        | components
          | some .js files
        | services
          | some .js files
        | some js files
</code></pre>

<p>My tsconfig.json file : </p>

<pre><code>{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es2015", "dom" ],
    "noImplicitAny": true,
    "suppressImplicitAnyIndexErrors": true,
    "outDir": "app/lib"
  },
  "exclude": [
    "node_modules/*"
  ]
}
</code></pre>

<p>I tried a lot of solutions like playing with outDir, putting my tsconfig in app/src and run compilation from there... Nothing, just can't figure this out.</p>