Right now really need help to understand webpack, although I'm trying so much, im still not understand how I can use webpack as a task runner rather than just module bundler. This is a learning process, so please lets not discuss of why gulp/webpack is better than other for this kind of job.

You see the code is actually pretty simple, the idea is to crawl every htmlfile based on a template that injected with a variable from css and js with the same name. This gulpfile is what I use in order to create Polymerjs Html File.

Is there any way I could convert this into Webpack specific build tools? Where should I put the information to crawl the folder in the webpack? Should I put it into index.js?

I understand the concept of using a specific entry files for Webpack, but when facing this kind of usecase, what should I do?