<h2 dir="auto">Feature request</h2>





<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">If I have the following,</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import('test.js')"><pre class="notranslate"><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">'test.js'</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">with the config,</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
  output: {
    chunkFormat: &quot;module&quot;,
  },
  target: [&quot;web&quot;, &quot;es2020&quot;],
};"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">output</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">chunkFormat</span>: <span class="pl-s">"module"</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-c1">target</span>: <span class="pl-kos">[</span><span class="pl-s">"web"</span><span class="pl-kos">,</span> <span class="pl-s">"es2020"</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">You get the following output</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="(()=&gt;{var e,t,r,o,n={},f={};function i(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.m=n,t=Object.getPrototypeOf?e=&gt;Object.getPrototypeOf(e):e=&gt;e.__proto__,i.t=function(r,o){if(1&amp;o&amp;&amp;(r=this(r)),8&amp;o)return r;if(&quot;object&quot;==typeof r&amp;&amp;r){if(4&amp;o&amp;&amp;r.__esModule)return r;if(16&amp;o&amp;&amp;&quot;function&quot;==typeof r.then)return r}var n=Object.create(null);i.r(n);var f={};e=e||[null,t({}),t([]),t(t)];for(var u=2&amp;o&amp;&amp;r;&quot;object&quot;==typeof u&amp;&amp;!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach((e=&gt;f[e]=()=&gt;r[e]));return f.default=()=&gt;r,i.d(n,f),n},i.d=(e,t)=&gt;{for(var r in t)i.o(t,r)&amp;&amp;!i.o(e,r)&amp;&amp;Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=&gt;Promise.all(Object.keys(i.f).reduce(((t,r)=&gt;(i.f[r](e,t),t)),[])),i.u=e=&gt;e+&quot;.js&quot;,i.o=(e,t)=&gt;Object.prototype.hasOwnProperty.call(e,t),i.r=e=&gt;{&quot;undefined&quot;!=typeof Symbol&amp;&amp;Symbol.toStringTag&amp;&amp;Object.defineProperty(e,Symbol.toStringTag,{value:&quot;Module&quot;}),Object.defineProperty(e,&quot;__esModule&quot;,{value:!0})},r={179:0},o=e=&gt;{var t,o,{ids:n,modules:f,runtime:u}=e,a=0;for(t in f)i.o(f,t)&amp;&amp;(i.m[t]=f[t]);for(u&amp;&amp;u(i);a&lt;n.length;a++)o=n[a],i.o(r,o)&amp;&amp;r[o]&amp;&amp;r[o][0](),r[n[a]]=0},i.f.j=(e,t)=&gt;{var n=i.o(r,e)?r[e]:void 0;if(0!==n)if(n)t.push(n[1]);else{var f=import(&quot;./&quot;+i.u(e)).then(o,(t=&gt;{throw 0!==r[e]&amp;&amp;(r[e]=void 0),t}));f=Promise.race([f,new Promise((t=&gt;n=r[e]=[t]))]),t.push(n[1]=f)}},i.e(4).then(i.t.bind(i,4,23))})();"><pre class="notranslate"><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><span class="pl-k">var</span> <span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">,</span><span class="pl-s1">o</span><span class="pl-kos">,</span><span class="pl-s1">n</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">f</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span><span class="pl-k">function</span> <span class="pl-en">i</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span><span class="pl-kos">{</span><span class="pl-k">var</span> <span class="pl-s1">t</span><span class="pl-c1">=</span><span class="pl-s1">f</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-kos">;</span><span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-c1">!==</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-k">return</span> <span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-c1">exports</span><span class="pl-kos">;</span><span class="pl-k">var</span> <span class="pl-s1">r</span><span class="pl-c1">=</span><span class="pl-s1">f</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">exports</span>:<span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">;</span><span class="pl-k">return</span> <span class="pl-s1">n</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">.</span><span class="pl-c1">exports</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">.</span><span class="pl-c1">exports</span><span class="pl-kos">}</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-c1">m</span><span class="pl-c1">=</span><span class="pl-s1">n</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-c1">=</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">getPrototypeOf</span>?<span class="pl-s1">e</span><span class="pl-c1">=&gt;</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getPrototypeOf</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span>:<span class="pl-s1">e</span><span class="pl-c1">=&gt;</span><span class="pl-s1">e</span><span class="pl-kos">.</span><span class="pl-c1">__proto__</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">t</span><span class="pl-c1">=</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">,</span><span class="pl-s1">o</span><span class="pl-kos">)</span><span class="pl-kos">{</span><span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-c1">&amp;</span><span class="pl-s1">o</span><span class="pl-c1">&amp;&amp;</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-c1">=</span><span class="pl-smi">this</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-c1">8</span><span class="pl-c1">&amp;</span><span class="pl-s1">o</span><span class="pl-kos">)</span><span class="pl-k">return</span> <span class="pl-s1">r</span><span class="pl-kos">;</span><span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s">"object"</span><span class="pl-c1">==</span><span class="pl-k">typeof</span> <span class="pl-s1">r</span><span class="pl-c1">&amp;&amp;</span><span class="pl-s1">r</span><span class="pl-kos">)</span><span class="pl-kos">{</span><span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-c1">&amp;</span><span class="pl-s1">o</span><span class="pl-c1">&amp;&amp;</span><span class="pl-s1">r</span><span class="pl-kos">.</span><span class="pl-c1">__esModule</span><span class="pl-kos">)</span><span class="pl-k">return</span> <span class="pl-s1">r</span><span class="pl-kos">;</span><span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-c1">16</span><span class="pl-c1">&amp;</span><span class="pl-s1">o</span><span class="pl-c1">&amp;&amp;</span><span class="pl-s">"function"</span><span class="pl-c1">==</span><span class="pl-k">typeof</span> <span class="pl-s1">r</span><span class="pl-kos">.</span><span class="pl-c1">then</span><span class="pl-kos">)</span><span class="pl-k">return</span> <span class="pl-s1">r</span><span class="pl-kos">}</span><span class="pl-k">var</span> <span class="pl-s1">n</span><span class="pl-c1">=</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-c1">null</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">r</span><span class="pl-kos">(</span><span class="pl-s1">n</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-k">var</span> <span class="pl-s1">f</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span><span class="pl-s1">e</span><span class="pl-c1">=</span><span class="pl-s1">e</span><span class="pl-c1">||</span><span class="pl-kos">[</span><span class="pl-c1">null</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">;</span><span class="pl-k">for</span><span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">u</span><span class="pl-c1">=</span><span class="pl-c1">2</span><span class="pl-c1">&amp;</span><span class="pl-s1">o</span><span class="pl-c1">&amp;&amp;</span><span class="pl-s1">r</span><span class="pl-kos">;</span><span class="pl-s">"object"</span><span class="pl-c1">==</span><span class="pl-k">typeof</span> <span class="pl-s1">u</span><span class="pl-c1">&amp;&amp;</span><span class="pl-c1">!</span><span class="pl-c1">~</span><span class="pl-s1">e</span><span class="pl-kos">.</span><span class="pl-en">indexOf</span><span class="pl-kos">(</span><span class="pl-s1">u</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-s1">u</span><span class="pl-c1">=</span><span class="pl-s1">t</span><span class="pl-kos">(</span><span class="pl-s1">u</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyNames</span><span class="pl-kos">(</span><span class="pl-s1">u</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-c1">=&gt;</span><span class="pl-s1">f</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-c1">=</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-k">return</span> <span class="pl-s1">f</span><span class="pl-kos">.</span><span class="pl-en">default</span><span class="pl-c1">=</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-s1">r</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">d</span><span class="pl-kos">(</span><span class="pl-s1">n</span><span class="pl-kos">,</span><span class="pl-s1">f</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">n</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">d</span><span class="pl-c1">=</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span><span class="pl-k">for</span><span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">r</span> <span class="pl-k">in</span> <span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">o</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">)</span><span class="pl-c1">&amp;&amp;</span><span class="pl-c1">!</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">o</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">)</span><span class="pl-c1">&amp;&amp;</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">,</span><span class="pl-kos">{</span><span class="pl-c1">enumerable</span>:<span class="pl-c1">!</span><span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">get</span>:<span class="pl-s1">t</span><span class="pl-kos">[</span><span class="pl-s1">r</span><span class="pl-kos">]</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-c1">f</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">e</span><span class="pl-c1">=</span><span class="pl-s1">e</span><span class="pl-c1">=&gt;</span><span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">all</span><span class="pl-kos">(</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-c1">f</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">reduce</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-c1">f</span><span class="pl-kos">[</span><span class="pl-s1">r</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">u</span><span class="pl-c1">=</span><span class="pl-s1">e</span><span class="pl-c1">=&gt;</span><span class="pl-s1">e</span><span class="pl-c1">+</span><span class="pl-s">".js"</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">o</span><span class="pl-c1">=</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">hasOwnProperty</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">r</span><span class="pl-c1">=</span><span class="pl-s1">e</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span><span class="pl-s">"undefined"</span><span class="pl-c1">!=</span><span class="pl-k">typeof</span> <span class="pl-v">Symbol</span><span class="pl-c1">&amp;&amp;</span><span class="pl-v">Symbol</span><span class="pl-kos">.</span><span class="pl-c1">toStringTag</span><span class="pl-c1">&amp;&amp;</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-v">Symbol</span><span class="pl-kos">.</span><span class="pl-c1">toStringTag</span><span class="pl-kos">,</span><span class="pl-kos">{</span><span class="pl-c1">value</span>:<span class="pl-s">"Module"</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s">"__esModule"</span><span class="pl-kos">,</span><span class="pl-kos">{</span><span class="pl-c1">value</span>:<span class="pl-c1">!</span><span class="pl-c1">0</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-c1">179</span>:<span class="pl-c1">0</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">o</span><span class="pl-c1">=</span><span class="pl-s1">e</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span><span class="pl-k">var</span> <span class="pl-s1">t</span><span class="pl-kos">,</span><span class="pl-s1">o</span><span class="pl-kos">,</span><span class="pl-kos">{</span><span class="pl-c1">ids</span>:<span class="pl-s1">n</span><span class="pl-kos">,</span><span class="pl-c1">modules</span>:<span class="pl-s1">f</span><span class="pl-kos">,</span><span class="pl-c1">runtime</span>:<span class="pl-s1">u</span><span class="pl-kos">}</span><span class="pl-c1">=</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">a</span><span class="pl-c1">=</span><span class="pl-c1">0</span><span class="pl-kos">;</span><span class="pl-k">for</span><span class="pl-kos">(</span><span class="pl-s1">t</span> <span class="pl-k">in</span> <span class="pl-s1">f</span><span class="pl-kos">)</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">o</span><span class="pl-kos">(</span><span class="pl-s1">f</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-c1">&amp;&amp;</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-c1">m</span><span class="pl-kos">[</span><span class="pl-s1">t</span><span class="pl-kos">]</span><span class="pl-c1">=</span><span class="pl-s1">f</span><span class="pl-kos">[</span><span class="pl-s1">t</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-k">for</span><span class="pl-kos">(</span><span class="pl-s1">u</span><span class="pl-c1">&amp;&amp;</span><span class="pl-s1">u</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-s1">a</span><span class="pl-c1">&lt;</span><span class="pl-s1">n</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span><span class="pl-s1">a</span><span class="pl-c1">++</span><span class="pl-kos">)</span><span class="pl-s1">o</span><span class="pl-c1">=</span><span class="pl-s1">n</span><span class="pl-kos">[</span><span class="pl-s1">a</span><span class="pl-kos">]</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">o</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">,</span><span class="pl-s1">o</span><span class="pl-kos">)</span><span class="pl-c1">&amp;&amp;</span><span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">o</span><span class="pl-kos">]</span><span class="pl-c1">&amp;&amp;</span><span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">o</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">n</span><span class="pl-kos">[</span><span class="pl-s1">a</span><span class="pl-kos">]</span><span class="pl-kos">]</span><span class="pl-c1">=</span><span class="pl-c1">0</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-c1">f</span><span class="pl-kos">.</span><span class="pl-en">j</span><span class="pl-c1">=</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">)</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span><span class="pl-k">var</span> <span class="pl-s1">n</span><span class="pl-c1">=</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">o</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">,</span><span class="pl-s1">e</span><span class="pl-kos">)</span>?<span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span>:<span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">;</span><span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-c1">!==</span><span class="pl-s1">n</span><span class="pl-kos">)</span><span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">n</span><span class="pl-kos">)</span><span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">n</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-k">else</span><span class="pl-kos">{</span><span class="pl-k">var</span> <span class="pl-s1">f</span><span class="pl-c1">=</span><span class="pl-k">import</span><span class="pl-kos">(</span><span class="pl-s">"./"</span><span class="pl-c1">+</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">u</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">,</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-c1">=&gt;</span><span class="pl-kos">{</span><span class="pl-k">throw</span> <span class="pl-c1">0</span><span class="pl-c1">!==</span><span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-c1">&amp;&amp;</span><span class="pl-kos">(</span><span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-c1">=</span><span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span><span class="pl-s1">f</span><span class="pl-c1">=</span><span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">race</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">f</span><span class="pl-kos">,</span><span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">t</span><span class="pl-c1">=&gt;</span><span class="pl-s1">n</span><span class="pl-c1">=</span><span class="pl-s1">r</span><span class="pl-kos">[</span><span class="pl-s1">e</span><span class="pl-kos">]</span><span class="pl-c1">=</span><span class="pl-kos">[</span><span class="pl-s1">t</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">,</span><span class="pl-s1">t</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">n</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-c1">=</span><span class="pl-s1">f</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-en">e</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">.</span><span class="pl-c1">t</span><span class="pl-kos">.</span><span class="pl-en">bind</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">,</span><span class="pl-c1">4</span><span class="pl-kos">,</span><span class="pl-c1">23</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">}</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">Notably - the <code class="notranslate">import("./"+i.u(e))</code></p>
<p dir="auto">Is there a way to force this to output a statically analysable import statement (i.e. <code class="notranslate">import("./4.js")</code>)?</p>
<p dir="auto"><strong>What is motivation or use case for adding/changing the behavior?</strong></p>
<p dir="auto">If you're using webpack to produce libraries that may be used in other build tools (including webpack), statically analysable imports improve optimisations</p>
<p dir="auto"><strong>How should this be implemented in your opinion?</strong></p>
<p dir="auto">The current config should produce statically analysable imports</p>
<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="-(i.e = (e) =&gt;
-    Promise.all(Object.keys(i.f).reduce((t, r) =&gt; (i.f[r](e, t), t), []))),
+(i.e = (e, importFunction) =&gt;
+    Promise.all(Object.keys(i.f).reduce((t, r) =&gt; (i.f[r](e, t, importFunction), t), []))),
-(i.u = (e) =&gt; e + &quot;.js&quot;),
 (i.f.j = (e, t, importFunction) =&gt; {
     var n = i.o(r, e) ? r[e] : void 0;
     if (0 !== n)
     if (n) t.push(n[1]);
     else {
-        var f = import(&quot;./&quot; + i.u(e)).then(o, (t) =&gt; {
+        var f = importFunction().then(o, (t) =&gt; {
         throw (0 !== r[e] &amp;&amp; (r[e] = void 0), t);
         });
         (f = Promise.race([f, new Promise((t) =&gt; (n = r[e] = [t]))])),
         t.push((n[1] = f));
     }
 }),
-i.e(4).then(i.t.bind(i, 4, 23));
+i.e(4, () =&gt; import(&quot;./4.js&quot;)).then(i.t.bind(i, 4, 23));"><pre class="notranslate"><span class="pl-md"><span class="pl-md">-</span>(i.e = (e) =&gt;</span>
<span class="pl-md"><span class="pl-md">-</span>    Promise.all(Object.keys(i.f).reduce((t, r) =&gt; (i.f[r](e, t), t), []))),</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>(i.e = (e, importFunction) =&gt;</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>    Promise.all(Object.keys(i.f).reduce((t, r) =&gt; (i.f[r](e, t, importFunction), t), []))),</span>
<span class="pl-md"><span class="pl-md">-</span>(i.u = (e) =&gt; e + ".js"),</span>
 (i.f.j = (e, t, importFunction) =&gt; {
     var n = i.o(r, e) ? r[e] : void 0;
     if (0 !== n)
     if (n) t.push(n[1]);
     else {
<span class="pl-md"><span class="pl-md">-</span>        var f = import("./" + i.u(e)).then(o, (t) =&gt; {</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>        var f = importFunction().then(o, (t) =&gt; {</span>
         throw (0 !== r[e] &amp;&amp; (r[e] = void 0), t);
         });
         (f = Promise.race([f, new Promise((t) =&gt; (n = r[e] = [t]))])),
         t.push((n[1] = f));
     }
 }),
<span class="pl-md"><span class="pl-md">-</span>i.e(4).then(i.t.bind(i, 4, 23));</span>
<span class="pl-mi1"><span class="pl-mi1">+</span>i.e(4, () =&gt; import("./4.js")).then(i.t.bind(i, 4, 23));</span></pre></div>
<p dir="auto"><strong>Are you willing to work on this yourself?</strong></p>
<p dir="auto">No - this is way out of my depth <g-emoji class="g-emoji" alias="sweat_smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f605.png">😅</g-emoji></p>
<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong><br>
Throughout the webpack code, md4 is used as has function. md4 is deprecated, and disabled by default in openssl-3.0.0+ (<a href="https://www.openssl.org/docs/manmaster/man3/MD4_Final.html" rel="nofollow">https://www.openssl.org/docs/manmaster/man3/MD4_Final.html</a>)</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong><br>
With any current webpack release, on a system with openssl-3.0.0 (i.e. Fedora rawhide), i.e. webpack serve will give</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="9% setup compilation DefinePluginnode:internal/crypto/hash:67
this[kHandle] = new _Hash(algorithm, xofLen);
                ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/util/createHash.js:155:18)
    at BulkUpdateDecorator.digest (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/util/createHash.js:80:21)
    at /home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/DefinePlugin.js:595:38
    at Hook.eval [as call] (eval at create (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), &lt;anonymous&gt;:198:1)
    at Hook.CALL_DELEGATE [as _call] (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/Compiler.js:1053:26)
    at /home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/Compiler.js:1097:29
    at Hook.eval [as callAsync] (eval at create (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:22:1) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
error Command failed with exit code 1."><pre class="notranslate"><code class="notranslate">9% setup compilation DefinePluginnode:internal/crypto/hash:67
this[kHandle] = new _Hash(algorithm, xofLen);
                ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/util/createHash.js:155:18)
    at BulkUpdateDecorator.digest (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/util/createHash.js:80:21)
    at /home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/DefinePlugin.js:595:38
    at Hook.eval [as call] (eval at create (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), &lt;anonymous&gt;:198:1)
    at Hook.CALL_DELEGATE [as _call] (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/Compiler.js:1053:26)
    at /home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/lib/Compiler.js:1097:29
    at Hook.eval [as callAsync] (eval at create (/home/sandro/Documents/Devel/berlinerglas/berlinerglas-webmap/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), &lt;anonymous&gt;:22:1) {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
error Command failed with exit code 1.
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
No <code class="notranslate">ERR_OSSL_EVP_UNSUPPORTED</code> error</p>
<p dir="auto"><strong>Other relevant information:</strong></p>
<p dir="auto">webpack version:  5.59.1<br>
Node.js version: nodejs-16.11.1-1.fc36.x86_64<br>
Operating System: Fedora rawhide<br>
Additional tools: -</p>
<p dir="auto">Workaround:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cd node_modules/webpack/lib
find -type f -exec sed -i 's|md4|sha512|g' {} \;"><pre class="notranslate"><code class="notranslate">cd node_modules/webpack/lib
find -type f -exec sed -i 's|md4|sha512|g' {} \;
</code></pre></div>