JS-CSS-compiler is a project mainly written in Python, based on the MIT, Apache-2.0 licenses found.
A simple script to compile JavaScript and CSS. Uses YUI compressor and closure compiler
Requirements: Java, Python
This is a handy script that combines the closure compiler by Google (http://code.google.com/closure/compiler/) and the YUI compressor by Yahoo (http://developer.yahoo.com/yui/compressor/). It allows you to combine then minify your JavaScript and CSS into single files. Configuration is done through a manifest and thus this is a great script to call in your build scripts before deploying. Nothing too exciting but useful none the less!
To use the compiler simply call:
python compiler.py <path_to_manifest>
A manifest is just a file containing valid JSON. It describes how to compile your code
{
"project": "my_project",
"js": {
"dirs" : ["js/"],
"libs" : [
"js/lib/jquery.js",
"js/lib/jquery-ui.js"
],
"excludes" : ["js/test/file.js"],
"removeExpanded": true,
"output" : "../compiled/"
},
"css": {
"dirs" : ["style/"],
"excludes" : [],
"removeExpanded": true,
"output" : "../compiled/"
},
"static": [
{"from" : "style/textures/",
"to" : "../compiled/textures/"}
]
}
project
:string='project' the name of your project
js.dirs
:array=[] the list of directories to include. Accepts directories and files.
js.libs
:array=[] a list of libraries to include. Accepts directories and files.
js.excludes
:array=[] list of files to exclude from the compilation
js.removeExpanded
:bool=false set to true to remove the non-minified versions of your code
js.output
:string: the location in which to output the JavaScript files
css.dirs
:array=[] the list of directories to include. Accepts directories and files.
css.excludes
:array=[] list of files to exclude from the compilation
css.removeExpanded
:bool=false set to true to remove the non-minified versions of your code
css.output
:string: the location in which to output the CSS files
static
:array=[] list of objects containing from and to keys. This defines where to copy files from and to. Accepts files and directories
object.string()
(or similar) method on it.project.js
and the second project.min.js
. Setting removeExpanded
to false removes the larger file (i.e. project.js
)