Skip to content

Commit

Permalink
I worked around not bundle sources when you set browseField false.
Browse files Browse the repository at this point in the history
It was caused by injecting `require('process')` line, even if you
set browseField false

fix browserify#1835
  • Loading branch information
toshiyuki-rs committed Apr 15, 2020
1 parent 6bca7e0 commit 3d1ac1f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Expand Up @@ -607,10 +607,11 @@ Browserify.prototype._createDeps = function (opts) {
}
}, opts.insertGlobalVars);
}

var vars = xtend({
process: function () { return "require('_process')" },
}, opts.insertGlobalVars);
var vars = {};
if (self._options.browserField) {
vars.process = function () { return "require('_process')" };
}
vars = xtend(vars, opts.insertGlobalVars);

if (opts.bundleExternal === false) {
vars.process = undefined;
Expand Down

0 comments on commit 3d1ac1f

Please sign in to comment.