Clone this wiki locally
Additionally, since all code is inlined “flatten” eliminates usage of the “new Function()” API which, like “eval()”, is sometimes restricted, for example in Adobe AIR.
Some people also find the load performance of a “flattened” application to be better, in particular when using the split option. Using the “—split N” argument will split the script file into N files, which allows the browser to download them in parallel. Browsers can typically download 2 to 6 files in parallels, so that would be a good range to try for the “—split” parameter.
Usage: flatten [OPTIONS] INPUT_PROJECT OUTPUT_PROJECT
-m --main MAIN: The relative path (from INPUT_PROJECT) to the main file (default: ‘main.j’)
-F --framework FRAMEWORKS: Add a frameworks directory, relative to INPUT_PROJECT (default: [‘Frameworks’])
-P --path PATHS: Add a path (relative to the application root) to inline.
-f --force: Force overwriting OUTPUT_PROJECT if it exists
--index INDEX: The root HTML file to modify (default: index.html)
-s --split NUMBER: Split into multiple files
-c --compressor COMPRESSOR: Select a compressor to use (closure-compiler, yuicompressor, shrinksafe), or “none” (default: shrinksafe)
--manifest: Generate HTML5 cache manifest.
-v --verbose: Verbose logging
-h --help: displays usage information (final option)