compression based on file type?

Dec 15, 2008 at 9:27 PM
is the option available to choose file types?



I do not see any reason why I should reference my CSS Files within my build task.
Dec 15, 2008 at 10:32 PM
Hi Roni,

um .. i'm not sure i understand the question properly. Could you please try explaining it again?

Are you saying that you do not understand why you would include CSS files in a build task ... where the build task can minify each CSS file and then optionally combine all the css files into one output file?
Dec 16, 2008 at 5:04 AM
Edited Dec 16, 2008 at 5:04 AM
exatly, in the samples i have seen i should define filenameA.css / filenameB.css / etc. instead of this it would be much easier
if i could define something like: input:"*.css" -> output:"merged.css"
Dec 16, 2008 at 5:09 AM
Ahh - i gotcha now! kewl!

Er. no. i'm not going to do that .. but i'll accept a patch if someone else does that, for the project. Why not? Lack of time, right now.
Dec 16, 2008 at 10:03 AM
See my request

instead of using *.css.. i suggest to parse the master and/or aspx file.

ps. also lack of time right now to submit a patch
Dec 16, 2008 at 10:06 PM
I personally don't see the benefits for parsing aspx files or master files? i mean, we start to loose couple the build from the project, but we will still have multiple build task items.
Lastly, i seriously don't think that will work for another reason. Imagine u have the following :-

* File1.css
* File2.css
* File1.js
* File2.js
* File3.js

ok... i've parsed that file, figured out there's 2 css and 3 js files. kewl. i've compressed AND combined them. kewl. now i need to go back and MODIFY that Index.aspx file to _not_ list those 2x css and 3x js files and replace it with 1x css and 1x js. Er.. no way :( That could cause lots of probs.

The Index.aspx (and other files) should only have the name of the css file and the name of the js file that will contain all the combined results. Otherwise, if you're not combining, then these css/js files are replaced with their new compressed results.

The difference is that before YUICompressor task is ran, the destination css/js files are a list of the source css and js files, which will be replaced by the combined result.
did that make sence? Hmm. i might have to provide some html front-end code examples if it doesn't.
Feb 11, 2009 at 5:31 PM
MSBuild can easily batch files for a task. You just need to use the CreateItem task to use wildcards.

Read the example I posted here: