Executes a command whenever the bundle is created.
{
"browserify": {
"transform": [ "commandify" ]
},
"commandify": "make all",
"dependencies": {
"commandify": "~0.1.0"
}
}
commandify.cmd = 'make hello';
commandify.dir = __dirname + '/compile';
browserify()
.require(require.resolve('./makeify/main.js'), { entry: true })
.bundle()
.pipe(...);
COMMANDIFY_CMD='make all' COMMANDIFY_DIR='./compile' browserify -t commandify main.js ....
npm install commandify
-
The command to be executed (only needed if not defined via
package.json
config).- Source:
-
The directory in which the command is to be executed (only needed if not defined via
package.json
config).- Source:
-
browserify transform which executes a shell command exactly once for every time the bundle is created.
The command can be configured
{ "browserify": { "transform": [ "commandify" ] }, "commandify": "make all" }
In this case the command is executed in the directory in which the
package.json
is defined.COMMANDIFY_CMD='make all' COMMANDIFY_DIR='./compile' browserify main.js ....
commandify.cmd = 'make hello'; commandify.dir = __dirname + '/compile'; browserify() .require(require.resolve('./makeify/main.js'), { entry: true }) .bundle() .pipe(....);
Name Type Description file
string file whose content is to be transformed
through stream
- Type
- TransformStream
generated with docme
MIT