Use webpack to load all files in a directory without requiring a require statement
<p>I have a large number of javascript files scattered across 4 subdirectories of my application. In grunt I collect them all and compile them into one file. There is no module.exports function for these files. </p>
<p>I want to split them into 4 parts using webpack. I don't want to reference all the files manually. </p>
<p>I want to create a plugin that walks the directory tree at compile time and gets all the .js file names and paths, then references all the files in the subdirectories and adds them to the output. </p>
<p>I want all the files in each directory to be compiled into a module which can then be referenced from my entry file or included as mentioned in http://webpack.github.io/docs/plugins.html in resources. </p>
<p>When a new file is added, I just want to put it into the correct directory and know it will be included. </p>
<p>Is there a way to achieve this using webpack or a plugin written by someone else? </p>