Giter Site home page Giter Site logo

closure-auto-compiler's Introduction

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

closure-auto-compiler's People

Contributors

fstrube avatar toekneestuck avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

toekneestuck

closure-auto-compiler's Issues

Use inotifywait instead of sleep

A script I wrote to do the same things uses inotifywait like so:

inotifywait -q -m -e create --format '%w%f' $media/js $media/css | \
while read newfile; do
  compress $newfile
done

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.