Automatically compress JS/CSS?

Discussion in 'Programming' started by Triexa, Jun 30, 2008.

  1. #1
    I want to have compressed/minified JS and CSS on my live site but obviously the raw, originals on my local development server.

    Does anyone have any ideas on how I could sort of automate/speed up the process? I imagine it would be fine to manually compress the first few times, but after that, it would get annoying!

    Thanks!
     
    Triexa, Jun 30, 2008 IP
  2. ahmadfarhan

    ahmadfarhan Peon

    Messages:
    211
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    ahmadfarhan, Jun 30, 2008 IP
  3. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #3
    Nigel Lew, Jun 30, 2008 IP
  4. Triexa

    Triexa Active Member

    Messages:
    580
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Thanks but I'm not looking for an online, "manual" solution. Would just get too annoying very quickly...
     
    Triexa, Jun 30, 2008 IP
  5. ahmadfarhan

    ahmadfarhan Peon

    Messages:
    211
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    then JSMin is what you are looking for.
    http://code.google.com/p/jsmin-php/ (direct link to the download that the blog post was talking about.)
    you have your .js files all readable and editable.. but when users request it.. it will be minified on the fly...

    I linked to the blog post so that you can see how to use it. The google code page is the site for the software itself
     
    ahmadfarhan, Jun 30, 2008 IP
  6. Nigel Lew

    Nigel Lew Notable Member

    Messages:
    4,642
    Likes Received:
    406
    Best Answers:
    21
    Trophy Points:
    295
    #6
    Nigel Lew, Jun 30, 2008 IP