Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best App to Minify Javascript code and css code [closed]

What is the best, safe and 100% free tool to be used on doing these task? It has been asked for many times but I want to ask those experienced user.

like image 428
fiberOptics Avatar asked Apr 14 '12 07:04

fiberOptics


People also ask

How do you minify CSS and JS files?

To minify CSS, try CSSNano and csso. To minify JavaScript, try UglifyJS. The Closure Compiler is also very effective. You can create a build process that uses these tools to minify and rename the development files and save them to a production directory.

Should I minify CSS and JavaScript?

It is important to minify your CSS and minimise JavaScript files so they can load faster on your web pages. There are many reasons why you should minify your CSS and JavaScript: Reduce file size: The more code there is in a file, the larger it will be. Minified code is usually much smaller than the original version.

How do you minify CSS vs code?

A Minify button should appear in the status bar when opening a . js or a . css file. You can also run Minify: Document by clicking F1 or CTRL+SHIFT+P .


2 Answers

I use Google Closure Tools, it uses Rhino to intepret your code while modifying it to enusre that it still works after minification. Many free tools exists: YUI Compressor, UglifyJS, etc.

UglifyJS is also good as well, try it here http://marijnhaverbeke.nl/uglifyjs

Google Closure Tools: https://developers.google.com/closure/

like image 193
A Person Avatar answered Sep 28 '22 18:09

A Person


if you google minify there are many online minifiers for js - these basically all do the same thing. In terms of CSS there are similar things that will make the files files smaller. You need to be careful doing this with CSS though as you need to measure maintainability against file size - unless of course you auto minify when releasing to live. You still need to be careful as changing the css could have adverse effects to your site.

like image 44
matpol Avatar answered Sep 28 '22 18:09

matpol