Client-side JavaScript using YUI Compressor

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2009 08:03 AM
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.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2009 08:45 AM
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
Look at the ant targets "minimize-slingshot-javascript" and "minimize-slingshot-deployed-javascript"
Mike

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-01-2009 11:38 PM
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.
"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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-02-2009 04:50 AM
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
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
