Search code examples
javascriptnode.jsbrowserify

Browserify multiple files into a single bundle


Currently, I browserify a single js file into a bundle.js

$ browserify X1.js --standalone XXX > bundle.js

What if I have multiple js files and want to join them into a single browserified bundle.js

How should the command look like? Can I do something like this?

$ browserify X1.js X2.js --standalone XXX > bundle.js

I am using node.js v6


Solution

  • You have already answered your own question. I confirm that it is correct.

    $ browserify X1.js X2.js --standalone XXX > bundle.js