Concatter
Helper utility to build single-file JavaScript applications.
It uses NodeJS-styled require
function calls to resolve file concatenation order.
It is quite experimental at the moment and does not support cyclic dependencies.
Usage
$ concatter --help
Usage: concatter [options]
Options:
-h, --help output usage information
-b, --base <path> base path for modules
-i, --indent <indent> indent for module wrapping
-o, --output <path> name of the output file
-V, --version output the version number
Example
Lets say we have project with the following structure:
example/
|-- module1
| `-- a.js
|-- module2
| `-- b.js
`-- module3
`-- c.js
and a.js
, b.js
, c.js
are following:
a.js:
var b = ; exports { console;};
b.js:
var c = ; exports { console;};
c.js:
exports { console;};
then the project is compiled to a single file using the command concatter --base example
which results in the following output:
module1 = {};module1a = {};module2 = {};module2b = {};module3 = {};module3c = {}; module3c = { exports { console; }; return exports;}{}; module2b = { var c = module3c; exports { console; }; return exports;}{}; module1a = { var b = module2b; exports { console; }; return exports;}{};