Folder Structure
Please refer below two images for folder structure.
https://i.stack.imgur.com/5aEzi.png | https://i.stack.imgur.com/Hsapz.png
How can we write a task in root gulfile.js (without creating gulpfile.js for each and individual folder) to minify CSS and JS for this kind of file structure? In addition, it should store the minified version of the file into that respective folder only. For example, if I am making changes in page3 CSS and JS file, it should store the minified CSS in /page3/css/page3.min.css and the same way it should store the minified JS in /page3/js/page3.min.js.
Same way, I am just wondering if it is possible to set the watch so for example if you are making changes in page2 CSS and JS, it detects that and after saving file it stores the minified version in their respective folder only.
I am still learning gulp and trying to figure this out but I am not able to.
Going forward, folder structure may go one level deep. Like page3 has its sub page and that subpage has it's own CSS and JS folder. it would be great if that could be covered as part of this answer as well.
Any help would be appreciative.
Thanks in an advance.