I need to write an advanced concat script using grunt. here is my boilerplate:
___js
|____dist
| |____vents
| | |____commonEvents.js
| | |____compare.js
|____libs
|____src
| |____events
| | |____carousel.common.js
| | |____compare.js
| | |____styles.common.js
| |____handlers
| | |____carousel.common.js
| | |____compare.js
| | |____style.common.js
I want the concat task to look into "src/events" and "src/handlers" directory and find all the files ending with ".common.js" and concat them together and put them in the "dist/vents" directory ("commonEvents.js"), other files that are not ending with ".common.js" I want the script to find the pair in the other directory and concat them together and put them into "dis/vents/filename.js" (example: events/compare.js and handlers/compare.js are pair and not ending with common.js).