Integrate yui compressor in Visual Studio .net

Step 1: Download yui compressor from following url.

http://yuilibrary.com/downloads/yuicompressor/yuicompressor-2.4.2.zip

Step 2: Extract all the files  to your hard drive c:\yuicompressor-2.4.2

Step 3: Open Visual Studio 2005/2008

Step 4: Open Tools -> External Tools (see screensot)

Open Tools -> External Tools

Dialog appears.

Step 5: Add new external tool (see screenshot)

Add new external tool
  • Click on Add Button
  • Type Title e.g. Compress It! (YUI)
  • Type Command: java.exe
  • Type Arguments: -jar “C:\yuicompressor-2.4.2\build\yuicompressor-2.4.2.jar” $(ItemPath) –charset “UTF8” –type js -o $(ItemFileName)-min$(ItemExt)
  • Type Initial directory: $(ItemDir)
  • Check “Use Output window” checkbox
  • Click on “Apply” button
  • Click on “OK” button

Step 6: Open/Select any js file (see screenshot)

Step 7: Use yui compress from Tools  (see screenshot)

Step 8: Right click on folder and click on “Refresh Folder” (see screenshot)

Step 9: Verify minfied javascript file in same folder (see screenshot)

Advertisements

3 thoughts on “Integrate yui compressor in Visual Studio .net”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s