In my app file I ended up placing require
require.context( "./common", // 上下文文件夾 true, // 包括子目錄 /.*/ // 正則表達式 )("./" + expr + "")
Thanks for this post: https://github.com/webpack/webpack/issues/118
Now it's adding all my files. I have a loader for html and css that seems to work fine.
Here's what I did to achieve this:
function requireAll(r) { r.keys().forEach(r); } requireAll(require.context('./modules/', true, /\.js$/));