Update: Chirpy has new features, and you can download the source code from Codeplex. So, once you’re finished reading this, head on over to .

 


You’d think minification would be a lot cooler and easier. Like, say,. But, alas.

 a couple months ago. Before that,  for mashing and minifying DotLess, Css, and Js files. Today, in the spirit of my , I’ve enhanced (or deprecated [on?]) Wayne’s creation with a couple of new features, which I’ll discuss briefly below.

Before you get too frisky, make sure to download Chirpy Zippy .

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 . It shouldn’t take you more than a couple of minutes to set Zippy up.

And now, drum roll, shock and awe, get naked please, or sit there, and let’s just get right down to business. The business: for starters, assuming we’ve already  to our AddIns folder, let’s put it to good use. Add a new javascript file to your project. We’ll call 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 our new javascript file has a “codebehind” file. Ah, snap:

 

Codebehind!

Now, whenever we make modifications to our javascript file, the “min.js” version of the file will–you guessed it–be a minified file that we can use however we see fit. If you’re wondering, Zippy uses the  to do his compressing.

Zippy also fondles stylesheets. For example, create a stylesheet called “hello.chirp.css,” and (..if you can’t see what’s coming here, I fear for your children) voila:

Look Familiar?

Zippy also handles  files. For example, add “howdy.chirp.less” to your project, and you’ll get both a minified and a non-minified css file. Not too shabby:

One Minified, One Not

What about mashing? Add as many .chirp.config files to your project as you want. In the config file, you can specify file groups. You can also specify which files get minified:

  
      
          
          
          
              
          
          
              
          
          
          
       
 

Saving the above config file results in the following outputted files:

McNugget

Think that’s it? Nope. If you’re super-lazy, you can mash together all of the files in a folder:

  
      
          
          
       
 

 

1.添加引用 Chirp 

2.Add in-manage

3.创建*.chirp.config文件

4.借鉴上