简体   繁体   中英

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

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

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

如果您的命令行支持扩展,您可以使用*来包含目录中的所有文件:

$ browserify *.js --standalone XXX > distribution/bundle.js

使用 browserify 命令构建一个包

 $ browserify X1.js X2.js > bundle.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM