<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong><br>
Build script fails</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if (false) {
    import('./module'); // &lt;-- Fails to transform this or remove this
}"><pre class="notranslate"><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">false</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">'./module'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// &lt;-- Fails to transform this or remove this</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Probably transforming this expression as well and letting uglify to get rid of it later.</p>
<p dir="auto"><strong>Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node -v
&gt; v8.1.3"><pre class="notranslate"><code class="notranslate">node -v
&gt; v8.1.3
</code></pre></div>
<p dir="auto">I came across this issue because we use feature flags at build time that include specific code if feature is enabled.</p>
<p dir="auto"><strong>Bug</strong></p>


<p dir="auto"><strong>What is the current behavior?</strong><br>
In case of development environment such code</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (process.env.NODE_ENV === 'testing') {
  import('somemodule');
}"><pre class="notranslate"><code class="notranslate">if (process.env.NODE_ENV === 'testing') {
  import('somemodule');
}
</code></pre></div>
<p dir="auto">is transformed by webpack <code class="notranslate">2.5.1</code> into this</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (false) {
  import('somemodule');
}"><pre class="notranslate"><code class="notranslate">if (false) {
  import('somemodule');
}
</code></pre></div>
<p dir="auto">which leads to <code class="notranslate">Uncaught SyntaxError: Unexpected token import</code> error in the latest Chrome.</p>
<p dir="auto">Node.JS 7.10.0, babel 6.24.1 has <code class="notranslate">syntax-dynamic-import</code> plugin</p>