<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">I met huge build time degradation in new beta release. For example, node target in prod mode took</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Version: webpack 5.0.0-beta.0
Time: 231016ms"><pre class="notranslate"><code class="notranslate">Version: webpack 5.0.0-beta.0
Time: 231016ms
</code></pre></div>
<p dir="auto">instead of</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Version: webpack 4.40.2
Time: 147028ms"><pre class="notranslate"><code class="notranslate">Version: webpack 4.40.2
Time: 147028ms
</code></pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">I recorded graphs via <code class="notranslate">webpack.debug.ProfilingPlugin</code> for browser and node targets in both modes (dev and prod). I tried to open it but chrome stucks in the processing phase and closes devtool after that. Could you try to open it?</p>
<p dir="auto"><a href="https://drive.google.com/file/d/13HA58298lrtX6FjJ833YuHkPqhYSU8Fj/view?usp=sharing" rel="nofollow">https://drive.google.com/file/d/13HA58298lrtX6FjJ833YuHkPqhYSU8Fj/view?usp=sharing</a></p>
<p dir="auto">Link to config: <a href="https://github.com/7rulnik/webpack-config-v5-beta-built-time-issue/pull/1/files">https://github.com/7rulnik/webpack-config-v5-beta-built-time-issue/pull/1/files</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Seems that it should take same or less time</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  v5.0.0-beta.0<br>
Node.js version: v12.10.0<br>
Operating System: macOS 10.15</p>
<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong><br>
webpack 5.45.0 (latest) doesn't work with jQuery 3.6.0 (latest):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in ./node_modules/jquery/dist/jquery.js 936:9
Module parse failed: Unexpected token (936:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|  * @param {Function} fn Passed the created element and returns a boolean result
|  */
&gt; function assert( fn ) {
|       var el = document.createElement( &quot;fieldset&quot; );
|
 @ ./assets/js/index.js 1:0-23 65:21-22 73:23-24

webpack 5.45.0 compiled with 1 error in 3015 ms"><pre class="notranslate"><code class="notranslate">ERROR in ./node_modules/jquery/dist/jquery.js 936:9
Module parse failed: Unexpected token (936:9)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|  * @param {Function} fn Passed the created element and returns a boolean result
|  */
&gt; function assert( fn ) {
|       var el = document.createElement( "fieldset" );
|
 @ ./assets/js/index.js 1:0-23 65:21-22 73:23-24

webpack 5.45.0 compiled with 1 error in 3015 ms
</code></pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<ol dir="auto">
<li>Install <code class="notranslate">webpack</code>, <code class="notranslate">webpack-cli</code> and <code class="notranslate">jquery</code>.</li>
<li>Create 1 entrypoint which should be a file that imports jQuery.</li>
<li>Run webpack in production mode.</li>
</ol>






<p dir="auto"><strong>What is the expected behavior?</strong><br>
Successful compilation (downgrade only the <code class="notranslate">webpack</code> package to 5.44.0 solves the problem).</p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  5.45.0<br>
Node.js version: 16.5.0<br>
Operating System: Debian GNU/Linux 10.10 x64<br>
Additional tools: -</p>