Last active
March 4, 2017 16:57
-
-
Save muya/1cd6ce82490d2c0f2e0a to your computer and use it in GitHub Desktop.
Sublime Text 3 Plugin to Minify JS & CSS files on save (requires bistory's Sublime Minifier here: https://github.com/bistory/Sublime-Minifier)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
class MinifyOnSave(sublime_plugin.EventListener): | |
def on_post_save(self, view): | |
file_types_to_minify = ['js', 'css'] | |
filenameParts = view.file_name().split('.') | |
if filenameParts[len(filenameParts) - 1] in file_types_to_minify: | |
view.run_command('minify') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment