使用CLI定制输出文件的路径,设定值来指定输出文件路径(束)指定要<code>-o</code>为browserify
node node_modules/browserify/bin/cmd src/index -o lib/bundle.js
在上面的例子中,输出文件路径为./lib/bundle.js
。
不过,我不希望使用CLI,我想用JS SDK:
const browserify = require('browserify');
const b = browserify();
b.add('./src/index.js');
b.bundle(/* Where to specify the output filepath, is it here */)
.pipe(/* or here*/)
我的头将打破因为这个库。坦率地说,webpack文档更好。
任何帮助是赞赏