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




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">development mode , only modify css file trigger webpack hot reload, will follow error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;e&gt; [webpack-dev-middleware] assets by status 40.6 KiB [cached] 1 asset
&lt;e&gt; assets by info 4.22 KiB [hmr]
&lt;e&gt;   assets by chunk 3.3 KiB (name: common)
&lt;e&gt;     asset css/common.css 1.8 KiB [emitted] [hmr] (name: common) (id hint: styles, vendors)
&lt;e&gt;     asset common.3dda70a80101f291712e.hot-update.js 1.5 KiB [emitted] [immutable] [hmr] (name: common) (id hint: styles, vendors)
&lt;e&gt;   asset runtime.3dda70a80101f291712e.hot-update.js 902 bytes [emitted] [immutable] [hmr] (name: runtime)
&lt;e&gt;   asset 3dda70a80101f291712e.hot-update.json 40 bytes [emitted] [immutable] [hmr]
&lt;e&gt; assets by path js/ 3.64 MiB
&lt;e&gt;   asset js/common.js 3.6 MiB [emitted] (name: common) (id hint: styles, vendors)
&lt;e&gt;   asset js/runtime.js 42.3 KiB [emitted] (name: runtime)
&lt;e&gt;
&lt;e&gt; ERROR in Conflict: Multiple assets emit different content to the same filename css/common.css
&lt;e&gt;
&lt;e&gt; webpack 5.0.0-beta.32 compiled with 1 error in 303 ms"><pre class="notranslate"><code class="notranslate">&lt;e&gt; [webpack-dev-middleware] assets by status 40.6 KiB [cached] 1 asset
&lt;e&gt; assets by info 4.22 KiB [hmr]
&lt;e&gt;   assets by chunk 3.3 KiB (name: common)
&lt;e&gt;     asset css/common.css 1.8 KiB [emitted] [hmr] (name: common) (id hint: styles, vendors)
&lt;e&gt;     asset common.3dda70a80101f291712e.hot-update.js 1.5 KiB [emitted] [immutable] [hmr] (name: common) (id hint: styles, vendors)
&lt;e&gt;   asset runtime.3dda70a80101f291712e.hot-update.js 902 bytes [emitted] [immutable] [hmr] (name: runtime)
&lt;e&gt;   asset 3dda70a80101f291712e.hot-update.json 40 bytes [emitted] [immutable] [hmr]
&lt;e&gt; assets by path js/ 3.64 MiB
&lt;e&gt;   asset js/common.js 3.6 MiB [emitted] (name: common) (id hint: styles, vendors)
&lt;e&gt;   asset js/runtime.js 42.3 KiB [emitted] (name: runtime)
&lt;e&gt;
&lt;e&gt; ERROR in Conflict: Multiple assets emit different content to the same filename css/common.css
&lt;e&gt;
&lt;e&gt; webpack 5.0.0-beta.32 compiled with 1 error in 303 ms
</code></pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- git clone git@github.com:easy-team/awesome.git
- git checkout webpack5
- cd boilerplate/react
- yarn
- npm run dev"><pre class="notranslate"><code class="notranslate">- git clone git@github.com:easy-team/awesome.git
- git checkout webpack5
- cd boilerplate/react
- yarn
- npm run dev
</code></pre></div>
<ul dir="auto">
<li>The demo can run depends on another issue(<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="705028827" data-permission-text="Title is private" data-url="https://github.com/webpack-contrib/mini-css-extract-plugin/issues/590" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/mini-css-extract-plugin/pull/590/hovercard" href="https://github.com/webpack-contrib/mini-css-extract-plugin/pull/590">webpack-contrib/mini-css-extract-plugin#590</a> ) to be resolved and merged for release.</li>
<li>Modify <code class="notranslate">src/router/component/home.css</code>  file, trigger webpack hot reload, will above error.   If only modify javascript file , can works.</li>
</ul>





<p dir="auto"><strong>What is the expected behavior?</strong></p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  webpack 5.0.0-beta.32<br>
Node.js version:  v12.14.0<br>
Operating System:  Mac<br>
Additional tools:</p>
<h1 dir="auto">Bug report</h1>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">When using <code class="notranslate">require.context(__dirname, true, /\.mdl\.ts$/)</code> the context <code class="notranslate">keys()</code> are duplicated.<br>
I tested the same code with webpack@4.44.2 and it works as expected (see expected behavior).</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto">Using webpack@5.5.1, I created 3 files in my <code class="notranslate">./src</code> folder.</p>
<ol dir="auto">
<li>index.ts</li>
<li>bootstrap.mdl.ts</li>
<li>api.mdl.ts</li>
</ol>
<p dir="auto">Inside <code class="notranslate">index.ts</code> I'm using <code class="notranslate">require.context()</code> as follow:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const context = require.context(__dirname, true, /\.mdl\.ts$/);"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">.</span><span class="pl-en">context</span><span class="pl-kos">(</span><span class="pl-s1">__dirname</span><span class="pl-kos">,</span> <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>mdl<span class="pl-cce">\.</span>ts<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">When observing the <code class="notranslate">context.keys()</code> I get the following list of files:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[&quot;./bootstrap.mdl.ts&quot;, &quot;./api.mdl.ts&quot;, &quot;bootstrap.mdl.ts&quot;, &quot;api.mdl.ts&quot;]"><pre class="notranslate"><span class="pl-kos">[</span><span class="pl-s">"./bootstrap.mdl.ts"</span><span class="pl-kos">,</span> <span class="pl-s">"./api.mdl.ts"</span><span class="pl-kos">,</span> <span class="pl-s">"bootstrap.mdl.ts"</span><span class="pl-kos">,</span> <span class="pl-s">"api.mdl.ts"</span><span class="pl-kos">]</span></pre></div>






<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">The <code class="notranslate">context.keys()</code> should return the following list with no file duplications:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="[&quot;./bootstrap.mdl.ts&quot;, &quot;./api.mdl.ts&quot;]"><pre class="notranslate"><span class="pl-kos">[</span><span class="pl-s">"./bootstrap.mdl.ts"</span><span class="pl-kos">,</span> <span class="pl-s">"./api.mdl.ts"</span><span class="pl-kos">]</span></pre></div>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  5.5.1<br>
Node.js version: 14.13.0<br>
Operating System: macOS 11.0.1 (20B29)<br>
Additional tools:</p>