Skip to content
/ jscs Public

Javascript compilation service - simply does compile your JS files when you need it

Notifications You must be signed in to change notification settings

katlex/jscs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript compilation service

What's this?

Javascript compilation service is a set of Scala routines around well known libs, helping to build and develop Javascript code (as well as Coffeescript code too in future).

There are ideally three ways of using it:

  1. Local HTTP service compiler.
$ jscs-serv --port 7770
  1. Using from SBT
addSbtPlugin("com.katlex" % "jscs-sbt" % "1.0")
  1. CLI JS project compiler
$ jscs-cli compilation.conf >target.js

See Runmodes for details.

Installation

To install this instal conscript first. Follow instructions there. After it is installed use this command to intall JSCS:

$ cs --no-exec katlex/jscs

This will install ~/bin/jscs bat or sh script (depending on your OS). And you should be able to run jscs command starting

Runmodes

1. Local HTTP service

IMPORTANT: This is the only implemented runmode at moment!

Is a local (aimed to run on the localhost) HTTP service based on Unfiltered HTTP servicing toolkit and Google Closure compiler.

It serves for compile multiple JS files on a hard disk and serve compiled single JS file on a well known URL as a stream with application/x-javascript mime-type.

To use it just run install the app and run jscs. Configuration files should be places to ~/.closure-compiler-server directory.
Compilation result is mapped to http://localhost:7770/${config_file_name} URL. See also configuring info.

2. SBT plugin mode

To be driven by SBT. Helping to build script artifacts for web projects.

3. CLI JS project compiler

Can be used from any build script to build JS/Coffescript sources into a single minified JS.

Configuration

Compilation configuration files file have the following format:

BASE=/Users/alun/Work

srcRoot $BASE/rm-html5/rm-js/src/main/javascript

exclude generated

First line declares a variable to be used in further declarations.
Second line adds sources root. That root will be scanned recursively for *.js files and they all will be added the compilation config.
Third line excludes all files from the compilation config where word "generated" is present in the absolute path.

About

Javascript compilation service - simply does compile your JS files when you need it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages