This library is our "ideal build script" wrapped up into a module. It supports all of the following:
There is a PostCSS analog here: postcss-crawl.
options object can have these properties:
input: path of the input directory containing all your mainfiles (which may be in nested directories). Required.
output: path of your output directory, typically
dist, etc. Required.
indexName: name of the main-file(s) that you want to get bundle. Defaults to
log: Boolean whether to print log messages. Defaults to
watch: Boolean whether to use watchify and watch for changes to files. Defaults to
sourceMapUrl: Url prefix that will be used to access sourcemaps. Defaults to the output path
uglify: Whether to uglify your code after browserifying it. Defaults to
gzip: Whether to gzip your code (will save to
output/filename.js.gz). Defaults to
The second parameter,
browserifyOptions, takes the options from the browserify api, such as
const crawl =const browserifyOptions =transform: 'es2040'const crawlOptions =input: 'source/js'output: 'dist/js'gzip: trueuglify: truewatch: falsesourceMapUrl: '/js'