Sublime-Minifier icon indicating copy to clipboard operation
Sublime-Minifier copied to clipboard

Enhancement: Replace API calls by offline alternatives

Open quentind opened this issue 13 years ago • 5 comments

Replace calls to online API by local alternatives in order to make the plugin work offline (cool when working out of office).

quentind avatar Jul 16 '12 08:07 quentind

+1

primeminister avatar Feb 06 '13 10:02 primeminister

The primary issue with this is that UglifyJS (the default JS minifier relied upon by this plugin) is written in JavaScript, and runs on a Node.js server. I'm not sure including an installation of Node with Sublime-Minifier would be a good (or plausible) idea, so Python alternatives would work much more nicely.

SlimIt (GitHub Project) seems to be a good candidate for inclusion; it provides good output and is native Python.

Minify is in Python too, but I've not used it myself.

It looks like it wouldn't take much tweaking to get the offline processing integrated.

ticky avatar Apr 11 '13 01:04 ticky

The problem with this approach is that these tools are not consistent over the online ones. Maybe they introduce some bugs or are less efficient. I can't rely on them unless they are using the same API/methods to compress files.

bistory avatar Apr 11 '13 06:04 bistory

This will remain true as long as Sublime Text uses Python and UglifyJS uses JavaScript, unfortunately. From the looks of the structure of this plugin, it should be easy enough to add a compiler which runs the command-line uglifyjs command, so perhaps allowing for that would be a good option.

How open are you to pull requests to add support for alternate compilers, offline or otherwise?

ticky avatar Apr 11 '13 07:04 ticky

I'm open to pull requests if they are well tested and commits are not too invasive (don't try to change syntax or fix something at the opposite of the PR).

bistory avatar Apr 11 '13 07:04 bistory