cancel
Showing results for 
Search instead for 
Did you mean: 

Client-side JavaScript using YUI Compressor

pqr
Champ in-the-making
Champ in-the-making
Alfresco share supports compressed .js file. So is there anyway, whatever changes we make for example, in abc.js that automatically gets reflected into compressed file(abc-min.js) without using YUI compressor from command line.
3 REPLIES 3

mikeh
Star Contributor
Star Contributor
I'm not sure your question makes sense - you want the -min.js version to be generated without the YUI Compressor? You can copy the uncompressed .js into -min.js (i.e. it doesn't have to be compressed) but that rather defeats the purpose.

Look at the ant targets "minimize-slingshot-javascript" and "minimize-slingshot-deployed-javascript"

Mike

pqr
Champ in-the-making
Champ in-the-making
Thanks for the reply Mike

"automatically gets reflected" - for that, I meant,some other file(may be makefile) that runs in background during deployment of webscript. so each time, we dont need to do it manually,

or the other thing,

component.head.inc - which puts .js to -min.js, if I dont include that file in the webScript, is it ok or it would defeats the purpose.

mikeh
Star Contributor
Star Contributor
It depends what you're trying to achieve. If you're developing and want the browser to load the unminimised JavaScript, then set Share into debug mode by setting the client-debug flag to true (look in web-framework-config-application.xml).

Your other option is to change the <@script> tag into a <script> tag during development, which won't swap to the -min.js version at all.

What we use here is the "incremental-slingshot-tomcat-exploded" ant target, which copies the JavaScript across and then minimises it.

Thanks,
Mike
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.