Jump to content

Recommended Posts

(I don't know whether this should be in this forum or an installation forum? Please move if required.)

 

I am coming close to making my site go live and it has always been on the back of my mind to minimise and obfuscate the javascript code before I launched whiles keeping a raw copy in my sandbox site. I haven't yet come to trying the obfuscating of the code (and might not do as the minimisers already make it hard as hell to read plus to do some obfuscating already).

 

I have found several reviews on all of the different minimisers and the two top ones that people talk about are the YUI compressor and Uglify, with the latter being better in terms of compression rate / speed but the former also compresses css code.

 

However, I cannot find a single useful guide anywhere on how to install either these programs onto my server. For the Uglify version there is a handy online website that has it implemented for people to use, but I just don't feel comfortable sending my code to another persons server and back not knowing exactly what's going on (although I did test it on one of my smaller files and got 49% compression).

 

The Uglify program does give an installation guide, but it uses commands such as 'git clone git://github.com/mishoo/UglifyJS.git'. I am using PuTTY as my ssh client and it does not recognise this. I tried changing it to 'wget https://github.com/mishoo/UglifyJS/zipball/master' and this did not work either.

 

So my question is. Has anyone had any experience with either of these programs? If so, could you tell me how to install it to my server?

 

Or is there a program I can download to my computer that can minimise the script without having to go through putty?

 

I also tried the online javascriptcompressor.com (aka packer) but this just threw up error after error on the JSLint validator, even after I double checked to make sure there was a ';' at the end of every line, and the script would not work on my website. I would be better off just manually removing the white space than using that.

 

Thank you for any help

Joe

Link to comment
https://forums.phpfreaks.com/topic/249254-obfuscate-or-minimise-programs/
Share on other sites

The Uglify program does give an installation guide, but it uses commands such as 'git clone git://github.com/mishoo/UglifyJS.git'. I am using PuTTY as my ssh client and it does not recognise this. I tried changing it to 'wget https://github.com/mishoo/UglifyJS/zipball/master' and this did not work either.

 

`git clone` is a Git command. You need to install Git and then have a directory where you can clone the remote repository to.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.