Im getting started with webpack but one thing I cannot for the life of me work out is how to take a folder (with possible nested folders), full of .pug templates, and simply compile them to static html and put them in the output folder, maintaining any nested folder structure for each output html file that was in the source templates folder...
I dont want to have to manually specify each individual .pug file, and I definitely dont want webpack to try and parse the .pugs into JS and then attempt to require/import any of the imgs/fonts etc in the pug files and then complain about it, Im just after a basic, static 1:1 compile, pug file in, html file out. Why is it so hard to do that?
gulp
if you are not mainly dealing with js files – Chillifunction requireAll (r) { r.keys().forEach(r); } requireAll(require.context('./src', true, /\.pug$/));
to require every .pug files under src folder and configurefile-loader
to do the copy – Chilli