<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">feature</p>


<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">There is no way to define a custom mode.</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></p>
<p dir="auto">I'm making this up -</p>
<p dir="auto"><code class="notranslate">--mode npm://package-name</code></p>
<p dir="auto">Why?</p>
<ul dir="auto">
<li>I still want source maps so I can debug in production.  I thought this is what people are doing?</li>
<li>I want to share this config with friends</li>
<li>I want a hash in the filename right?</li>
<li>As webpack maintainers, you want to know the most popular configs... you can track these back now</li>
</ul>
<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>
<h1 dir="auto">Bug report</h1>
<p dir="auto">When having several named entry points and sharing a lib with <code class="notranslate">eager:true</code>, the lib code is duplicated to all resulting bundles.</p>
<p dir="auto">Example for entry points:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  entry: {
    main: &quot;./shell/main&quot;, 
    styles: &quot;./shell/styles.css&quot;,
    polyfills: &quot;./shell/polyfills&quot;
  },"><pre class="notranslate">  <span class="pl-s1">entry</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">main</span>: <span class="pl-s">"./shell/main"</span><span class="pl-kos">,</span> 
    <span class="pl-c1">styles</span>: <span class="pl-s">"./shell/styles.css"</span><span class="pl-kos">,</span>
    <span class="pl-c1">polyfills</span>: <span class="pl-s">"./shell/polyfills"</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span></pre></div>
<p dir="auto">Example for shared:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="      shared: {
        &quot;rxjs&quot;: {
          eager: true,
          singleton: true,
        },
      }"><pre class="notranslate">      shared: <span class="pl-kos">{</span>
        <span class="pl-s">"rxjs"</span>: <span class="pl-kos">{</span>
          <span class="pl-c1">eager</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
          <span class="pl-c1">singleton</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
      <span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">The shared lib is duplicated to all bundles (main and polyfills in the example shown).</p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">The shared lib should not be duplicated but only put into one bundle</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  Every version since webpack 5<br>
Node.js version: 16.13.2 LTS<br>
Operating System: windows<br>
Additional tools: no</p>