Browserify.bundle()

Bundle the specified script and its required dependencies into a single JavaScript file.

Usage

Hover over inputs/exits for more info.

var Browserify = require('machinepack-browserify');


// Bundle the specified script and its required dependencies into a single JavaScript file.

Browserify.bundle({

path: '/Users/mikermcneil/.tmp/foo',

exportAs: 'Whatever',

}).execSync();

Inputs

path required

The absolute path to the entry point (if path is relative, will be resolved from pwd)

'/Users/mikermcneil/.tmp/foo'
exportAs

The variable name under which to expose any `module.exports` from this script; either on the `window` global, or using the semantics of another detected module system (like AMD/RequireJS).

'Whatever'

Exits

error

An unexpected error occurred.

success

OK.

'((function(require){(return function (){alert("hi it\'s me" + \n" and i sure am messy");\nvar x = 1+1;\n'