I'm creating a fairly large library of JavaScript, using Closure Compiler for both its wonderful compression as well as the type-checking and warning systems.
I want to create multiple output files though, because the files are loaded asynchronously (and some files are only loaded on-demand).
Poking around the source code, I've found the --module
flag, as well as some related flags. The source code says the following about the option:
A javascript module specification. The format is
<name>:<num-js-files>[:[<dep>,...][:]]]
. Module names must be unique. Each dep is the name of a module that this module depends on. Modules must be listed in dependency order, and js source files must be listed in the corresponding order. Where--module
flags occur in relation to--js
flags is unimportant
... and that's all I can find. I'd love to learn more about how to use this option, does anyone have any experience here? Alternatively, if there's another way to create multiple output files, I'm all ears.