broccoli-middleware
Broccoli asset builder middleware
Installation
npm install broccoli-middleware
License
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-middleware
Broccoli 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
, endNode
nodeBegin
/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.watchedPaths
Watcher 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.then
RSVP.EventTarget
instead of EventEmitter
for eventsBuild error objects have been changed to Builder.BuildError
objects, which
contain additional information at err.broccoliPayload
Watcher
and getMiddleware
Builder.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
pluginsvar
cleanup
method to be asynchronous (by returning a promise).broccoli serve
broccoli 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.html
willReadStringTree
callback argument to Builder::build
and retire
Builder::treesRead
Watcher
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.js
Broccolifile.js
to Brocfile.js
tree.cleanup
non-optionalbroccoli.read
to broccoli.makeTree
helpers.walkSync
(now in node-walk-sync)Transformer
into broccoli-transform
package (now "Transform
")Filter
into broccoli-filter
package.afterBuild
with .cleanup
factory.env
into broccoli-env packagefactory
argument to Broccolifile.read
-based everything-is-a-tree architectureMergedTree
broccoli.bowerTrees()
, which will hopefully be redesigned and go
away againComponent
base classCompilerCollection
and Compiler
base class; use a Transformer
Tree::addTransform
, Tree::addTrees
, and Tree::addBower
Builder::build
now has a promise interface as wellTree
, not a Builder
, returned from Broccolifile.jsReader
into Tree
PreprocessorPipeline
and Preprocessor
with Filter
; each
Filter
is added directly on the tree or builder with addTransform
0.0.0.0
instead of localhost
factory.env
based on $BROCCOLI_ENV