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:
- Local HTTP service compiler.
$ jscs-serv --port 7770
- Using from SBT
addSbtPlugin("com.katlex" % "jscs-sbt" % "1.0")
- CLI JS project compiler
$ jscs-cli compilation.conf >target.js
See Runmodes for details.
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
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.
To be driven by SBT. Helping to build script artifacts for web projects.
Can be used from any build script to build JS/Coffescript sources into a single minified JS.
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.