I am currently using Visual Studio 2010 post-build event to minify my JavaScript files. The problem is every time I add a new JavaScript file I have to update the post build event. What I want to do is make the script a bit more flexible.
Directory structure:
\Scripts\
- Script1.debug.js
- Script2.debug.js
- Script3.debug.js
Here is my script's current state:
ajaxmin.exe "$(ProjectDir)Scripts\Script1.debug.js" -out "$(ProjectDir)Scripts\Script1.js" -clobber
ajaxmin.exe "$(ProjectDir)Scripts\Script2.debug.js" -out "$(ProjectDir)Scripts\Script2.js" -clobber
ajaxmin.exe "$(ProjectDir)Scripts\Script3.debug.js" -out "$(ProjectDir)Scripts\Script3.js" -clobber
I want this script to find every *.debug.js file minify it and output it to *.js. How do I achieve this?
Script1.debug.js --> Script1.js
Script2.debug.js --> Script2.js
Script3.debug.js --> Script3.js