开发者

Compress Java Script files and CSS files automatically

I am using Google App Engine with JQuery, I want to know if there is any plugin or a way to compr开发者_高级运维ess 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 :(


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜