<p dir="auto">I have such code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="new webpack.NormalModuleReplacementPlugin(
            REG_EXP_FOR_FILES,
            function (result) {
                const matches = result.request.match(REG_EXP_FOR_FILES);
                const routes = `${matches[1]}/index.js`;

                if (fs.existsSync(path.resolve(__dirname, routes))) {
                    result.request = routes;
                }
            }
        ),"><pre class="notranslate"><code class="notranslate">new webpack.NormalModuleReplacementPlugin(
            REG_EXP_FOR_FILES,
            function (result) {
                const matches = result.request.match(REG_EXP_FOR_FILES);
                const routes = `${matches[1]}/index.js`;

                if (fs.existsSync(path.resolve(__dirname, routes))) {
                    result.request = routes;
                }
            }
        ),
</code></pre></div>
<p dir="auto">But in case of file doesn't exist I have error <code class="notranslate">Module is not found</code>. But I need to have no errors and have no hook files like <code class="notranslate">empty.js</code>.</p>
<p dir="auto">Ho can skip file resolving with normal modules resolver?</p>
<p dir="auto">Not sure if this is a watcher issue or a build issue in general, but I've found that sometimes I'm getting empty bundles and/or empty source maps. My wild guess why this is happening is that if I reload my application at juuust the right moment, it locks the bundle/map file so that webpack can't write its contents. Is that possible?  Has anyone else seen this behavior?</p>
<p dir="auto">I would expect either an error event or stat error or warning to be generated, but that doesn't seem to be happening.</p>