How to dynamically create a new file that should be included in the bundle with webpack?
<p>I want to modify my webpack config with a custom middleware or loader that helps me by:</p>

<ul>
<li>Finding all <code>src/**/*.srv.js</code></li>
<li>Creating or updating a file that:

<ul>
<li>Imports them</li>
<li>Exports them in an object
( export default { x, y, z, etc } )</li>
<li>Include new file in bundle so I can easily use them in <code>main.js</code></li>
</ul></li>
</ul>

<p>This is a simplified usecase of what I actually need, but if I know how to do this, I can solve the rest myself.</p>

<p>Any ideas?</p>