Chirp Chirp:Visual Studio Add-IN for DotLess、Js、and Css Files


http://www.weirdlover.com/2010/05/22/visual-studio-add-in-for-dotless-js-and-css-files/
Update: Chirpy has new feat ures,and you can download the source code from Codeplex.So,onece you’re finished reading this,head on over to this post.  You’d think minification would be a lot cooler and easure.Like,say,Honey,I Shrunk The Kids.But,alas.Wayne Brantleased a nice DotLess trantor a couple months ago.Before that、 Phil Haack created a nice T 4 template for masing and minifying DotLess,Css,and Js files.Today,in the spirit of my Zippy Series,I’ve enhanced Wayne’s creation with a couple of new feature,which I’ll discuss briflybelow.Before you get to to to to frity,make sure to dowload Chipy Zippy here.Also,if you’re new to working with Visual Studio AddIns,or if you just need a little help installing Chirpy Zippy,feel free to check out the instructions page.It shoult dn’t take you more than a couble of minutes to set Zippy up.And now,drum roll,shocand a we,get naked please,or sit there,and let’s just geright dowto buness.The starts. added Chirpy Zippy to our AddIns folder,let’s put it to good use.Add a new javascript file to your project.We’ll cal it hello.chirp.js.Adding the".chirp.js"suffix to our filename is Zippy's cue to look after the file.Quickly,you'll notice that new javascript file has a"codebend"file.Asnap.Asnap. 
chirpJs Chirp Chirp: Visual Studio Add In for DotLess, Js, and Css Files
Codebehind
Now,whenever we make modifications to our javascript file,the「min.js」version of the file will–you gesed it–be a minifed file that we can use howe see fit.If you’re wondering,Zipty thes. YUI Compress or to do his copressing.Zippy also fondles styleesheets.For example,create a styless caled「hello.chirp.css」and(.if you can't see what's commhere,I fear for yourchildrent)voila:
HelloChirpCss Chirp Chirp: Visual Studio Add In for DotLess, Js, and Css Files
ロクファミリア
Zippy also handles .less files.For example,add“howdy.chirp.less”to your project,and you’ll get both a minifed and a non-minifed css file.Not too shaby:
HowdyChirpLess Chirp Chirp: Visual Studio Add In for DotLess, Js, and Css Files
One Minified、One Not
What about masthingAdd as many .chirp.com nfig files to your project as you want.In the config file,you can specify file groups.You can also specify which files get minifed: 
<root> 
    <FileGroup Name="group1.js"> 
        <File Path="jquery-1.4.1.min.js" Minify="false" /> 
        <File Path="jquery.json.js" /> 
        <File Path="MicrosoftAjax.js" /> 
    </FileGroup> 
 
    <FileGroup Name="group2.js"> 
        <File Path="jquery-1.4.1.min.js" Minify="false" /> 
        <File Path="jquery.json.js" /> 
    </FileGroup> 
 
    <FileGroup Name="group1.css"> 
        <File Path="../Styles/jquery-ui-1.8.custom.css" /> 
        <File Path="../Styles/colorbox.css" /> 
        <File Path="howdy.chirp.less" /> 
    </FileGroup> 
</root> 
Saving the above cong figfile relt in the following windowing out Prot filed:
mash.chirp  Chirp Chirp: Visual Studio Add In for DotLess, Js, and Css Files
McNuget
Think that’s itNope.If you’re super-lazy,you can mash together all of the files in a folder: 
<root> 
    <FileGroup Name="main.scripts.js"> 
        <Folder Path="/" Type="*.min.js" Minify="false"/> 
        <File Path="MicrosoftAjax.js" /> 
    </FileGroup> 
</root> 
—  1.引用Chirpを追加する  2.Add in-manage 3.作成*.chirp.co.nfigファイル4.参考にする