<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto"><strong>Error in dynamic import</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Module parse failed: 'import' and 'export' may only appear at the top level (45:8)
You may need an appropriate loader to handle this file type.

ngAfterViewInit() {
      import('./df.tinymce.files')
            .then(() =&gt; {"><pre class="notranslate"><span class="pl-v">Module</span> <span class="pl-s1">parse</span> failed: <span class="pl-s">'import'</span> <span class="pl-s1">and</span> <span class="pl-s">'export'</span> <span class="pl-s1">may</span> <span class="pl-s1">only</span> <span class="pl-s1">appear</span> <span class="pl-s1">at</span> <span class="pl-s1">the</span> <span class="pl-s1">top</span> <span class="pl-en">level</span> <span class="pl-kos">(</span><span class="pl-c1">45</span>:<span class="pl-c1">8</span><span class="pl-kos">)</span>
<span class="pl-v">You</span> <span class="pl-s1">may</span> <span class="pl-s1">need</span> <span class="pl-s1">an</span> <span class="pl-s1">appropriate</span> <span class="pl-s1">loader</span> <span class="pl-s1">to</span> <span class="pl-s1">handle</span> <span class="pl-smi">this</span> <span class="pl-s1">file</span> <span class="pl-s1">type</span><span class="pl-kos">.</span>

<span class="pl-en">ngAfterViewInit</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'./df.tinymce.files'</span><span class="pl-kos">)</span>
            <span class="pl-kos">.</span><span class="pl-c1">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Until version 4.29.0 this was working as expected, it's only with this version that this error happens</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  v4.29.0<br>
Node.js version: v11.7.0<br>
Operating System: mac<br>
Additional tools: ts 3.2.2</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Feature Request</p>


<p dir="auto"><strong>What is the current behavior?</strong><br>
When <code class="notranslate">webpack --watch</code> is first run, the first thing it does it compile all of the entries.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>



<p dir="auto"><strong>What is the expected behavior?</strong><br>
For webpack to simply start watching the files and not immediately compile. But given that this doesn't apply as much to single-entry instances, at least have an option for it.</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong><br>
Given the number of entries (and if sourcemaps are enabled) this can can take a significant amount of time. With this feature one would be able to enable watching and immediately get to work without having to worry about whether it's finishing compiling and is actually watching, yet.</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong><br>
Node: 4.5.0<br>
Webpack: 2.6.1<br>
OS: Windows 10</p>