Build assembler for the Ender CLI
npm install ender-builder
|11||downloads in the last day|
|150||downloads in the last week|
|336||downloads in the last month|
|Version||1.0.3 last updated 7 days ago|
|Dependencies (6)||ender-args-parser, async, errno, glob, mu2, uglify-js|
A component of the Ender CLI but can also be used as a stand-alone tool to assemble Ender builds.
Ender Builder is responsible for bundling up all required packages and their dependencies into a single ender.js file (and its associated ender.min.js file). It does not install packages, that is left up to the main Ender CLI. It expects to find the packages it needs in the node_modules directory.
Ender Builder isn't responsible for including the "client lib" (ender-js) in the list of packages to be bundled, that is left up to the main Ender CLI before deferring the build to Ender Builder.
Ender Builder uses ender-minify for build minification so it understands
If you install with
npm install ender-builder -g then you'll get an
ender-builder executable that you can use to build ender.js files given a list of packages that already exist in the node_modules directory (remember to include ender-js if you need it).
$ ender-builder ender-js bonzo bean traversty --output winning.js
For more information check out http://ender.jit.su
enderBuilder(options, packages, dependencyGraph, callback)
Ender Builder exports a single main function. You must provide it with a standarrd Ender
options object (which can be obtained from ender-args-parser), an array of
packages (which is available on
options.packages if you are parsing the command line), a
DependencyGraph object (obtained from ender-dependency-graph) and a
callback function to be notified when building is finished.
The callback signature is:
function (err, filename) where
filename is the name of the unminified file, usually ender.js.
enderBuilder.minify(options, source, callback)
minify() is a wrapper around ender-minify that basically takes an
options object and turns it into a form that ender-minify can understand.
Contributions are more than welcome! Just fork and submit a GitHub pull request! If you have changes that need to be synchronized across the various Ender CLI repositories then please make that clear in your pull requests.
Ender Builder uses Buster for unit testing. You'll get it (and a bazillion unnecessary dependencies) when you
npm install in your cloned local repository. Simply run
npm test to run the test suite.
Ender Builder is Copyright (c) 2012 @rvagg, @ded, @fat and other contributors. It is licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.