Skip to content

Automatically minify JavaScript files in a particular folder.

Notifications You must be signed in to change notification settings

toekneestuck/closure-auto-compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Closure Auto Compiler

The Closure Auto Compiler utilizes Google's Closure Compiler to automatically minify Javascript files as they are updated on your file system.

Currently, once executed via the command line the auto-compiler will poll a given directory for any *.js files that have been recently updated. Once it finds a candidate it performs the minification, resulting in a newly updated *.min.js file.

Requirements

Installation

Download the latest Closure Compiler from the Google Code page, and place the compiler.jar file somewhere on your computer (typically /usr/local/lib or the like).

Checkout the js-auto-compiler script somewhere in your $PATH (make it executable via chmod +x).

Create a configuration file called /etc/default/closure with your desired polling frequency and the path to the compiler.jar file. Example

/etc/default/closure

CLOSURE_COMPILER="/usr/local/lib/compiler.jar"
FREQUENCY=5 # poll every 5 seconds

Usage

Run the following command in a terminal to start auto-compiling:

user@hostname:~$ js-auto-compiler /path/to/js/
Scanning directory: /path/to/js ...
  minifying: somefile.js => somefile.min.js

About

Automatically minify JavaScript files in a particular folder.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%