This documentation is based on browserify v10.1.x. This is very much a work in progress.
The basic premise of the browserify pipeline is that objects (call them row
or rec
) with certain properties are pushed or written to the beginning ("top") or middle and bundles come out the end ("bottom").
There are 2 types of rows: those representing files to include in the bundle, and those representing transforms. This document will focus on file rows.
So how do you push rows to the browserify pipeline? There are several ways listed below (b
is a browserify instance, row
is an object). This list is meant to be illustrative, not exhaustive. See the documentation for these methods for more information.
browserify('./file_path')
browserify(['./file_path', ...])
browserify({entries: './file_path'})
browserify({entries: ['./file_path', ...]})
b.add('./file_path')
b.add(['./file_path', ...])
b.require('./file_path')
b.require(['./file_path', ...])
b.require([row, ...])
Inserting an objectMode
stream into the browserify pipeline and pushing rows onto its readable side. Existing rows can also be manipulated with such streams.
What are the properties of rows? The best way to explain this is the table below that documents what properties are relevant to what phases of the pipeline and how.
Terms used in this document:
b
opts
b
.
basedir
basedir
value.
prePipeline
browserify()|b.add()|b.require()
.
args
prePipeline
function. For example, in the context of b.require(file, opts)
, args.file
and args.opts
refer to the arguments.
filePath|filePaths
fileObj|fileObjs
rootFile|rootFiles
filePath|filePaths|fileObj|fileObjs
passed to prePipeline
.
row
inRow
row
that enters the phase.
outRow
row
that exits the phase
inRow|outRow
may or may not be the same object, but these names will be used to distinguish whether the value of a property refers to the value it had coming in or the value it has going out. For example, "the same value as outRow.file
" means the value the file
property has in the row coming out of the phase.