broccoli-middleware
Broccoli asset builder middleware
Installation
npm install broccoli-middlewareLicense
Broccoli was originally written by Jo Liss and is licensed under the MIT license.
Broccoli asset builder middleware
Broccoli asset builder middleware
npm install broccoli-middlewareBroccoli was originally written by Jo Liss and is licensed under the MIT license.
application/octet-stream.application/wasm files (drop mime library in favor of mime-types).postinstall hook. This removes a spurious dependency on
multidep.build event to watcherbeginBuild/endBuild (formerly start/end) events on builderAdd watcher.watch() method. Watcher no longer automatically starts
watching; instead, you must call this method explicitly. It returns a promise
that is fulfilled if you later call watcher.quit(), or rejected if watching
one of the source directories fails.
server will call watcher.watch() for you.getMiddleware expects a watcher that is already watching..read/.rebuild APIBuilder API changes:
new Builder has a tmpdir option, which defaults to os.tmpdir()
(typically /tmp); pass { tmpdir: './tmp' } to get the old behavior.build() no longer returns a promise to the output path; instead, the
output path stored at builder.outputPath and doesn't change between
buildsstart, end, nodeStart, nodeEnd events renamed to
beginBuild, endBuild, beginNode, endNodenodeBegin/nodeEnd arguments are "node wrapper"
objects (also accessible at builder.nodeWrappers); timings now
reside at nodeWrapper.buildState.selfTime/totalTime and are in
milliseconds, not nanosecondsbuild() no longer takes a willReadStringTree callback argument;
instead, source directories are recorded at builder.watchedPathsWatcher API changes:
watcher.quit() method, which returns a promise until a running
build has finished (if any)watcher.current to watcher.currentBuild, and remove
watcher.thenRSVP.EventTarget instead of EventEmitter for eventsBuild error objects have been changed to Builder.BuildError objects, which
contain additional information at err.broccoliPayload
Watcher and getMiddlewareBuilder.getDescription(tree) helper functionCache-Control header for directory listings and redirectsliveReloadPath middleware option in directory listings as wellautoIndex middleware option to disable directory listingsbuild output directory already exists.read API.rebuild
API,
in addition to existing (now deprecated) .read API.rebuild-based
pluginsvarcleanup method to be asynchronous (by returning a promise).broccoli servebroccoli build output by copying the files or
directories they point to into placelogo and test directories from npm distributionbroccoli serve when there is no index.htmlwillReadStringTree callback argument to Builder::build and retire
Builder::treesReadWatcher and Builder interaction to prevent double builds.Watcher's change event to provide the full build results (instead of just the directory).broccoli serve output.Builder::build() method to return a { directory, graph } hash
instead of only the directory, where graph contains the output directories
and timings for each treeBrocfile.js now exports a tree, not a function (sample diff)broccoli.MergedTree; it has been extracted into broccoli-merge-trees
(sample diff)broccoli.makeTree('foo') in favor of string literals (just 'foo')
(sample diff)broccoli.Reader--version command line optionbroccoli.helpers into broccoli-kitchen-sink-helpers package.treeDir property on error objectslocalhost instead of 0.0.0.0 (whole wide world) by defaultbower-config package instead of bower to parse bower.json
files--port, --host, and --live-reload-port options to serve commandBrocfile.js, accept lowercase brocfile.jsBroccolifile.js to Brocfile.jstree.cleanup non-optionalbroccoli.read to broccoli.makeTreehelpers.walkSync (now in node-walk-sync)Transformer into broccoli-transform package (now "Transform")Filter into broccoli-filter package.afterBuild with .cleanupfactory.env into broccoli-env packagefactory argument to Broccolifile.read-based everything-is-a-tree architectureMergedTreebroccoli.bowerTrees(), which will hopefully be redesigned and go
away againComponent base classCompilerCollection and Compiler base class; use a TransformerTree::addTransform, Tree::addTrees, and Tree::addBowerBuilder::build now has a promise interface as wellTree, not a Builder, returned from Broccolifile.jsReader into TreePreprocessorPipeline and Preprocessor with Filter; each
Filter is added directly on the tree or builder with addTransform0.0.0.0 instead of localhostfactory.env based on $BROCCOLI_ENV