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
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
Share Improve this question asked Nov 8, 2016 at 10:18 guagay_wkguagay_wk 28.1k63 gold badges198 silver badges309 bronze badges 3 |3 Answers
Reset to default 13You have already answered your own question. I confirm that it is correct.
$ browserify X1.js X2.js --standalone XXX > bundle.js
If your command line supports expansion, you can use *
to include all files in a directory:
$ browserify *.js --standalone XXX > distribution/bundle.js
Use the browserify command to build a bundle
$ browserify X1.js X2.js > bundle.js
browserify [entry files] {OPTIONS}
, yes, you can add as many files as you want like you are doing in your second command. – Eduardo Páez Rubio Commented Nov 8, 2016 at 10:31