-
Notifications
You must be signed in to change notification settings - Fork 87
Support Arrays in browserify conf #280
base: master
Are you sure you want to change the base?
Support Arrays in browserify conf #280
Conversation
@@ -39,7 +39,11 @@ function configure(bundler, cfg) { | |||
if (type === 'transform' && typeof o[type] === 'object') { | |||
bundler[type](o[type].name, _.omit(o[type], 'name')); | |||
} else { | |||
bundler[type](o[type], _.omit(o, type)); | |||
var values = o[type]; | |||
if (!Array.isArray(values)) values = [values]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing { } for if statement body
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
`exclude` and `ignore` would not accept an Array of paths before, since `Browserify.prototype.exclude/ignore` was expecting a single file as argument.
cfc092e
to
a3f94e0
Compare
Please double check if the change does not break some other option that only accepts an array, since I didn't check it myself. |
@dasilvacontin please check that or better yet write a test for this. |
(gotta go, will investigate the others later) |
Before,
exclude
andignore
would not accept an Array of paths sinceBrowserify.prototype.exclude/ignore
was expecting a single file asargument.
Need to check if this change breaks behaviour for other browserify opts
that do accept or expect an Array as arg.