title: Angular 2 + Typescript compiler copy html and css files
body: <p>In Angular2 I would have     </p>
  
  <pre><code>"outDir": "dist/app"
  </code></pre>
  
  <p>in tsconfig.json. As a result the transpiled .js and .map files are generated in /dist/app/ folder and/or its sub folders. That works all fine.</p>
  
  <p>In my components.ts files I also used referenced html and css like this</p>
  
  <pre><code>@Component({
    selector: 'my-app', 
    templateUrl: 'app/appshell/app.component.html',
    styleUrls: ['app/appshell/app.component.css'],
    ......
  }
  </code></pre>
  
  <p>Is there any way to make compiler to also copy the referenced html and css files for the whole project?
  If yes, how would I configure my tsconfig.json?</p>
  
  <p>I looked into the compiler options here <a href="https://www.typescriptlang.org/docs/handbook/compiler-options.html" rel="noreferrer">https://www.typescriptlang.org/docs/handbook/compiler-options.html</a> but didn't find anything about copying html/css files.</p>
  
  <p><strong>Update:</strong>
  My folder structure is like this</p>
  
  <pre><code>Root
    |--app       // for ts
    |--dist/app  // for js
  </code></pre>
  
  <p>tsconfig.json</p>
  
  <pre><code>"outDir": "dist/app"
  </code></pre>
  
  <p>package.json</p>
  
  <pre><code>{
    "name": "TestApp",
    "version": "1.0.0",
    "scripts": {
      "start": "tsc &amp;&amp; concurrently \"tsc -w\" \"lite-server\" ",
      "html": "find ./app -name '*.html' -type f -exec cp --parents {} ./dist \\;",
      ......
  }
  </code></pre>
  
  <p>It doesn't copy html files. There is no error though.</p>
  
  <p><strong>Update again:</strong></p>
  
  <p>For those who are on Linux OS, Bernardo's solution is a working one.
  For those who are on Windows OS, the following should work.</p>
  
  <pre><code>  "scripts": {
      "html": "XCOPY /S /y .\\app\\*.html .\\dist\\app" }
  </code></pre>