<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/main.xsl"?>
<b:blog xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://blog.othree.net"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://blog.othree.net http://blog.othree.net/blooog.xsd">
	<b:blogTitle>O3noBLOG</b:blogTitle>
	<b:blogDescription></b:blogDescription>
	<b:entries>
		<b:entriesMeta>
			<b:listType>s</b:listType>
			<b:listData listID="000542" baseName="yuicompressor">YUI Compressor</b:listData>

			<b:previous>
				<b:mTitle>超展開檢視</b:mTitle>
				<b:mDate>2008/09/29</b:mDate>
				<b:mBase>super-expand</b:mBase>
			</b:previous>


			<b:next>
				<b:mTitle>逆勢操作的Rockman 9</b:mTitle>
				<b:mDate>2008/10/11</b:mDate>
				<b:mBase>rockman-9</b:mBase>
			</b:next>

		</b:entriesMeta>
		<b:entry entryID="000542" baseName="yuicompressor">
			<b:author>
				<b:authorName>othree</b:authorName>
				<b:authorEmail>othree@gmail.com</b:authorEmail>
				<b:authorUrl></b:authorUrl>
			</b:author>
			<b:datetime>
				<b:date>2008-10-11</b:date>
				<b:time>20:45:47</b:time>
			</b:datetime>
			<b:category>script</b:category>

			<b:CommentsAccepted>1</b:CommentsAccepted>



			<b:PingsAccepted>1</b:PingsAccepted>


			<b:title>YUI Compressor</b:title>
			<b:content>
				<b:summary>這東西好像很久以前有看過一次，那時不知道為什麼沒深入接觸（或許是看到java就逃跑了），期間還有試過perl的javascript compressor，不過用起來都不是很方便，直到前陣子看到DK示範了一下才又提起興趣，可惜我的blog剛搬離研究室的電腦，而且linux上也不像FreeBSD上有port好的，所以就變成需要在windows下使用，用命令列操控是還算方便，不過因為是包成jar檔，檔名又蠻長的，打命令的時候還蠻辛苦的，所以就寫了個batch檔案來處理： SET PP=D:\tools\yuicompressor\ java -jar %PP%yuicompressor.jar --charset utf-8 %1 %2 %3 %4 %5 %6 %7 %8 %9 確定檔案路徑和基本的選項之後，把這個batch檔丟到path下的目錄，以後就可以用這個指令來壓縮js和css檔了，不過在我自己的電腦上還有遇到別的問題，就是.bat檔不會真的執行，不知道做了什麼事才變成這樣，總之又去找了bat2exec把bat檔轉成com檔，不過這個小程式出處不明，希望沒有什麼木馬在裡面@@。 事後感想是windows的命令列能不能好用一點啊Q_Q。...</b:summary>
				<b:mainContent><p><a href="http://developer.yahoo.com/yui/compressor/">這東西</a>好像很久以前有看過一次，那時不知道為什麼沒深入接觸（或許是看到java就逃跑了），期間還有試過<a href="http://dean.edwards.name/packer/">perl的javascript compressor</a>，不過用起來都不是很方便，直到前陣子看到<a href="http://blog.gslin.org/archives/2008/09/22/1705/">DK示範了一下</a>才又提起興趣，可惜我的blog剛搬離研究室的電腦，而且linux上也不像FreeBSD上有port好的，所以就變成需要在windows下使用，用命令列操控是還算方便，不過因為是包成jar檔，檔名又蠻長的，打命令的時候還蠻辛苦的，所以就寫了個batch檔案來處理：</p>



<pre><code>SET PP=D:\tools\yuicompressor\
java -jar %PP%yuicompressor.jar --charset utf-8 %1 %2 %3 %4 %5 %6 %7 %8 %9</code></pre>



<p>確定檔案路徑和基本的選項之後，把這個batch檔丟到path下的目錄，以後就可以用這個指令來壓縮js和css檔了，不過在我自己的電腦上還有遇到別的問題，就是.bat檔不會真的執行，不知道做了什麼事才變成這樣，總之又去找了<a href="http://www.programmersheaven.com/download/14524/download.aspx">bat2exec</a>把bat檔轉成com檔，不過這個小程式出處不明，希望沒有什麼木馬在裡面@@。</p>

<p>事後感想是windows的命令列能不能好用一點啊Q_Q。</p></b:mainContent>
				<b:extendContent></b:extendContent>
			</b:content>
			<b:comments commentCount="2">

				<b:comment commentID="094570" entryID="000542">
					<b:author>
						<b:authorName>Alica</b:authorName>
						<b:authorEmail></b:authorEmail>
						<b:authorUrl>http://www.alica.idv.tw/</b:authorUrl>
					</b:author>
					<b:datetime>
						<b:date>2008-10-11</b:date>
						<b:time>22:32:46</b:time>
					</b:datetime>
					<b:content>
						<b:mainContent><p>NT系的話應該用Windows Script Host，功能會比舊的batch強得多。</p></b:mainContent>
					</b:content>
				</b:comment>

				<b:comment commentID="094572" entryID="000542">
					<b:author>
						<b:authorName>othree.net</b:authorName>
						<b:authorEmail></b:authorEmail>
						<b:authorUrl>http://blog.othree.net</b:authorUrl>
					</b:author>
					<b:datetime>
						<b:date>2008-10-12</b:date>
						<b:time>01:14:43</b:time>
					</b:datetime>
					<b:content>
						<b:mainContent><p>還沒看過WSH XDD</p></b:mainContent>
					</b:content>
				</b:comment>

			</b:comments>
			<b:trackbacks trackbackCount="0" trackbackURL="http://othree.net/cgi-bin/mt/mt-tb.cgi/540">

			</b:trackbacks>
		</b:entry>
	</b:entries>
</b:blog>