Command line interface - marcbaechinger/craft.js GitHub Wiki
A simple command line interface is available:
usage: node app/cli.js [options] file.js
-
-l /path/to/repository
path to the repository directory from where to load dependencies -
-m || --mangle
mangles by transforming the ast of the code -
-s || --squeeze
squeezes the ast even more -
-b || --beautify
format ast nicely by dropping comments
# resolve dependencies and concatenate source files from current working directory
node app/cli.js resources/src/applications/craftjs/bootstrap.js
# same with explicit repository root set by -l
node app/cli.js -l /repositroy/common resources/src/applications/craftjs/bootstrap.js
# mangle and squeeze the source code (AST tranformation)
node app/cli.js -m -s resources/src/applications/craftjs/bootstrap.js
# mangle, squeeze and beautify (AST tranformation)
node app/cli.js -m -s -b resources/src/applications/craftjs/bootstrap.js