This commit fixes #243 - hotfix call browserify.require(file, opts)

This commit is contained in:
TheKiba
2016-08-06 02:20:44 +02:00
parent c113fbc731
commit 5d56a05531
+7 -1
View File
@@ -89,9 +89,15 @@ function bundle(input, nc, options, complete) {
for (let i = 0; i < options.browserifyRequires.length; i++) {
let lib = options.browserifyRequires[i];
let name = lib.file || lib; // for object format.
// if `lib` is object then fetch all params without `file`
// otherwise returns empty object
let opts = (lib instanceof Object) && Object.keys(lib)
.filter((key) => key !== 'file')
.reduce((acc, key) => { return acc[key] = lib[key], acc }, {})
|| {};
_log('Force including \'%s\' in browserify bundle', name);
bproc.require(lib);
bproc.require(lib, opts);
}
}