PDA

View Full Version : yui batch compression



sph
13 May 2009, 8:12 AM
hi all,

i've been playing with extjs in the last month, but when i wanted to deploy my projects i haven't found any solution that parses my files and puts into one minimized file. i found yui compression tool, but it has only one input file parameter.
yes i know, there is a solution for eclipse/aptana but i'm coding in visual studio so these were not real options for me.

so i've created a small tool which gets the development html (which has the references to the .js/.css files) as input, and creates a minimized .js/.css output with yui compression tool.

if you're interested, you can get it here: http://sph3r.com/yui_batch_compressor

cheers.
greg

UPDATE:

- requirements rolled back from .NET3.5 to .NET2.0
- reads any input that contains <script> or <link> tags (including .aspx)
- few shortcut keys added

UPDATE 2:
- console version added.

lvgunst
14 May 2009, 11:34 PM
Great tool!

I use ASP and my Index file is a aspx file. I had to make a index.html without the asp tags (<% %>) because there were some errors with the aspx file:

Name can not start with %, hexidecimal value 0x25. Line 1, position 2.

galdaka
15 May 2009, 1:41 AM
Executable not work for me in Windows XP.

Greetings,

sph
15 May 2009, 2:00 AM
@galdaka:
i guess .net 3.5sp1 is not installed onto your XP. i've used some .net3.5 features so the latest framework is required. however, at the weekend i'll take a look at the code and i try to eliminate 3.5 features and will compile it to .net2.0 version

sph
15 May 2009, 2:04 AM
@lvgunst:
thanks for the reply :) the tool parses the input file as XML, .aspx is not a valid xml that's why it throws the exception. i'll include a textbox where you can add 'exclude tags' or something like this to exclude eg. <%# or <%@ page directives.

lvgunst
16 May 2009, 2:32 PM
@lvgunst:
thanks for the reply :) the tool parses the input file as XML, .aspx is not a valid xml that's why it throws the exception. i'll include a textbox where you can add 'exclude tags' or something like this to exclude eg. <%# or <%@ page directives.

That would be great, thanks!

sph
19 May 2009, 9:27 AM
update done, check readme.txt

lvgunst
20 May 2009, 7:00 AM
Thanks for the update. It works great!

Is it possible to call the program from the commandline so I can integrate it in some build process? It needs some parameter for the ybc file I think

sph
3 Jun 2009, 1:11 PM
commandline version added. usage:
YBC.Console.exe -o c:\path\to\ybc\file.ybc

cheers.

demongloom
3 Jun 2009, 10:58 PM
Hi Sph,
you can look on here http://extjs.com/forum/showthread.php?t=67474 about compression for deployment.

sph
5 Jun 2009, 12:17 AM
demongloom,

yepp, that's an other alternative for deployment.

lvgunst
8 Jun 2009, 11:30 PM
commandline version added. usage:
YBC.Console.exe -o c:\path\to\ybc\file.ybc

cheers.

Thanks for the update. Very useful!