title: ng build -- prod fails (ERROR in Error during template compile of 'AppModule' Unsupported import syntax' but ng build works fine
body: <p>When I use 'ng build --prod' (or 'ng build --aot') I receive the following error:</p>
  
  <pre><code>ERROR in Error during template compile of 'AppModule' 
  Unsupported import syntax
  </code></pre>
  
  <p>What's interesting is that using the 'ng build' command works just fine.</p>
  
  <p>I'm a little bit lost as where to look for the error or how to get a more specific error message. </p>
  
  <p>In some components, I use an import syntax likethis:</p>
  
  <pre><code>import TemplateEditorcomponent = require("./components/admin/templateEditor/templateEditor.component");
  import TemplateEditorComponent = TemplateEditorcomponent.TemplateEditorComponent;
  </code></pre>
  
  <p>Is this the reason why it fails (the use of 'require' function)? If so, why does 'ng build' work fine?</p>
  
  <p>I'm using angular-cli 6.0.3</p>