I am running jsmin to compress all the javascript files of my ASP.Net web application as a postbuild event in the csproj file like this:
“JsMin.exe”
“$(ProjectDir)script”
“$(ProjectDir)script\minified.js”
This was working fine when I kept all js files in the root of the script folder. But as it was starting to become alot of files in this folder, I decided to divide the files into subfolders. Now it seems that jsmin only fetches the js files in the root folder, and I cannot see that it has any option to include files in sub-folders. Does anyone have a good solution for a situation like this? Would seem to me that it should be a pretty common thing to do, so that is why I was a bit surprised it was not a parameter to jsmin.exe enabling sub-folders.
You should be able to use DOS’
forcommand to do that:That assumes the scripts are in (or in directories within) a directory named ~/scripts/debug and minifies them to ~/scripts/release with the .js replaced by .min.js.
I’ve tested that in CMD, but not as a build event in VS. So, you may need to tweak the syntax slightly.