title: How to set up Typescript in Symfony?
body: <h2>Question:</h2>
  
  <p>How do I set up Typescript with Symfony with the minimum amount of configurations changes to Symphony’s configuration files?</p>
  
  <p>Here are the points that this solution should solve:</p>
  
  <ol>
  <li><p>Typescript MVC Pattern in a private typescript directory:</p>
  
  <p><strong>src > XBundle > Resources >  private > typescript</strong></p></li>
  <li><p>Javascript bundles compiled in :</p>
  
  <p><strong>src > XBundle > Resources > public > js</strong></p></li>
  <li><p>the private directory should consist of multiple apps for different pages. (If an app requires it's own <code>tsconfig.json</code> file, that's fine)</p></li>
  <li><p>an app is simply (for example) <strong>home.app.ts</strong> that imports (for example) a <strong>search.component.ts</strong> and a <strong>chat.component.ts</strong></p></li>
  <li><p>Compiled "apps" should be located in the <strong>public > js</strong> repository mentioned in point (2) and should be named (example taken from point (4)) <strong>home.bundle.js</strong> </p></li>
  <li><p>In the <code>public &gt; js</code> folder, there should only be <code>x.bundle.js</code> files</p></li>
  <li><p>Adding the bundles to my twig files, and calling my view should immediately run the bundle. I should not have to add an extra script to call the "<code>module</code>" (this is the reason why I want to avoid <code>AMD</code> / <code>System</code> )</p></li>
  </ol>
  
  <h2>What I'm not looking for:</h2>
  
  <p>I'm <strong>not</strong> looking for a solution with <code>react</code> and <code>angular</code> but a general solution using the <code>/web</code> directory (or even the Resources directory in a bundle) at the root of a symfony project.</p>
  
  <p>Most articles regarding this talk about <code>symfony2</code> and try integrating <code>react</code> and <code>angular</code>.</p>
  
  <p>I'm not looking for an installation tutorial for npm and tsc.</p>
  
  <p>I don't need an automatic compile. I use Phpstorm so it does it automatically anyway. </p>