title: Angular 8 - Lazy loading modules : Error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'
body: <p>When I updated Angular from 7 to Angular 8, getting error for lazy loading modules</p>
  
  <p>I have tried the options, which are there in the angular upgradation guide</p>
  
  <p>Made the below changes:</p>
  
  <p><strong>Before</strong></p>
  
  <pre><code>    loadChildren: '../feature/path/sample- 
                           tage.module#SameTagModule'
  </code></pre>
  
  <p><strong>After</strong></p>
  
  <pre><code>   loadChildren: () =&gt; import('../feature/path/sample- 
                        tags.module').then(m =&gt; m.CreateLinksModule)
  </code></pre>
  
  <blockquote>
    <p>error TS1323: Dynamic import is only supported when '--module' flag is
    'commonjs' or 'esNext'.</p>
  </blockquote>