Use require & es6 import side by side
<p><em>Is there any pitfalls of using webpack's require and es6's imports in the same file?</em></p>

<p>Example (two imports are in the same file):</p>

<pre><code>import View1 from 'mobileComponents/View1';

//because if statement is impossible in es6 imports which are static
const View2 = require(process.env.PROJECT === 'mobile' ? 'mobileComponents/View2' : 'desktopComponents/View2'); 
</code></pre>

<p>I'm using es6 imports. I just started a desktop version of a project and want to reuse much of code. Sometimes I want to import desktop version of a code and don't want totally downgrade to webpack requires.</p>