|
JSCompile
How to use JSCompile
What is JSCompile?JSCompile is a Python script that concatenates and minifies JavaScript files. Used without any options, this script will search the current directory for a build file (defaults to 'build.txt'), parse that file to get a list of JavaScript files, concatenate the contents of those files and then save a production (defaults to 'all.js', minified using jsmin) and a debug (defaults to 'all-debug.js', unminified) version of the output. Using the all flag will cause the script to perform its operations on the current directory and any subdirectories (ignoring .svn directories). Using the lint flag will cause the script to run each JavaScript file through JSLint before it is compiled. Using the noexecute flag will cause the script to ignore any execute statements found in the build file. Using the noprompt flag will cause the script to not prompt before running any execute statements. Passing values for the build, prod or debug flags will tell the script to use the passed values instead of the default values. Usagejscompile [-h|--help] [-a|--all] [-l|--lint] [-X|--noexecute] [-P|--noprompt] [-b|--build <file>] [-p|--prod <file>] [-d|--debug <file>] Using it in this manner assumes that you can execute the command 'python' from the command line. You may have to tweek the shebang line in the file in order to get this to work. You can also run this script in the following manner: python jscompile <options> Options
Build FilesA build file is a simple text file that should specify one JavaScript file or one directory, relative to the build file's location, per line. Subdirectories of specified directories will also be searched. Files that don't end in '.js' will be ignored. Empty lines are ignored. Lines beginning with '//' are treated as comments and ignored. The following statements can also be added to the build file and will override any default settings or settings that were passed in on the command line.
DependenciesPython - The Python programming language. |
Sign in to add a comment