<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></p>
<p dir="auto"><code class="notranslate">webpack2</code> causes <a href="https://github.com/erikras/redux-form/issues/2269#issuecomment-290887297" data-hovercard-type="issue" data-hovercard-url="/redux-form/redux-form/issues/2269/hovercard">this bug</a> in <code class="notranslate">redux-form</code>. I think the reason is two copies of <code class="notranslate">SubmissionError</code> classes are created and can be referenced separately, causing <code class="notranslate">instanceof</code> confusions.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Please see the error demonstration here:</p>
<p dir="auto"><a href="https://github.com/aq1018/webpack2-redux-form-submission-error-weirdness">https://github.com/aq1018/webpack2-redux-form-submission-error-weirdness</a></p>



<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto"><code class="notranslate">instanceof</code> should return true from instance of classes imported from either import methods.</p>
<p dir="auto"><strong>If this is a feature request, what is motivation or use case for changing the behavior?</strong></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>
<p dir="auto">I asked this question <a href="http://stackoverflow.com/questions/31412009/webpack-creating-duplicate-entries-for-dependencies" rel="nofollow">over on StackOverflow</a> but I figured I might get a better response here.</p>
<p dir="auto">I am trying to switch from using browserify to webpack. One thing browserify handled nicely was dependency management inside dependencies. Let me give an example:</p>
<p dir="auto">Main app project:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var util1 = require('shared-components/util1');
var util2 = require('shared-components/util2');"><pre class="notranslate"><code class="notranslate">var util1 = require('shared-components/util1');
var util2 = require('shared-components/util2');
</code></pre></div>
<p dir="auto">Inside <code class="notranslate">shared-components/util1.js</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var util2 = require('../util2');"><pre class="notranslate"><code class="notranslate">var util2 = require('../util2');
</code></pre></div>
<p dir="auto">Browserify would realize that the reference to util2 in both scenarios was the same but it appears that Webpack does not which creates duplicate entries for util2.</p>
<p dir="auto">Is there a configuration setting or plugin I can use to resolve this?</p>