<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">Using a test of the form</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rules: [{
  test: /\/filename.ext$/
}]"><pre class="notranslate"><code class="notranslate">rules: [{
  test: /\/filename.ext$/
}]
</code></pre></div>
<p dir="auto">will fail on node users in the MINGW64 / msys2 / msysgit environment because the path separator is <code class="notranslate">\</code>.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<ol dir="auto">
<li>Run webpack in a native Windows environment.</li>
<li>Observe path separators are \ and not /.</li>
<li>Observe this interacts poorly with path testing in Webpack.</li>
</ol>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">Paths might have to be tested twice, once with forward slashes and once with backslashes.</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  5.32.0<br>
Node.js version: v16.0.0<br>
Operating System: Windows 10<br>
Additional tools: MSYS2 (i.e. the native bash provided by the Git client for Windows)</p>
<p dir="auto">I'm attempting to use dynamic requires, but I want the mappings to have lower-case aliases (I'm experimenting with the routing). When I'm using it like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="compiler.plugin('context-module-factory', function (cmf) {                                          
    cmf.plugin('alternatives', function (items, callback) {                                         
        items.push({                                                                                
            context: items[0].context,                                                              
            request: items[0].request.substr(0, items[0].request.length - 3).toLowerCase()          
        });                                                                                         
        callback(null, items);                                                                      
    });                                                                                             
});                                                                                                 "><pre class="notranslate"><code class="notranslate">compiler.plugin('context-module-factory', function (cmf) {                                          
    cmf.plugin('alternatives', function (items, callback) {                                         
        items.push({                                                                                
            context: items[0].context,                                                              
            request: items[0].request.substr(0, items[0].request.length - 3).toLowerCase()          
        });                                                                                         
        callback(null, items);                                                                      
    });                                                                                             
});                                                                                                 
</code></pre></div>
<p dir="auto">I end up with this in the bundle:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var map = {
    &quot;./Dialogue&quot;: 22,
    &quot;./Dialogue.js&quot;: 22,
    &quot;./Locales&quot;: 23,
    &quot;./Locales.js&quot;: 23,
    &quot;./dialogue&quot;: 24,
    &quot;./locales&quot;: 25
};"><pre class="notranslate"><code class="notranslate">var map = {
    "./Dialogue": 22,
    "./Dialogue.js": 22,
    "./Locales": 23,
    "./Locales.js": 23,
    "./dialogue": 24,
    "./locales": 25
};
</code></pre></div>
<p dir="auto">It works, but it attaches the same blocks twice, which isn't how it's intended. Is there a way to overcome this without dirty hacks?</p>