Skip to content

Compiles multiple JavaScript files with Google Closure Compiler application in a right order

Notifications You must be signed in to change notification settings

timvasil/kjscompiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##Kjscompiler Makes compilation of multiple JavaScript files with Google Closure Compiler application in right order.

Goal is to convert layout at input:

from

In to minifed layout:

to

With respect to internal and external dependencies.

###Requirements Requires Java Runtime Environment version 7.

###How to run java -jar kjscompile.jar

###Kjscompile.json Instead of kjscompile.json you can specify your own path to configuration file with --settings %path% attribute.

basedir - directory with JavaScript files;

output - output JavaScript file name;

pattern - rule for filename (*.js);

level - level of optimization (WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZATIONS).

Example:

{
	"basedir": "js",
	"output": "js.min/all.js",
	"level": "SIMPLE_OPTIMIZATIONS",
	"pattern": "*.js"
}

###Annotating JavaScript files Kjscompiler can use information about JavaScript file to build right compiling chain.

Tag Example Description
@depends @depends {somescript.js} Specifies dependency on other file.
@ignore @ignore File with this mark will be ignored.
@external @external File with this mark will be considered as external. It will not be compiled, but it will give no unknown variable error during the compilation.
/**
 * kjscompiler annotation
 * @depends {somescript}
 * @depends {dir/otherscript}
 */
/**
 * kjscompiler annotation
 * @ignore
 */
/**
 * kjscompilerannotation
 * @external
 */

###Debug To debug add --debug true in call line.

###Licence kjscompiler

Copyright (C) 2014 Oleksandr Knyga, oleksandrknyga@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

About

Compiles multiple JavaScript files with Google Closure Compiler application in a right order

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 91.6%
  • JavaScript 8.1%
  • Shell 0.3%