-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The right way to pass external
dependency
#201
Comments
Can you pass the command line flags to browserify via |
@kolya-ay I ran into the same problem. I was able to define budo({
browserify: {
plugin: [
[ bundler => bundler.external('./vendor') ],
// ...
],
// ...
},
// ...
}) This works fine for me, but isn't very intuitive, and doesn't seem like the "right" way to do it. @mattdesl What do you think about a new opt, named The code from above would become: budo({
configureBundler: bundler => bundler.external('./vendor')
// ...
}) Then the new option could be put in the documentation and anyone needing to configure |
@mattbrunetti Wow! Thank you, nice workaround! May be instead of adding any special options, allow budo (optionally) to accept b = browserify('src', { transoform: babelify });
b.external('./vendor')
budo({ browserify: b }) Looks doable |
@kolya-ay — passing a bundler might seem great but it introduces a lot of room for errors. It would actually have to be written like this for it to work as expected: b = browserify('src', {
transform: babelify,
cache: {},
packageCache: {},
debug: true
});
b.external('./vendor')
budo({ browserify: b }) Allowing any bundler to be passed would generally add a lot of complexity to budo and additional API surface area & considerations. @mattbrunetti — If there's a specific case where Here's another example, minimizing the bundle size of the slug package: // dev.js
require('budo').cli(process.argv.slice(2), {
browserify: {
plugin: bundler => bundler.ignore('unicode/category/So')
}
}) Then, you can use the script like regular budo CLI: node dev.js src/index.js:bundle.js --live -- -t babelify It might be great to add this to the docs somewhere. |
@mattdesl, yes I see now. It looks like the browserify incoherence anyway. I prefer not to have Should I close this or keep it as "update the docs" reminder? Can't help here due my poor English.. |
Thanks for the workaround, @mattbrunetti! The budo API doesn't accept a stream as an entry point, so I'm currently passing the path to an empty file as an entry point, then using |
It seems that browserify doesn't allow to pass some options through its
opts
object. How can I accomplishbrowserify('./src').external('./vendor')
with budo?The text was updated successfully, but these errors were encountered: