Install JavaScript & CSS Minifier in Sublime text 3

This is a short guide on how to install Javascript & CSS Minifier, called Sublime-Minifier. This minifier works for both sublime text 2 and 3 and supports all platforms –  Linux, Mac OS & Windows.

1. using git, clone the following repository in your sublime packages directory.

Note: the packages directory may differ depending upon your OS and sublime text installation. this one worked for me on ubuntu 16.04. Please refer this if this one didn’t work.

aman@vostro:~$ sudo apt-get install git
aman@vostro:~$ cd ~/.config/sublime-text-3/Packages
aman@vostro:~/.config/sublime-text-3/Packages$ git clone git://github.com/bistory/Sublime-Minifier.git
Cloning into 'Sublime-Minifier'...


2. Now, that its installed, usage is quite simple with some keyboard shortcuts.

Linux

ctr + alt + m – minify js/css code in the current buffer.
ctrl + alt + shift + m – minify js/css code in the current buffer and save it in another file.

Mac OS

⌘ + alt + m – minify js/css code in the current buffer.
⌘ + alt + shift + m – minify js/css code in the current buffer and save it in another file.

Leave a Reply

Your email address will not be published.