2

I am using Google App Engine with JQuery, I want to know if there is any plugin or a way to compress my Java Script files and CSS files automatically when publishing it to the GAE server.

It is very difficult to compress all the files manually every time i upload... and when i have to fix some bugs in the JS files, i need to decompress them :(

2
  • 2
    You shouldn't be decompressing to edit. You should save your uncompressed originals in a source control system and then compress automatically via some batch process (makefile, batch file, script, etc...) as part of your final build when you prepare files for deployment. You shouldn't be decompressing to edit as compression throws away stuff (like comments). Commented Sep 15, 2011 at 6:00
  • possible duplicate of How do I automate Javascript and CSS minification on Google App Engine? Commented Sep 15, 2011 at 9:33

2 Answers 2

1

Yahoo has a minifier for both Javascript and CSS that runs in Java. So if you're using Java server-side then this may help.

Uglifyjs is an excellent Javascript minifier written in Javascript. If you're using something like node.js this may help.

Depends if you can do this stuff before pushing to Google app engine or actually on Google app engine.

Sign up to request clarification or add additional context in comments.

3 Comments

What are the alternatives today, 2021 ?
@LucianoBrum Personally I still use uglifyjs2. There is a 3rd version, and I assume it's better
1

Are you editing locally? If so, just edit scripts.js and style.css and run a compiler that will compile into scripts.min.js and style.min.css. Update your app to call these files and you're good to go.

If you use Node.js - For JS, check out uglifyJS and there are a few for CSS as well.

If you use another language, I'm sure someone on here can make a recommendation.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.