Use the --exclude
option together with --node
:
browserify --node -s GlobalVariable your-script.js -o bundle.js --exclude some-dependency
This will create the bundle.js
file which will define the GlobalVariable
variable if there is no CommonJS environment.
--node
is a handy option if you want to run the bundle in Node, not in the browser.
The --exclude
option will exclude the some-dependency
module from the output bundle.
Check out the Browserify Usage section.