Normalize Build
High level builder for normalize
using with normalize-builder and file-watch.
The JS API is as close to nlz-build(1)
's API as possible.
- Automatically includes the
require()
implementation - Automatically executes the entry point -
require(boot)
- Automatically watch for file changes and reuilbd
API
var Build = var builder =
builder = Build(options)
Pretty much all the same as the other libraries.
directory: 'repositories'
- directory to install all the remote dependenciesagent
- a normalize-agent instance
builder.add(entrypoint, options)
Add an entry point. Must be an absolute URI.
JavaScript options:
require: true
- include therequire()
implementationautorequire: true
- automatically execute the entry point
builder.watch()
Run as a watcher. The process remains open, and the entry points will automatically rebuild on file changes.
var text = yield* builder.build(entrypoint)
Build a specific entry point. Returns the result as a string.
var results[] = yield* builder.build()
Without an entrypoint
, .build()
will build all the entry points in the order defined.
If you forget, check .entrypoints
.
tree
Event: Every time the tree is resolved.
build
Event: <entrypoint>
Every time an entry point is built, an event by its name will be built.
build
Note
If you don't use .watch()
,
you should just use builder.build()
,
then options.agent.close()
to close the connection to the server.
Otherwise, the process will never exit.