title: Error - Only 'amd' and 'system' modules are supported alongside --outFile
body: <p>Trying to compile an Angular project in Visual Studio Code with <code>ng build</code> and serve it with <code>ng serve</code></p>
  
  <p>In both cases got the following error:</p>
  
  <blockquote>
    <p>Only 'amd' and 'system' modules are supported alongside --outFile</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/29P4d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/29P4d.png" alt="Error"></a></p>
  
  <p><a href="https://stackoverflow.com/questions/35963346/only-amd-and-system-modules-are-supported-alongside-out">Didn't use --outFile option</a> for compiling and serving so don't really know where the error is.</p>
  
  <p>Also tried to remove <code>"module": "commonjs"</code> from tsconfig.spec.json as mentioned <a href="https://stackoverflow.com/questions/35963346/only-amd-and-system-modules-are-supported-alongside-out">here</a> but still not working.</p>
  
  <ul>
  <li><strong>tsConfig.spec.json</strong></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/4xRfY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4xRfY.png" alt="tsConfig.json"></a></p>
  
  <p>Any idea on how to solve this error? Thanks!</p>