Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/build-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function compile(path, options) {
insertGlobals: options.insertGlobals,
detectGlobals: options.detectGlobals,
ignoreMissing: options.ignoreMissing,
bundleExternal: options.bundleExternal,
basedir: options.basedir,
debug: options.debug,
standalone: options.standalone || false,
Expand Down
7 changes: 7 additions & 0 deletions test/directory/no-bundle-external.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports.server= function(){
var path= require('path')
console.log('Expose for server')
}
module.exports.client= function(){
console.log('Expose for client')
}
18 changes: 18 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ app.get('/opt/no-minify.js', browserify(__dirname + '/directory/no-minify.js', {
debug: false
}));

app.get('/opt/no-bundle-external.js', browserify(__dirname + '/directory/no-bundle-external.js', {
bundleExternal: false,
debug: false,
}));

var port;
(function () {
var listeners = [];
Expand Down Expand Up @@ -437,3 +442,16 @@ describe('options.noParse', function () {
});
});
});

describe('options.bundleExternal= false', function () {
it('Exclude node_modules and builtins', function (done) {
this.slow(1000)
this.timeout(20000)
var start = new Date();
get('/opt/no-bundle-external.js', false, function (err, res) {
if (err) return done(err);
assert.equal(res.match(/Copyright Joyent, Inc/), null);
done();
});
});
});